How can I add LDFLAGS for bsp build?

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Jul 25 14:52:31 UTC 2022


On 25/07/2022 16:47, Y. HB wrote:
> 
> ['/home/hongbo/Developer/Embedded/rtems/5/bin/arm-rtems5-gcc', 
> '-qrtems', '-B/home/hongbo/Developer/Embedded/rtems/5/arm-rtems5/lib/', 
> '-B/home/hongbo/Developer/Embedded/rtems/5/arm-rtems5/tms570lc4357_launchxl/lib/', 
> '--specs', 'bsp_specs', '-march=armv7-r', '-mthumb', '-mbig-endian', 
> '-mfpu=vfpv3-d16', '-mfloat-abi=hard', '-ffunction-sections', 
> '-fdata-sections', '-MMD', 'test.c.1.o', 
> '-o/home/hongbo/Developer/Embedded/rtems/app/hello/build/.conf_check_261484d99ea5da27480d47dee9a30c04/testbuild/testprog', 
> '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Bstatic -lm']
> err: 
> /home/hongbo/Developer/Embedded/rtems/5/lib/gcc/arm-rtems5/7.5.0/../../../../arm-rtems5/bin/ld: 
> /home/hongbo/Developer/Embedded/rtems/5/arm-rtems5/tms570lc4357_launchxl/lib/librtemsbsp.a(HL_sci.o): 
> in function `sciSetBaudrate':
> /home/hongbo/Developer/Embedded/rtems/build/tms570lc4357/arm-rtems5/c/tms570lc4357_launchxl/lib/libbsp/arm/tms570/../../../../../../../../../rtems-master/c/src/lib/libbsp/arm/tms570/../../../../../../bsps/arm/tms570/start/tms570lc4357/source/HL_sci.c:284: 
> undefined reference to `floor'
> collect2: error: ld returned 1 exit status

This is a problem with the search order of the libraries. The -lrtemsbsp 
is implicitly given by the --specs bsp_specs. You can try this:

-lrtemsbsp -lm

Alternatively, avoid the use of floating point operations and the 
floor() function.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the users mailing list