Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 130464 - app-crypt/heimdal-0.7.2 breaks with LDFLAGS="-Wl,--as-needed"
Summary: app-crypt/heimdal-0.7.2 breaks with LDFLAGS="-Wl,--as-needed"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Kerberos Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: as-needed
  Show dependency tree
 
Reported: 2006-04-19 05:01 UTC by Fredrik Klasson
Modified: 2007-09-07 11:34 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild which filters "-Wl,--as-needed" (heimdal-0.7.2-r1.ebuild,3.75 KB, text/plain)
2006-04-19 05:03 UTC, Fredrik Klasson
Details
Allow compile without filtering. (as-needed.0.7.2.patch,866 bytes, patch)
2006-06-12 08:24 UTC, James Cassidy
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fredrik Klasson 2006-04-19 05:01:57 UTC
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
Comment 1 Fredrik Klasson 2006-04-19 05:03:08 UTC
Created attachment 84952 [details]
ebuild which filters "-Wl,--as-needed"
Comment 2 Seemant Kulleen (RETIRED) gentoo-dev 2006-04-21 05:20:20 UTC
frederik, please post the error which you are seeing, and reopen the bug
Comment 3 Fredrik Klasson 2006-04-21 06:08:25 UTC
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.
Comment 4 James Cassidy 2006-06-12 08:24:38 UTC
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.
Comment 5 Rafał Mużyło 2006-09-24 22:28:59 UTC
Patch works.
Please comit to portage tree.
Comment 6 Tiziano Müller (RETIRED) gentoo-dev 2007-09-07 11:34:07 UTC
James Cassidy, thanks for the patch, had to modify it since it didn't apply anymore.

Fixed in CVS.