Problem while linking rtems-libbsd with application

Chris Johns chrisj at rtems.org
Thu Feb 9 02:24:35 UTC 2017


On 09/02/2017 09:54, vivek kukreja wrote:
> Hello all,

Hello and welcome back to RTEMS.

>
> I have setup rtems for arm/xilinx_zynq_a9_qemu pair and installed
> rtems-libbsd. Im trying to run NFS in an application but i get an
> error while linking libbsd drivers. I use the following commands to
> compile the application:
>
> arm-rtems4.12-gcc -B../../../../../xilinx_zynq_a9_qemu/lib/ -specs
> bsp_specs -qrtems -DHAVE_CONFIG_H -I.
> -I/home/vivek/sandbox/rtems/c/src/../../testsuites/samples/fileio -I..
>   -I/home/vivek/sandbox/rtems/c/src/../../testsuites/samples/../support/include
> -I/home/vivek/sandbox/rtems-libbsd/rtemsbsd/include
> -I/home/vivek/sandbox/rtems-libbsd/freebsd/include
> -I/home/vivek/sandbox/rtems-libbsd/freebsd/sys   -march=armv7-a
> -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9 -O0 -g
> -ffunction-sections -fdata-sections -Wall -Wmissing-prototypes
> -Wimplicit-function-declaration -Wstrict-prototypes -Wnested-externs
> -MT init.o -MD -MP -MF .deps/init.Tpo -c -o init.o
> /home/vivek/sandbox/rtems/c/src/../../testsuites/samples/fileio/init.c
> mv -f .deps/init.Tpo .deps/init.Po
> arm-rtems4.12-gcc -B../../../../../xilinx_zynq_a9_qemu/lib/ -specs
> bsp_specs -qrtems -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard
> -mtune=cortex-a9 -O0 -g -ffunction-sections -fdata-sections -Wall
> -Wmissing-prototypes -Wimplicit-function-declaration
> -Wstrict-prototypes -Wnested-externs  -Wl,--gc-sections
> -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9
> -o fileio.exe init.o
> /home/vivek/sandbox/rtems-libbsd/build/arm-rtems4.12-xilinx_zynq_a9_qemu/libbsd.a
>
> I'm getting the following error:
>
> /home/vivek/sandbox/rtems-libbsd/build/arm-rtems4.12-xilinx_zynq_a9_qemu/libbsd.a(sfp.c.12.o):
> In function `convert_sff_power':
> /home/vivek/sandbox/rtems-libbsd/build/arm-rtems4.12-xilinx_zynq_a9_qemu/../../freebsd/sbin/ifconfig/sfp.c:614:
> undefined reference to `log10'
>
> I think this is a linking issue(in the rtems-libbsd build) and i'm
> reinstalling libbsd to double-check. If anyone has come across this
> error before please help me resolve it.
>

Try adding -lm to the libraries you need to link with. It looks to me 
like the recent changes Sebastian has made with libbsd has added a 
dependence on the libm.a library.

Chris



More information about the devel mailing list