On Mon, Jul 19, 2021 at 8:17 AM <andre.nahrw...@dlr.de> wrote:
>
> Hello,
>
> I have built RTEMS 5 and its tools for the Xilinx Zynq Zedboard and installed 
> the BSP and tools at a certain position on my machine.
> The tools are added to the PATH variable and RTEMS_BSPS is also available in 
> the environment.
>
> Now we need to build a library for the use with RTEMS via CMake.
> For this we wanted to use the toolchain files.
> Does anybody know how to correctly setup such a toolchain file using the 
> RTEMS compiler?
>
> We managed to get a toolchain file working which at least built the library.
> But when we wanted to link to this library during compilation of a RTEMS 
> application we got a bunch of errors due to undefined references to standard 
> library functions.
> Does anybody has a clue where this might origin from?
>
> Building a RTEMS application which does not use the own library works fine.
>
> Our toolchain file looks like this:
>
> # CMake toolchain file for ARM
> # The compiler is based on
> # The RTEMS_BSPS environment variable is expected to be set.
> set(ARCH arm)
> set(CMAKE_SYSTEM_NAME RTEMS5)
>
> set(CMAKE_CXX_FLAGS "" CACHE STRING "ARM RTEMS5 gcc additional compiler 
> flags" FORCE)
>

It sounds like you didn't specify the compiler arguments. You are missing
the arguments which produce code for the Zynq CPU mode. This is
from the zynq qemu configuration

-march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9

For rtems5, you also need other arguments like -B DIR -specs bsp_specs -qrtems

For rtems6, it is just -B DIR -qrtems

DIR will point to the installed BSP.

I don't see those in this configuration.

> set(RTEMS_TOOLS_PATH $ENV{RTEMS_BSPS}/../../tools/bin)
>
> set(CMAKE_C_COMPILER ${RTEMS_TOOLS_PATH}/arm-rtems5-gcc CACHE PATH "ARM 
> RTEMS5 gcc" FORCE)
> set(CMAKE_CXX_COMPILER ${RTEMS_TOOLS_PATH}/arm-rtems5-gcc CACHE PATH "ARM 
> RTEMS5 gcc" FORCE)
> set(CMAKE_CXX_COMPILER_AR ${RTEMS_TOOLS_PATH}/arm-rtems5-gcc-ar CACHE PATH 
> "ARM RTEMS5 ar" FORCE)
> set(CMAKE_CXX_COMPILER_RANLIB ${RTEMS_TOOLS_PATH}/arm-rtems5-gcc-ranlib CACHE 
> PATH "ARM RTEMS5 gcc ranlib" FORCE)
> set(CMAKE_RANLIB ${RTEMS_TOOLS_PATH}/arm-rtems5-ranlib CACHE PATH "ARM RTEMS5 
> ranlib" FORCE)
> set(CMAKE_READELF ${RTEMS_TOOLS_PATH}/arm-rtems5-readelf CACHE PATH "ARM 
> RTEMS5 readelf" FORCE)
> set(CMAKE_STRIP ${RTEMS_TOOLS_PATH}/arm-rtems5-strip CACHE PATH "ARM RTEMS5 
> strip" FORCE)
> set(CMAKE_ADDR2LINE ${RTEMS_TOOLS_PATH}/arm-rtems5-addr2line CACHE PATH "ARM 
> RTEMS5 addr2line" FORCE)
> set(CMAKE_LINKER ${RTEMS_TOOLS_PATH}/arm-rtems5-ld CACHE PATH "ARM RTEMS5 ld" 
> FORCE)
> set(CMAKE_NM ${RTEMS_TOOLS_PATH}/arm-rtems5-nm CACHE PATH "ARM RTEMS5 nm" 
> FORCE)
> set(CMAKE_OBJCOPY ${RTEMS_TOOLS_PATH}/arm-rtems5-objcopy CACHE PATH "ARM 
> RTEMS5 objcopy" FORCE)
> set(CMAKE_OBJDUMP ${RTEMS_TOOLS_PATH}/arm-rtems5-objdump CACHE PATH "ARM 
> RTEMS5 objdump" FORCE)
>
> set(CMAKE_TARGET_CONFIG_POSTFIX .rtems5_gcc_arm)
>
> Best regards
> Andre Nahrwold
> --------------------------
> Deutsches Zentrum für Luft- und Raumfahrt e. V. (DLR)
> German Aerospace Center
> Institute for Software Technolog | SRV-OSS BS | Lilienthalpl. 7 | 38108 
> Braunschweig | Geb. 112C Raum 001
> M.Sc. Andre Nahrwold | Telephone +49 531 295-3834 | andre.nahrw...@dlr.de
> DLR.de
>
> _______________________________________________
> users mailing list
> users@rtems.org
> http://lists.rtems.org/mailman/listinfo/users
_______________________________________________
users mailing list
users@rtems.org
http://lists.rtems.org/mailman/listinfo/users

Reply via email to