Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 406041

Summary: sys-libs/libfaketime-0.9 - date: symbol lookup error: /usr/lib/faketime/libfaketime.so.1: undefined symbol: dlsym
Product: Gentoo Linux Reporter: master_volkov <mastervolkov>
Component: New packagesAssignee: Tim Harder <radhermit>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Fix --as-needed unneded usage

Description master_volkov 2012-02-27 15:26:01 UTC
Created attachment 303501 [details]
Fix --as-needed unneded usage

After compile, i get error on execute:

~ # faketime '2011-10-20 01:10:10' /bin/date
date: symbol lookup error: /usr/lib/faketime/libfaketime.so.1: undefined symbol: dlsym

because "--as-needed" added to default LD_FLAGS

Adding
"
pkg_setup() {
        append-ldflags $(no-as-needed)
}
"

fix these problem.



Before:
"
i686-pc-linux-gnu-gcc -o libfaketime.so.1 -Wl,-soname,libfaketime.so.1 -Wl,-O1 -Wl,--as-needed -shared -ldl -lm -lpthread faketime.o
i686-pc-linux-gnu-gcc -o libfaketimeMT.so.1 -Wl,-soname,libfaketimeMT.so.1 -Wl,-O1 -Wl,--as-needed -shared -ldl -lm -lpthread faketimeMT.o
"
After:
"
i686-pc-linux-gnu-gcc -o libfaketime.so.1 -Wl,-soname,libfaketime.so.1 -Wl,-O1 -Wl,--as-needed -Wl,--no-as-needed -shared -ldl -lm -lpthread faketime.o
i686-pc-linux-gnu-gcc -o libfaketimeMT.so.1 -Wl,-soname,libfaketimeMT.so.1 -Wl,-O1 -Wl,--as-needed -Wl,--no-as-needed -shared -ldl -lm -lpthread faketimeMT.o
"
Comment 1 Tim Harder gentoo-dev 2012-02-27 23:55:27 UTC
I fixed the underlying linking order problem so building with --as-needed works fine with the latest revision.