When emerging heimdal with LDFLAGS="-Wl,--as-needed" it fails with an symbol error on libroken (the symbol 'crypt'). After reading http://www.gentoo.org/proj/en/qa/asneeded.xml I think that the solution which I can suggest (given my limited present knowlegde in this field) is adding this line to the pkg_setup() in the heimdal ebuild: filter-ldflags -Wl,--as-needed --as-needed My full set of tested LDFLAGS are: LDFLAGS="-Wl,-O1 -Wl,-z,combreloc -Wl,-z,now -Wl,--as-needed -Wl,--sort-common" result: breaks build -------------------------- LDFLAGS="-Wl,-O1" result: builds ok -------------------------- LDFLAGS="-Wl,-O1 -Wl,-z,combreloc -Wl,-z,now -Wl,--sort-common" result: builds ok
Created attachment 84952 [details] ebuild which filters "-Wl,--as-needed"
frederik, please post the error which you are seeing, and reopen the bug
With the app-crypt/heimdal-0.7.2.ebuild I get this error (with the attached heimdal-0.7.2-r1.ebuild it emerges as expected since --as-needed is filtered). x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -I../../lib/roken -I../../lib/roken -I/usr/include/et -Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs -march=k8 -msse3 -O2 -ftracer -pipe -ffast-math -fprefetch-loop-arrays -mfpmath=sse,387 -c parse.c lex.c:1893: varning: no previous prototype for 'yyget_lineno' lex.c:1902: varning: no previous prototype for 'yyget_in' lex.c:1910: varning: no previous prototype for 'yyget_out' lex.c:1918: varning: no previous prototype for 'yyget_leng' lex.c:1927: varning: no previous prototype for 'yyget_text' lex.c:1936: varning: no previous prototype for 'yyset_lineno' lex.c:1948: varning: no previous prototype for 'yyset_in' lex.c:1953: varning: no previous prototype for 'yyset_out' lex.c:1958: varning: no previous prototype for 'yyget_debug' lex.c:1963: varning: no previous prototype for 'yyset_debug' lex.c:1997: varning: no previous prototype for 'yylex_destroy' lex.c:1391: varning: 'yyunput' defined but not used x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I../../include -I../../include -I../../lib/roken -I../../lib/roken -I/usr/include/et -Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs -march=k8 -msse3 -O2 -ftracer -pipe -ffast-math -fprefetch-loop-arrays -mfpmath=sse,387 -c symbol.c /bin/sh ../../libtool --mode=link x86_64-pc-linux-gnu-gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs -march=k8 -msse3 -O2 -ftracer -pipe -ffast-math -fprefetch-loop-arrays -mfpmath=sse,387 -Wl,-O1 -Wl,-z,combreloc -Wl,-z,now -Wl,--as-needed -Wl,--sort-common -o asn1_compile gen.o gen_copy.o gen_decode.o gen_encode.o gen_free.o gen_glue.o gen_length.o hash.o lex.o main.o parse.o symbol.o ../../lib/vers/libvers.la ../../lib/roken/libroken.la -lcrypt -lfl -lresolv -lpthread mkdir .libs x86_64-pc-linux-gnu-gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs -march=k8 -msse3 -O2 -ftracer -pipe -ffast-math -fprefetch-loop-arrays -mfpmath=sse,387 -Wl,-O1 -Wl,-z -Wl,combreloc -Wl,-z -Wl,now -Wl,--as-needed -Wl,--sort-common -o .libs/asn1_compile gen.o gen_copy.o gen_decode.o gen_encode.o gen_free.o gen_glue.o gen_length.o hash.o lex.o main.o parse.o symbol.o ../../lib/vers/.libs/libvers.a ../../lib/roken/.libs/libroken.so -ldb -lcrypt -lfl -lresolv -lpthread creating asn1_compile ./asn1_compile ./k5.asn1 krb5_asn1 /var/tmp/portage/heimdal-0.7.2/work/heimdal-0.7.2/lib/asn1/.libs/lt-asn1_compile: symbol lookup error: /var/tmp/portage/heimdal-0.7.2/work/heimdal-0.7.2/lib/roken/.libs/libroken.so.16: undefined symbol: crypt make[2]: *** [asn1_files] Fel 127 make[2]: Leaving directory `/var/tmp/portage/heimdal-0.7.2/work/heimdal-0.7.2/lib/asn1' make[1]: *** [all-recursive] Fel 1 make[1]: Leaving directory `/var/tmp/portage/heimdal-0.7.2/work/heimdal-0.7.2/lib' make: *** [all-recursive] Fel 1 !!! ERROR: app-crypt/heimdal-0.7.2 failed. !!! Function src_compile, Line 67, Exitcode 2 !!! (no error message) !!! If you need support, post the topmost build error, NOT this status message.
Created attachment 88980 [details, diff] Allow compile without filtering. I've added a patch which should allow you to compile heimdal without having to filter out '-Wl,--as-needed'. To use it just drop the path in the files directory and add 'epatch "${FILESDIR}/as-needed.0.7.2.patch"' to src_unpack BEFORE the eautoreconf line.
Patch works. Please comit to portage tree.
James Cassidy, thanks for the patch, had to modify it since it didn't apply anymore. Fixed in CVS.