Menu

#285 Fails to build on ppc with --as-needed

v3.0.5
open
nobody
None
5
2013-11-27
2013-11-27
No

Hello,

building on ppc fails when the compiler flag --as-needed is used, see https://launchpadlibrarian.net/157524563/buildlog_ubuntu-trusty-powerpc.service-wrapper-java_3.5.22-2_FAILEDTOBUILD.txt.gz:

[exec] gcc -O3 -m32 -fPIC -Wall --pedantic -DLINUX -D_FILE_OFFSET_BITS=64 -fpic -D_GNU_SOURCE -DUNICODE -D_UNICODE -lm -pthread wrapper.c wrapperinfo.c wrappereventloop.c wrapper_unix.c property.c logger.c wrapper_file.c wrapper_i18n.c wrapper_hashmap.c -o ../../bin/wrapper
[exec] /tmp/ccsmvkKO.o: In function wrapperStopPendingSignaled': [exec] wrapper.c:(.text+0xd7e8): undefined reference toceil'
[exec] /tmp/ccsmvkKO.o: In function wrapperStartPendingSignaled': [exec] wrapper.c:(.text+0xda84): undefined reference toceil'
[exec] collect2: error: ld returned 1 exit status
[exec] make[2]: *** [wrapper] Error 1
[exec] make[2]: Leaving directory `/build/buildd/service-wrapper-java-3.5.22/src/c'

In src/c/Makefile-linux-ppc-32.make (and -64) the order of arguments in the wrapper target needs to be changed, so that $(wrapper_SOURCE) comes before -lm.

For a little more explanation on why this is a problem, check out https://wiki.debian.org/ToolChain/DSOLinking#Only_link_with_needed_libraries

Cheers!

Discussion


Log in to post a comment.