Trying to cross compile cFS but get linker errors #683
Replies: 3 comments
-
With the following additions... SET(CMAKE_C_FLAGS_INIT "-L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/ -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/usr -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/lib -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/lib64 -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/usr/lib64 -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/usr/lib" CACHE STRING "C Flags required by platform") Then I get this... The C compiler
is not able to compile a simple test program. It fails with the following output:
See also "/home/ubuntu/repos/starlite/build-pil/ark/default_cpu1/CMakeFiles/CMakeOutput.log". CMake will not be able to correctly generate this project. CMake Error at cmake/mission_build.cmake:492 (message): -- Configuring incomplete, errors occurred! |
Beta Was this translation helpful? Give feedback.
-
This fixed the issue... ` #In this sample application, the cross toolchain is configured to #Basic cross system configuration #adjust these settings to where the cross compiler actually resides #where is the target environment #search for programs in the build host directories #for libraries and headers in the target directories #these settings are specific to cFE/OSAL and determines which SET(CMAKE_C_FLAGS_INIT "-mfloat-abi=hard --sysroot=/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/ -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/usr -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/lib -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/lib64 -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/usr/lib" CACHE STRING "C Flags required by platform") SET(CMAKE_CXX_FLAGS_INIT "-mfloat-abi=hard --sysroot=/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/ -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/usr -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/lib -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/lib64 -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/usr/lib" CACHE STRING "C++ Flags required by platform") SET(CMAKE_STATIC_LINKER_FLAGS_INIT "-mfloat-abi=hard --sysroot=/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/ -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/usr -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/lib -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/lib64 -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/usr/lib" CACHE STRING "C Flags required by platform") #SET(CMAKE_STATIC_LINKER_FLAGS_INIT "-L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/ -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/lib -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/lib64 -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/usr/lib64 -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/usr/lib" CACHE STRING "Linker Flags required by platform") |
Beta Was this translation helpful? Give feedback.
-
This was the fix... #This example toolchain file describes the cross compiler to use for #In this sample application, the cross toolchain is configured to #Basic cross system configuration #adjust these settings to where the cross compiler actually resides #where is the target environment #search for programs in the build host directories #for libraries and headers in the target directories #these settings are specific to cFE/OSAL and determines which SET(CMAKE_VERBOSE_MAKEFILE TRUE) SET(CMAKE_C_FLAGS_INIT "-mfloat-abi=hard --sysroot=/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/ -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/usr -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/lib -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/lib64 -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/usr/lib" CACHE STRING "C Flags required by platform") SET(CMAKE_CXX_FLAGS_INIT "-mfloat-abi=hard --sysroot=/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/ -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/usr -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/lib -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/lib64 -L/opt/xiphos/sdk/ark/sysroots/aarch64-xiphos-linux/usr/lib" CACHE STRING "C++ Flags required by platform") SET(CMAKE_STATIC_LINKER_FLAGS_INIT "" CACHE STRING "Linker Flags required by platform") |
Beta Was this translation helpful? Give feedback.
-
I get linker errors...
Building C object CMakeFiles/cmTC_140c2.dir/testCCompiler.c.o
/opt/xiphos/sdk/ark/sysroots/x86_64-xiphossdk-linux/usr/bin/arm-xiphos-linux/arm-xiphos-linux-gcc -O2 -pipe -g -feliminate-unused-debug-types -o CMakeFiles/cmTC_140c2.dir/testCCompiler.c.o -c /home/ubuntu/repos/starlite/build-pil/ark/default_cpu1/CMakeFiles/CMakeTmp/testCCompiler.c
Linking C executable cmTC_140c2
/opt/xiphos/sdk/ark/sysroots/x86_64-xiphossdk-linux/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_140c2.dir/link.txt --verbose=1
/opt/xiphos/sdk/ark/sysroots/x86_64-xiphossdk-linux/usr/bin/arm-xiphos-linux/arm-xiphos-linux-gcc -O2 -pipe -g -feliminate-unused-debug-types -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed CMakeFiles/cmTC_140c2.dir/testCCompiler.c.o -o cmTC_140c2
/opt/xiphos/sdk/ark/sysroots/x86_64-xiphossdk-linux/usr/libexec/arm-xiphos-linux-gnueabi/gcc/arm-xiphos-linux-gnueabi/7.3.0/real-ld: cannot find crt1.o: No such file or directory
/opt/xiphos/sdk/ark/sysroots/x86_64-xiphossdk-linux/usr/libexec/arm-xiphos-linux-gnueabi/gcc/arm-xiphos-linux-gnueabi/7.3.0/real-ld: cannot find crti.o: No such file or directory
/opt/xiphos/sdk/ark/sysroots/x86_64-xiphossdk-linux/usr/libexec/arm-xiphos-linux-gnueabi/gcc/arm-xiphos-linux-gnueabi/7.3.0/real-ld: cannot find crtbegin.o: No such file or directory
/opt/xiphos/sdk/ark/sysroots/x86_64-xiphossdk-linux/usr/libexec/arm-xiphos-linux-gnueabi/gcc/arm-xiphos-linux-gnueabi/7.3.0/real-ld: cannot find -lgcc
/opt/xiphos/sdk/ark/sysroots/x86_64-xiphossdk-linux/usr/libexec/arm-xiphos-linux-gnueabi/gcc/arm-xiphos-linux-gnueabi/7.3.0/real-ld: cannot find -lgcc_s
/opt/xiphos/sdk/ark/sysroots/x86_64-xiphossdk-linux/usr/libexec/arm-xiphos-linux-gnueabi/gcc/arm-xiphos-linux-gnueabi/7.3.0/real-ld: cannot find -lc
/opt/xiphos/sdk/ark/sysroots/x86_64-xiphossdk-linux/usr/libexec/arm-xiphos-linux-gnueabi/gcc/arm-xiphos-linux-gnueabi/7.3.0/real-ld: cannot find -lgcc
/opt/xiphos/sdk/ark/sysroots/x86_64-xiphossdk-linux/usr/libexec/arm-xiphos-linux-gnueabi/gcc/arm-xiphos-linux-gnueabi/7.3.0/real-ld: cannot find -lgcc_s
/opt/xiphos/sdk/ark/sysroots/x86_64-xiphossdk-linux/usr/libexec/arm-xiphos-linux-gnueabi/gcc/arm-xiphos-linux-gnueabi/7.3.0/real-ld: cannot find crtend.o: No such file or directory
/opt/xiphos/sdk/ark/sysroots/x86_64-xiphossdk-linux/usr/libexec/arm-xiphos-linux-gnueabi/gcc/arm-xiphos-linux-gnueabi/7.3.0/real-ld: cannot find crtn.o: No such file or directory
collect2: error: ld returned 1 exit status
This is my toolchain-ark.cmake...
Beta Was this translation helpful? Give feedback.
All reactions