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

Bug 415193

Summary: =dev-libs/nettle-2.4: examples/nettle-benchmark.c calls ldexp but the build system doesn't link -lm
Product: Gentoo Linux Reporter: Anthony Basile <blueness>
Component: [OLD] LibraryAssignee: Crypto team [DISABLED] <crypto+disabled>
Status: RESOLVED UPSTREAM    
Severity: normal CC: zerochaos
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Adds -lm to the build system for nettle-benchmark

Description Anthony Basile gentoo-dev 2012-05-08 23:51:54 UTC
When building the examples, the final link of nettle-benchmark.o and friends fails because the rule in the Makefile.in doesn't add linkage against libm.  I hit this on a uclibc system and have not tested on glibc system, where it might work because of transitive linkage.  Its still a good idea to have -lm in there.

Reproducible: Always
Comment 1 Anthony Basile gentoo-dev 2012-05-08 23:54:40 UTC
Created attachment 311213 [details, diff]
Adds -lm to the build system for nettle-benchmark
Comment 2 Rick Farina (Zero_Chaos) gentoo-dev 2012-07-06 02:46:19 UTC
fix tested on glibc based system and added to gentoo-x86.

Can you please upstream this patch, I see no reason why they won't accept it but I'm sure you can explain it better since there isn't even a build log on this bug...
Comment 3 Anthony Basile gentoo-dev 2012-07-06 14:39:29 UTC
I'll push this upstream.  For the records, here's the compile time failure:

gcc -g -O2 -Wno-pointer-sign -Wall -W   -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes   -Wpointer-arith -Wbad-function-cast -Wnested-externs -L..  nettle-benchmark.o nettle-openssl.o ../getopt.o ../getopt1.o ../nettle-internal.o -lnettle -lgmp  -lcrypto -o nettle-benchmark
/usr/lib/gcc/x86_64-gentoo-linux-uclibc/4.6.3/../../../libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
nettle-benchmark.o: In function `bench_sha1_compress':
/home/blueness/nettle/examples/nettle-benchmark.c:592: undefined reference to `ldexp'
collect2: ld returned 1 exit status
make: *** [nettle-benchmark] Error 1


ldexp is provided by libm.so, so linking -lm fixes the issue.
Comment 4 Anthony Basile gentoo-dev 2012-07-07 21:03:04 UTC
Patch accepted upstream:

http://lists.lysator.liu.se/pipermail/nettle-bugs/2012/002400.html
http://lists.lysator.liu.se/pipermail/nettle-bugs/2012/002401.html

2.5 just came out, so probably the release after that you can drop the patch.

Thanks guys!  I'll close this resolved upstream.