LibreOffice / libexttextcat

BSD 3-Clause "New" or "Revised" License
16 stars 10 forks source link

Build failure when compiling without optimization #2

Open sanmai-NL opened 6 years ago

sanmai-NL commented 6 years ago

When compiling LibreOffice today:

./autogen.sh\
    --enable-dbgutil\
    --disable-odk\
    --enable-epm\
    --with-package-format=archive\
    --disable-gtk3\
    --disable-systray\
    --disable-cups\
    --enable-release-build\
    --enable-python=internal\
    --with-galleries=no\
    --with-java=no\
    --without-fonts\
    --without-help

Leads to:

configure:
==============================================================================
Build configuration:
        werror:          yes
==============================================================================

Making all in src
  CC       common.lo
In file included from /usr/include/bits/libc-header-start.h:33:0,
                 from /usr/include/stdio.h:27,
                 from common.c:39:
/usr/include/features.h:376:4: error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
 #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
    ^~~~~~~
cc1: all warnings being treated as errors
make[4]: *** [Makefile:561: common.lo] Error 1
make[3]: *** [Makefile:373: all] Error 2
make[2]: *** [Makefile:461: all-recursive] Error 1
make[1]: *** [/srv/installers/AUR/libreoffice-slim-git/src/core/external/libexttextcat/ExternalProject_libexttextcat.mk:17: /srv/installers/AUR/libreoffice-slim-git/src/core/workdir/ExternalProject/libexttextcat/build] Error 1

Because of --enable-dbgutil.

The fix would be to only compile with _FORTIFY_SOURCE when optimization is enabled.

dtardon commented 6 years ago

Neither LibreOffice nor libexttextcat enable _FORTIFY_SOURCE and --enable-dbgutil doesn't turn off optimization (--enable-debug does). So the flags must have come from outside.

scarabeusiv commented 6 years ago

Quick solution is to pass --disable-werror to the configure of libexttextcat...

sanmai-NL commented 6 years ago

@dtardon:

--enable-dbgutil doesn't turn off optimization (--enable-debug does)

This information is misleading then.

_FORTIFY_SOURCE is enabled by default on Arch Linux.

The --enable-debug flag was not passed in my case.

sanmai-NL commented 6 years ago

@scarabeusiv: Thanks, I went with --with-system-libexttextcat.

stbergmann commented 6 years ago

Both --enable-debug and --enable-dbgutil disable optimizations by default (and there's --enable-optimized to override that).