Results for egcs-2.91.42 19980621 (gcc2 ss-980502 experimental) testsuite on sparc-sun-sunos4.1.3
Dave Love
d.love@dl.ac.uk
Thu Jun 25 06:50:00 GMT 1998
>>>>> "AO" == Alexandre Oliva <oliva@dcc.unicamp.br> writes:
AO> oliva@atibaia% egcsc cabs.f -lg2c
AO> /n/temp1/gcctest/egcs/SunOS-4.1.3/lib/gcc-lib/sparc-sun-sunos4.1.3/egcs-2.91.42/libg2c.a(cabs.o): In function `f__cabs':
AO> /n/temp1/gcctest/bin/../src/egcs/libf2c/libF77/cabs.c:25: undefined reference to `sqrt'
AO> collect2: ld returned 1 exit status
AO> oliva@atibaia% egcsc cabs.f -lg2c -lm
AO> oliva@atibaia% ./a.out
I suspect that's not testing the right thing, though. You should use
the `g77' driver, which is analagous to the `g++' one; the `-v' switch
can be helpful. What's the output from the test in the testsuite
g77.log?
AO> Does anyone know how we can add `-lm' to the link command of this test
AO> program, iff libm exists?
The relevant line from `g77 -v cabs.f' on a non-egcs installation I
have available on sunos4 is this (which works):
/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.3/2.7.2.3.f.1/ld -e start -dc -dp /lib/crt0.o -L/usr/local/lib/gcc-lib/sparc-sun-sunos4.1.3/2.7.2.3.f.1 -L/usr/local/lib /tmp/cca196901.o -lf2c -lm -lgcc -lc -lgcc
(You should see -lg2c now, not -lf2c.) If it's really a problem with
-lm, the question is whether the library list needs to be permuted or
added to somehow. Thanks for any light you can shed.
More information about the Gcc
mailing list