Carl Hansen on Mon, 26 Apr 2004 01:43:58 +0200

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

link error log2 exp2 gcc 3.4.0 and resolution

a bug, and its resolution

just installed gcc 3.4.0 (on Solaris 9 sparc)

couldn't remake, link errors:
Undefined  symbol   exp2   log2

examining pari-2.2.7.alpha/config/has_log2.c,
(which is used by Configure) :

#include <math.h>
main(){ double x=log2(1.0); }

compiles cleanly,

however trying:

#include <math.h>
main(){ double x=log2(0.666); }

get        Undefined  symbol   log2

Having pondered, conclude the compiler compile-time-optimises
log2(1.0)  to 0 , so log2 is never  called at runtime, as
can be verified by looking at has_log2.s , so the Configure script
will conclude has it HAS log2, whereas  in  the
other case log2(0.666), Configure script will realise
we  in fact DON'T have log2.

likewise has_exp2.c

So contemplate  assumptions made by compiler, compiler writer, writer
of Configure, and become wise, and wonder what else could be wrong.

Carl Hansen
I don't actually "WORK" here anymore
510 981 1231