Trouble pulling in libm
John Wood
jwood at scisol.com
Fri Jan 14 15:33:43 UTC 2011
I think I am narrowing down on the include issue.
Below is the command line for building res_debug.c where round is defined explicitly
powerpc-rtems4.9-gcc --pipe -DHAVE_CONFIG_H -I.. -I../../cpukit/../../../dam/lib/include -I../../../../../../../../../../common_sw/rtems/c/src/../../cpukit/libnetworking -DNOPOLL -DNOSELECT -D__BSD_VISIBLE -D_THREAD_SAFE -Wall -fasm -mcpu=403 -Dppc405 -Ddam -O2 -g -fno-keep-inline-functions -MT libc/libc_a-res_debug.o -MD -MP -MF libc/.deps/libc_a-res_debug.Tpo -c -o libc/libc_a-res_debug.o `test -f 'libc/res_debug.c' || echo '../../../../../../../../../../common_sw/rtems/c/src/../../cpukit/libnetworking/'`libc/res_debug.c
And this is from a file in my driver where round is implicit
powerpc-rtems4.9-gcc --pipe -B../../../../../.././lib/ -B../../../../../.././dam/lib/ -specs bsp_specs -qrtems -DHAVE_CONFIG_H -I../../../../../.././dam/lib/include -Wall -ansi -fasm -mcpu=403 -Dppc405 -Ddam -O2 -g -fno-keep-inline-functions -MT main_qsst_wavecfg.o -MD -MP -MF .deps/main_qsst_wavecfg.Tpo -c -o main_qsst_wavecfg.o `test -f '../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c' || echo '../../../../../../../../../../../../common_sw/rtems/c/src/lib/libbsp/powerpc/dam/'`../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c
Of note is that -ansi is specified on the driver command line but not for res_debug.c So is this necessary/desired for certain code in the OS and not elsewhere. I could create something in libchip for my driver or just put the code in the app.
Comments.
-----Original Message-----
From: Ralf Corsepius [mailto:ralf.corsepius at rtems.org]
Sent: Friday, January 14, 2011 9:56 AM
To: John Wood
Cc: Thomas Doerfler; rtems-users at rtems.org
Subject: Re: Trouble pulling in libm
On 01/14/2011 03:27 PM, John Wood wrote:
> That’s where it was when I started. Unfortunately...
>
> powerpc/GNU C Linker building target APP_2
> powerpc-rtems4.9-g++ --pipe -B../../../rtems/Install/powerpc-rtems4.9/dam/lib/ -specs bsp_specs -qrtems -fno-keep-inline-functions -mcpu=403 -Dppc405 -Ddam -Wl,-Map="./debug/APP_2.map" -o "./debug/APP_2.elf" ./debug/obj/Init.o ./debug/obj/appqsst.o ./debug/obj/icmpping.o ./debug/obj/sdsn_tx.o -ltelnetd -lftpd -lptpd -lnfs -lm
>
> ../../../rtems/Install/powerpc-rtems4.9/dam/lib\librtemsbsp.a(main_qsst_wavecfg.o): In function `CalculateLFMCoefficients':
> c:\Projects\digital_modules\dam\cfg\config1\rtems\build\powerpc-rtems4.9\c\dam\lib\libbsp\powerpc\dam/../../../../../../../../../../../../common_sw/rtems/c/src/lib/libbsp/powerpc/dam/../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c:293:undefined reference to `round'
> collect2: ld returned 1 exit status
> make: *** [debug/APP_2.elf] Error 1
>
>
Hmm, you seem to be using a home-grown toolchain under DOS ... This
opens up many potential issues ....
> I am still getting a warning with<math.h> though.
>
> powerpc-rtems4.9-gcc --pipe -B../../../../../.././lib/ -B../../../../../.././dam/lib/ -specs bsp_specs -qrtems -DHAVE_CONFIG_H -I../../../../../.././dam/lib/include -Wall -ansi -fasm -mcpu=403 -Dppc405 -Ddam -O2 -g -fno-keep-inline-functions -MT main_qsst_wavecfg.o -MD -MP -MF .deps/main_qsst_wavecfg.Tpo -c -o main_qsst_wavecfg.o `test -f '../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c' || echo '../../../../../../../../../../../../common_sw/rtems/c/src/lib/libbsp/powerpc/dam/'`../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c
> ../../../../../../../../../../../../common_sw/rtems/c/src/lib/libbsp/powerpc/dam/../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c: In function 'rtems_shell_main_qsst_wavecfg':
> ../../../../../../../../../../../../common_sw/rtems/c/src/lib/libbsp/powerpc/dam/../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c:83: warning: unused variable 'qsstCtrl'
> ../../../../../../../../../../../../common_sw/rtems/c/src/lib/libbsp/powerpc/dam/../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c: In function 'CalculateLFMCoefficients':
> ../../../../../../../../../../../../common_sw/rtems/c/src/lib/libbsp/powerpc/dam/../../powerpc/shared/plb46/qsst/main_qsst_wavecfg.c:293: warning: implicit declaration of function 'round'
OK, here is the next issue: This file needs to "#include <math.h>"
Ralf
More information about the users
mailing list