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
Created attachment 311213 [details, diff] Adds -lm to the build system for nettle-benchmark
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...
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.
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.