Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cross Compiling with Cmake #71

Answered by abhiTronix
rafal1137 asked this question in Q&A
Discussion options

I have followed this GUIDE:
https://github.com/abhiTronix/raspberry-pi-cross-compilers/wiki/Raspberry-Pi-GCC-Cross-Compiler-ARM-Toolchains-CMake-Usage-Guide/17f85af96eafabab415351a21d8d653bd3feca5c#build-dummy-hello-world-project

I have added those to my cmake file.

 include_directories(${SYSROOT_PATH}/usr/include/arm-linux-gnueabihf)
 link_directories(${SYSROOT_PATH}/usr/lib/arm-linux-gnueabihf)

Have rasbian rootfs with correct linking.

My Toolchain Cmake file. Is a bit different from the guide posted there. But that should not be an issue.

if("$ENV{RASPBIAN_ROOTFS}" STREQUAL "")
	message(FATAL_ERROR "Define the RASPBIAN_ROOTFS environment variable to point to the raspbian rootfs.")
else()
	set(SYSROOT_PATH "$ENV{RASPBIAN_ROOTFS}")
endif()
set(TOOLCHAIN_HOST "arm-linux-gnueabihf")
message(STATUS "Using sysroot path: ${SYSROOT_PATH}")
set(TOOLCHAIN_CC "${TOOLCHAIN_HOST}-gcc")
set(TOOLCHAIN_CXX "${TOOLCHAIN_HOST}-g++")
set(TOOLCHAIN_LD "${TOOLCHAIN_HOST}-ld")
set(TOOLCHAIN_AR "${TOOLCHAIN_HOST}-ar")
set(TOOLCHAIN_RANLIB "${TOOLCHAIN_HOST}-ranlib")
set(TOOLCHAIN_STRIP "${TOOLCHAIN_HOST}-strip")
set(TOOLCHAIN_NM "${TOOLCHAIN_HOST}-nm")
set(CMAKE_CROSSCOMPILING TRUE)
set(CMAKE_SYSROOT "${SYSROOT_PATH}")
# Define name of the target system
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "armv7l")
# Define the compiler
set(CMAKE_C_COMPILER ${TOOLCHAIN_CC})
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_CXX})
set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_WORKS 1)
set(CMAKE_PREFIX_PATH "${CMAKE_PREFIX_PATH};${SYSROOT_PATH}/usr/lib/${TOOLCHAIN_HOST}")
set(CMAKE_FIND_ROOT_PATH "${CMAKE_INSTALL_PREFIX};${CMAKE_PREFIX_PATH};${CMAKE_SYSROOT}")
# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

But when I want to compile it. It fails.

Those are the errors/issues I am getting during complilation

/lib/ld-linux-armhf.so.3: No such file or directory

This one comes at linking procedure

/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status
You must be logged in to vote

@rafal1137 Please remove set(CMAKE_SYSROOT "${SYSROOT_PATH}") and set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) lines from your Toolchain Cmake file and try again. Make sure you clean up build directory before trying again.

Replies: 28 comments 52 replies

Comment options

@rafal1137 Please remove set(CMAKE_SYSROOT "${SYSROOT_PATH}") and set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) lines from your Toolchain Cmake file and try again. Make sure you clean up build directory before trying again.

You must be logged in to vote
1 reply
Comment options

In case anyone else is having this problem, can confirm that this has worked! Building from: Windows 10 -> RPI Zero W

Answer selected by abhiTronix
Comment options

@rafal1137 Please test it and report back here, check if this fixes your issue. Good luck.

You must be logged in to vote
0 replies
Comment options

@rafal1137 For more information on why CMAKE_FIND_ROOT_PATH is preferred for cross compiling, see here: https://stackoverflow.com/a/34077078

You must be logged in to vote
0 replies
Comment options

@abhiTronix
So I did followed your suggestion there to remove those 2 lines but my project in short might depend on CMAKE_SYSROOT being set.
Because after testing those changes.

CMake Error at /usr/share/cmake-3.13/Modules/FindX11.cmake:429 (message):
 Could not find X11
....
-- Configuring incomplete, errors occurred!
You must be logged in to vote
0 replies
Comment options

@rafal1137 Did you made following symlinks before syncing sysroot with RPi?

sudo ln -sf -r /usr/include/arm-linux-gnueabihf/asm /usr/include
sudo ln -sf -r /usr/include/arm-linux-gnueabihf/gnu /usr/include
sudo ln -sf -r /usr/include/arm-linux-gnueabihf/bits /usr/include
sudo ln -sf -r /usr/include/arm-linux-gnueabihf/sys /usr/include
sudo ln -sf -r /usr/include/arm-linux-gnueabihf/openssl /usr/include
sudo ln -sf /usr/lib/arm-linux-gnueabihf/crtn.o /usr/lib/crtn.o
sudo ln -sf /usr/lib/arm-linux-gnueabihf/crt1.o /usr/lib/crt1.o
sudo ln -sf /usr/lib/arm-linux-gnueabihf/crti.o /usr/lib/crti.o

Also, check this comment: #69 (reply in thread)

You must be logged in to vote
0 replies
Comment options

Also, can you test without CMAKE_FIND_ROOT_PATH and CMAKE_PREFIX_PATH as following toolchain cmake configuration:

if("$ENV{RASPBIAN_ROOTFS}" STREQUAL "")
	message(FATAL_ERROR "Define the RASPBIAN_ROOTFS environment variable to point to the raspbian rootfs.")
else()
	set(SYSROOT_PATH "$ENV{RASPBIAN_ROOTFS}")
endif()
set(TOOLCHAIN_HOST "arm-linux-gnueabihf")
message(STATUS "Using sysroot path: ${SYSROOT_PATH}")
set(TOOLCHAIN_CC "${TOOLCHAIN_HOST}-gcc")
set(TOOLCHAIN_CXX "${TOOLCHAIN_HOST}-g++")
set(TOOLCHAIN_LD "${TOOLCHAIN_HOST}-ld")
set(TOOLCHAIN_AR "${TOOLCHAIN_HOST}-ar")
set(TOOLCHAIN_RANLIB "${TOOLCHAIN_HOST}-ranlib")
set(TOOLCHAIN_STRIP "${TOOLCHAIN_HOST}-strip")
set(TOOLCHAIN_NM "${TOOLCHAIN_HOST}-nm")
set(CMAKE_CROSSCOMPILING TRUE)
set(CMAKE_SYSROOT "${SYSROOT_PATH}")
# Define name of the target system
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "armv7l")
# Define the compiler
set(CMAKE_C_COMPILER ${TOOLCHAIN_CC})
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_CXX})
set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_WORKS 1)
# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

but keep CMAKE_SYSROOT and CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER as previous.

You must be logged in to vote
0 replies
Comment options

@abhiTronix

@rafal1137 Did you made following symlinks before syncing sysroot with RPi?

sudo ln -sf -r /usr/include/arm-linux-gnueabihf/asm /usr/include
sudo ln -sf -r /usr/include/arm-linux-gnueabihf/gnu /usr/include
sudo ln -sf -r /usr/include/arm-linux-gnueabihf/bits /usr/include
sudo ln -sf -r /usr/include/arm-linux-gnueabihf/sys /usr/include
sudo ln -sf -r /usr/include/arm-linux-gnueabihf/openssl /usr/include
sudo ln -sf /usr/lib/arm-linux-gnueabihf/crtn.o /usr/lib/crtn.o
sudo ln -sf /usr/lib/arm-linux-gnueabihf/crt1.o /usr/lib/crt1.o
sudo ln -sf /usr/lib/arm-linux-gnueabihf/crti.o /usr/lib/crti.o

Also, check this comment: #69 (reply in thread)

This may be tricky because I do not own RPI hardware. I did used 3rd Party sh script to download raspbian.iso and rsync. I can do only run rapsbian on docker. I have tried to ssh into it but I had no experience with docker before back then.

PS: Or will it work when doing those symlinks in rootfs ?

Also, can you test without CMAKE_FIND_ROOT_PATH and CMAKE_PREFIX_PATH as following toolchain cmake configuration:

if("$ENV{RASPBIAN_ROOTFS}" STREQUAL "")
	message(FATAL_ERROR "Define the RASPBIAN_ROOTFS environment variable to point to the raspbian rootfs.")
else()
	set(SYSROOT_PATH "$ENV{RASPBIAN_ROOTFS}")
endif()
set(TOOLCHAIN_HOST "arm-linux-gnueabihf")
message(STATUS "Using sysroot path: ${SYSROOT_PATH}")
set(TOOLCHAIN_CC "${TOOLCHAIN_HOST}-gcc")
set(TOOLCHAIN_CXX "${TOOLCHAIN_HOST}-g++")
set(TOOLCHAIN_LD "${TOOLCHAIN_HOST}-ld")
set(TOOLCHAIN_AR "${TOOLCHAIN_HOST}-ar")
set(TOOLCHAIN_RANLIB "${TOOLCHAIN_HOST}-ranlib")
set(TOOLCHAIN_STRIP "${TOOLCHAIN_HOST}-strip")
set(TOOLCHAIN_NM "${TOOLCHAIN_HOST}-nm")
set(CMAKE_CROSSCOMPILING TRUE)
set(CMAKE_SYSROOT "${SYSROOT_PATH}")
# Define name of the target system
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "armv7l")
# Define the compiler
set(CMAKE_C_COMPILER ${TOOLCHAIN_CC})
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_CXX})
set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_WORKS 1)
# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

but keep CMAKE_SYSROOT and CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER as previous.

Tried that one with no luck.

You must be logged in to vote
0 replies
Comment options

This may be tricky because I do not own RPI hardware. I did used 3rd Party sh script to download raspbian.iso and rsync. I can do only run rapsbian on docker. I have tried to ssh into it but I had no experience with docker before back then.

PS: Or will it work when doing those symlinks in rootfs ?

@rafal1137 Ok this was the actual problem. Yes, it won't work without these symlinks, see this comment #69 (reply in thread)

You must be logged in to vote
0 replies
Comment options

@rafal1137 Can you try these commands after setting correct RASPBIAN_ROOTFS environment variable value:

sudo ln -sf -r "$RASPBIAN_ROOTFS"/usr/include/arm-linux-gnueabihf/asm "$RASPBIAN_ROOTFS"/usr/include
sudo ln -sf -r "$RASPBIAN_ROOTFS"/usr/include/arm-linux-gnueabihf/gnu "$RASPBIAN_ROOTFS"/usr/include
sudo ln -sf -r "$RASPBIAN_ROOTFS"/usr/include/arm-linux-gnueabihf/bits "$RASPBIAN_ROOTFS"/usr/include
sudo ln -sf -r "$RASPBIAN_ROOTFS"/usr/include/arm-linux-gnueabihf/sys "$RASPBIAN_ROOTFS"/usr/include
sudo ln -sf -r "$RASPBIAN_ROOTFS"/usr/include/arm-linux-gnueabihf/openssl "$RASPBIAN_ROOTFS"/usr/include
sudo ln -sf "$RASPBIAN_ROOTFS"/usr/lib/arm-linux-gnueabihf/crtn.o "$RASPBIAN_ROOTFS"/usr/lib/crtn.o
sudo ln -sf "$RASPBIAN_ROOTFS"/usr/lib/arm-linux-gnueabihf/crt1.o "$RASPBIAN_ROOTFS"/usr/lib/crt1.o
sudo ln -sf "$RASPBIAN_ROOTFS"/usr/lib/arm-linux-gnueabihf/crti.o "$RASPBIAN_ROOTFS"/usr/lib/crti.o

and see if it works?

You must be logged in to vote
0 replies
Comment options

@rafal1137 Can you try these commands after setting correct RASPBIAN_ROOTFS environment variable value:

sudo ln -sf -r "$RASPBIAN_ROOTFS"/usr/include/arm-linux-gnueabihf/asm "$RASPBIAN_ROOTFS"/usr/include
sudo ln -sf -r "$RASPBIAN_ROOTFS"/usr/include/arm-linux-gnueabihf/gnu "$RASPBIAN_ROOTFS"/usr/include
sudo ln -sf -r "$RASPBIAN_ROOTFS"/usr/include/arm-linux-gnueabihf/bits "$RASPBIAN_ROOTFS"/usr/include
sudo ln -sf -r "$RASPBIAN_ROOTFS"/usr/include/arm-linux-gnueabihf/sys "$RASPBIAN_ROOTFS"/usr/include
sudo ln -sf -r "$RASPBIAN_ROOTFS"/usr/include/arm-linux-gnueabihf/openssl "$RASPBIAN_ROOTFS"/usr/include
sudo ln -sf "$RASPBIAN_ROOTFS"/usr/lib/arm-linux-gnueabihf/crtn.o "$RASPBIAN_ROOTFS"/usr/lib/crtn.o
sudo ln -sf "$RASPBIAN_ROOTFS"/usr/lib/arm-linux-gnueabihf/crt1.o "$RASPBIAN_ROOTFS"/usr/lib/crt1.o
sudo ln -sf "$RASPBIAN_ROOTFS"/usr/lib/arm-linux-gnueabihf/crti.o "$RASPBIAN_ROOTFS"/usr/lib/crti.o

and see if it works?

Well I did went another way to make those symlinks. Now it started to compile again.
But its still fails because it still complains about

/lib/ld-linux-armhf.so.3: No such file or directory
Exiting!
You must be logged in to vote
0 replies
Comment options

@abhiTronix ^
Just to ping you.

You must be logged in to vote
0 replies
Comment options

@rafal1137 Seems like your sysroot missing some important Rpi packages.

Answer these queries:

  • What toolchain from this project are you using? Paste the downloading page link or screenshot or something else?
  • Which Raspberry Pi model are you targeting in your project.
  • What exact version of Raspbian sysroot are you using in your project? (Stretch or Buster)
    as they all are correlated.

Also, Did you tried any other toolchain beside this project?

You must be logged in to vote
0 replies
Comment options

@abhiTronix

@rafal1137 Seems like your sysroot missing some important Rpi packages.

Answer these queries:

* What toolchain from this project are you using? Paste the downloading page link or screenshot or something else?
* Which Raspberry Pi model are you targeting in your project.
* What exact version of Raspbian sysroot are you using in your project? (Stretch or Buster)
 as they all are correlated.

Also, Did you tried any other toolchain beside this project?

You must be logged in to vote
0 replies
Comment options

@abhiTronix Also I did just ls that file. And it shows there with symlinking.

ls -l /opt/rootfs/lib/ld*
lrwxrwxrwx 1 root root 30 May 14 2019 /opt/rootfs/lib/ld-linux-armhf.so.3 -> arm-linux-gnueabihf/ld-2.28.so
lrwxrwxrwx 1 root root 24 Mar 4 22:48 /opt/rootfs/lib/ld-linux.so.3 -> /lib/ld-linux-armhf.so.3
You must be logged in to vote
0 replies
Comment options

@rafal1137 Can you try compiling bare-minimum C++ Program with --sysroot flag as follows:

echo 'int main() { return 0; }' > foo.cpp
/opt/cross-pi-gcc/bin/arm-linux-gnueabihf-g++ \
 --sysroot=/opt/rootfs/ \
 foo.cpp

to ensure sysroot is working fine.

Also set these environment variables before compiling:

PATH=/opt/cross-pi-gcc/bin:$PATH
LD_LIBRARY_PATH=/opt/cross-pi-gcc/lib:$LD_LIBRARY_PATH
You must be logged in to vote
0 replies
Comment options

@abhiTronix Just did it and this what happened

root@720bc2f03c8a:/# arm-linux-gnueabihf-g++ --sysroot=/opt/rootfs/ foo.cpp
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm
collect2: error: ld returned 1 exit status
You must be logged in to vote
0 replies
Comment options

@rafal1137 Real problem is still hidden. Please, try with verbose parameter and link directories directly as follows:

/opt/cross-pi-gcc/bin/arm-linux-gnueabihf-g++ --sysroot=/opt/rootfs -L/opt/rootfs/usr/lib/arm-linux-gnueabihf -I/opt/rootfs/usr/include/arm-linux-gnueabihf foo.cpp -v

and paste the complete output here.

You must be logged in to vote
0 replies
Comment options

@abhiTronix This is entire output:

root@720bc2f03c8a:/# /opt/cross-pi-gcc/bin/arm-linux-gnueabihf-g++ --sysroot=/opt/rootfs -L/opt/rootfs/usr/lib/arm-linux-gnueabihf -I/opt/rootfs/usr/include/arm-linux-gnueabihf foo.cpp -v
Using built-in specs.
COLLECT_GCC=/opt/cross-pi-gcc/bin/arm-linux-gnueabihf-g++
COLLECT_LTO_WRAPPER=/opt/cross-pi-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/10.2.0/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../configure --prefix= --target=arm-linux-gnueabihf --enable-languages=c,c++,fortran --with-sysroot=/arm-linux-gnueabihf/libc --with-build-sysroot=/tmp/cross-pi-gcc-10.2.0-1/arm-linux-gnueabihf/libc --with-arch=armv7-a --with-fpu=neon-vfpv4 --with-float=hard --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (GCC) 
COLLECT_GCC_OPTIONS='-L/opt/rootfs/usr/lib/arm-linux-gnueabihf' '-I' '/opt/rootfs/usr/include/arm-linux-gnueabihf' '-v' '-shared-libgcc' '-mfloat-abi=hard' '-mfpu=neon-vfpv4' '-mtls-dialect=gnu' '-marm' '-march=armv7-a+neon-vfpv4'
 /opt/cross-pi-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/10.2.0/cc1plus -quiet -v -I /opt/rootfs/usr/include/arm-linux-gnueabihf -iprefix /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/ -isysroot /opt/rootfs -D_GNU_SOURCE foo.cpp -quiet -dumpbase foo.cpp -mfloat-abi=hard -mfpu=neon-vfpv4 -mtls-dialect=gnu -marm -march=armv7-a+neon-vfpv4 -auxbase foo -version -o /tmp/ccUK1rL0.s
GNU C++14 (GCC) version 10.2.0 (arm-linux-gnueabihf)
 compiled by GNU C version 7.5.0, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3, isl version isl-0.18-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/opt/cross-pi-gcc/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include/c++/10.2.0"
ignoring duplicate directory "/opt/cross-pi-gcc/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include/c++/10.2.0/arm-linux-gnueabihf"
ignoring duplicate directory "/opt/cross-pi-gcc/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include/c++/10.2.0/backward"
ignoring duplicate directory "/opt/cross-pi-gcc/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/10.2.0/include"
ignoring duplicate directory "/opt/cross-pi-gcc/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/10.2.0/include-fixed"
ignoring duplicate directory "/opt/cross-pi-gcc/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/rootfs/usr/include/arm-linux-gnueabihf
 /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include/c++/10.2.0
 /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include/c++/10.2.0/arm-linux-gnueabihf
 /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include/c++/10.2.0/backward
 /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/include
 /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/include-fixed
 /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include
 /opt/rootfs/usr/local/include
 /opt/rootfs/usr/include
End of search list.
GNU C++14 (GCC) version 10.2.0 (arm-linux-gnueabihf)
 compiled by GNU C version 7.5.0, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3, isl version isl-0.18-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: fe3d46b46971cd3b57cc2f549fffafbf
COLLECT_GCC_OPTIONS='-L/opt/rootfs/usr/lib/arm-linux-gnueabihf' '-I' '/opt/rootfs/usr/include/arm-linux-gnueabihf' '-v' '-shared-libgcc' '-mfloat-abi=hard' '-mfpu=neon-vfpv4' '-mtls-dialect=gnu' '-marm' '-march=armv7-a+neon-vfpv4'
 /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/as -v -I /opt/rootfs/usr/include/arm-linux-gnueabihf -march=armv7-a -mfloat-abi=hard -mfpu=neon-vfpv4 -meabi=5 -o /tmp/ccP84BHf.o /tmp/ccUK1rL0.s
GNU assembler version 2.31 (arm-linux-gnueabihf) using BFD version (GNU Binutils) 2.31
COMPILER_PATH=/opt/cross-pi-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/10.2.0/:/opt/cross-pi-gcc/bin/../libexec/gcc/:/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/
LIBRARY_PATH=/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/:/opt/cross-pi-gcc/bin/../lib/gcc/:/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/:/opt/rootfs/lib/:/opt/rootfs/usr/lib/
COLLECT_GCC_OPTIONS='-L/opt/rootfs/usr/lib/arm-linux-gnueabihf' '-I' '/opt/rootfs/usr/include/arm-linux-gnueabihf' '-v' '-shared-libgcc' '-mfloat-abi=hard' '-mfpu=neon-vfpv4' '-mtls-dialect=gnu' '-marm' '-march=armv7-a+neon-vfpv4'
 /opt/cross-pi-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/10.2.0/collect2 -plugin /opt/cross-pi-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/10.2.0/liblto_plugin.so -plugin-opt=/opt/cross-pi-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/10.2.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccqe0NEu.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/opt/rootfs --eh-frame-hdr -dynamic-linker /lib/ld-linux-armhf.so.3 -X -m armelf_linux_eabi /opt/rootfs/lib/crt1.o /opt/rootfs/lib/crti.o /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/crtbegin.o -L/opt/rootfs/usr/lib/arm-linux-gnueabihf -L/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0 -L/opt/cross-pi-gcc/bin/../lib/gcc -L/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib -L/opt/rootfs/lib -L/opt/rootfs/usr/lib /tmp/ccP84BHf.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/crtend.o /opt/rootfs/lib/crtn.o
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: warning: libm.so.6, needed by /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so, not found (try using -rpath or -rpath-link)
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `acos@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `hypot@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `cos@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `fmod@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `tan@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `atan@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `asin@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `sqrt@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `ceil@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `atan2@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `floorl@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `sin@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `tanh@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `sinh@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `pow@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `log@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `floor@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `log10@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `exp@GLIBC_2.4'
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `cosh@GLIBC_2.4'
collect2: error: ld returned 1 exit status

Wait what it can't find GLIBC_2.4 ?

You must be logged in to vote
0 replies
Comment options

@rafal1137 IMO we are close to solution as -lm is set correctly this time. So --sysroot=/opt/rootfs will set correct sysroot but --sysroot=/opt/rootfs/ doesn't. Can you reiterate above command by eliminating all linked directories:

/opt/cross-pi-gcc/bin/arm-linux-gnueabihf-g++ --sysroot=/opt/rootfs -v

Thank you for helping in debugging this issue.

You must be logged in to vote
0 replies
Comment options

@abhiTronix

root@720bc2f03c8a:/# /opt/cross-pi-gcc/bin/arm-linux-gnueabihf-g++ --sysroot=/opt/rootfs foo.cpp -v
Using built-in specs.
COLLECT_GCC=/opt/cross-pi-gcc/bin/arm-linux-gnueabihf-g++
COLLECT_LTO_WRAPPER=/opt/cross-pi-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/10.2.0/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../configure --prefix= --target=arm-linux-gnueabihf --enable-languages=c,c++,fortran --with-sysroot=/arm-linux-gnueabihf/libc --with-build-sysroot=/tmp/cross-pi-gcc-10.2.0-1/arm-linux-gnueabihf/libc --with-arch=armv7-a --with-fpu=neon-vfpv4 --with-float=hard --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mfloat-abi=hard' '-mfpu=neon-vfpv4' '-mtls-dialect=gnu' '-marm' '-march=armv7-a+neon-vfpv4'
 /opt/cross-pi-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/10.2.0/cc1plus -quiet -v -iprefix /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/ -isysroot /opt/rootfs -D_GNU_SOURCE foo.cpp -quiet -dumpbase foo.cpp -mfloat-abi=hard -mfpu=neon-vfpv4 -mtls-dialect=gnu -marm -march=armv7-a+neon-vfpv4 -auxbase foo -version -o /tmp/ccxFnr5P.s
GNU C++14 (GCC) version 10.2.0 (arm-linux-gnueabihf)
 compiled by GNU C version 7.5.0, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3, isl version isl-0.18-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/opt/cross-pi-gcc/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include/c++/10.2.0"
ignoring duplicate directory "/opt/cross-pi-gcc/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include/c++/10.2.0/arm-linux-gnueabihf"
ignoring duplicate directory "/opt/cross-pi-gcc/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include/c++/10.2.0/backward"
ignoring duplicate directory "/opt/cross-pi-gcc/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/10.2.0/include"
ignoring duplicate directory "/opt/cross-pi-gcc/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/10.2.0/include-fixed"
ignoring duplicate directory "/opt/cross-pi-gcc/bin/../lib/gcc/../../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include/c++/10.2.0
 /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include/c++/10.2.0/arm-linux-gnueabihf
 /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include/c++/10.2.0/backward
 /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/include
 /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/include-fixed
 /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/include
 /opt/rootfs/usr/local/include
 /opt/rootfs/usr/include
End of search list.
GNU C++14 (GCC) version 10.2.0 (arm-linux-gnueabihf)
 compiled by GNU C version 7.5.0, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3, isl version isl-0.18-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: fe3d46b46971cd3b57cc2f549fffafbf
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mfloat-abi=hard' '-mfpu=neon-vfpv4' '-mtls-dialect=gnu' '-marm' '-march=armv7-a+neon-vfpv4'
 /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/as -v -march=armv7-a -mfloat-abi=hard -mfpu=neon-vfpv4 -meabi=5 -o /tmp/cclKUC93.o /tmp/ccxFnr5P.s
GNU assembler version 2.31 (arm-linux-gnueabihf) using BFD version (GNU Binutils) 2.31
COMPILER_PATH=/opt/cross-pi-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/10.2.0/:/opt/cross-pi-gcc/bin/../libexec/gcc/:/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/
LIBRARY_PATH=/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/:/opt/cross-pi-gcc/bin/../lib/gcc/:/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib/:/opt/rootfs/lib/:/opt/rootfs/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mfloat-abi=hard' '-mfpu=neon-vfpv4' '-mtls-dialect=gnu' '-marm' '-march=armv7-a+neon-vfpv4'
 /opt/cross-pi-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/10.2.0/collect2 -plugin /opt/cross-pi-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/10.2.0/liblto_plugin.so -plugin-opt=/opt/cross-pi-gcc/bin/../libexec/gcc/arm-linux-gnueabihf/10.2.0/lto-wrapper -plugin-opt=-fresolution=/tmp/cchwMofi.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/opt/rootfs --eh-frame-hdr -dynamic-linker /lib/ld-linux-armhf.so.3 -X -m armelf_linux_eabi /opt/rootfs/lib/crt1.o /opt/rootfs/lib/crti.o /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/crtbegin.o -L/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0 -L/opt/cross-pi-gcc/bin/../lib/gcc -L/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/lib -L/opt/rootfs/lib -L/opt/rootfs/usr/lib /tmp/cclKUC93.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/crtend.o /opt/rootfs/lib/crtn.o
/opt/cross-pi-gcc/bin/../lib/gcc/arm-linux-gnueabihf/10.2.0/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm
collect2: error: ld returned 1 exit status
You must be logged in to vote
0 replies
Comment options

@rafal1137 again. Sorry for the inconvenience. Can you share how you setup sysroot, I'll try everything locally and share the final result here by tomorrow. OR if possible upload and share sysroot through mega or gdrive.

You must be logged in to vote
0 replies
Comment options

@rafal1137 again. Sorry for the inconvenience. Can you share how you setup sysroot, I'll try everything locally and share the final result here by tomorrow. OR if possible upload and share sysroot through mega or gdrive.

I will share the sysroot setup here since uploading entire rootfs could take too long since my upload is not good for such things.
I am using this repo https://github.com/kclyu/rpi_rootfs with some changes on my side.

Steps I did inside a rpi_rootfs repo:

  • inside scripts dir there is update_upgrade_install_package.sh which I have eddited
#!/bin/bash
apt update
apt full-upgrade -y
apt -y install build-essential libfreeimage-dev libopenal-dev libpango1.0-dev libsndfile-dev libudev-dev \
libasound2-dev libjpeg8-dev libwebp-dev automake libgl1-mesa-glx libjpeg62-turbo libogg0 libopenal1 libvorbis0a \
libvorbisfile3 zlib1g libraspberrypi0 libraspberrypi-bin libraspberrypi-dev libx11-dev libglew-dev libegl1-mesa-dev \
nasm autoconf git cmake zip gcc g++ libtool libxrandr-dev x11proto-randr-dev libgles-dev
  • I did runned command:
./build_rootfs.sh create ./2021-03-04-raspios-buster-armhf-lite.img

Note: I did downloaded earlier raspbian os lite version, then I did extracted it.

  • After when it was done there was rootfs dir with all files. Copied it over to place where after I did created docker image.
FROM debian:10
# Install some dependencies
RUN apt update && apt -y install nano git cmake autoconf libtool nasm zip
# Add RasbianOS RootFS and Cross Compilers directories to the image
ADD ./rootfs /opt/rootfs
ADD ./cross-pi-gcc /opt/cross-pi-gcc
# Add extra Env Variables
ENV PATH=$PATH:/opt/cross-pi-gcc/bin \
 RASPBIAN_ROOTFS=/opt/rootfs \
 CC=arm-linux-gnueabihf-gcc \
 CXX=arm-linux-gnueabihf-g++ \
 NM=arm-linux-gnueabihf-nm \
 LD=arm-linux-gnueabihf-ld \
 RANLIB=arm-linux-gnueabihf-ranlib \
 AR=arm-linux-gnueabihf-ar
  • I am not counting here the symlinks that you requested here.
You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

@rafal1137 I made some changes to https://github.com/kclyu/rpi_rootfs sysroot and bare minimum example is seems to be working ok, but the real problem with sysroot within cmake is still as it is. I'll run more test and to find the root cause, will update you when it is ready. IMO, the toolchain itself might need some rework. In the mean time you can try linaro ARM toolchains instead, give them a try.

You must be logged in to vote
9 replies
Comment options

@abhiTronix

With some issues I did managed to build this cross compiler.
Result:
Same as before still failing at simple foo.cpp

@rafal1137 That's highly unlikely. Maybe some critical CMAKE flags missing. You can raise issue here on their official repository with error stack. What if the solution they provide also may works for our toolchainsmiley. Please share the findings here too.

This may take some time. I have raised 2 issues there so far no answers.

Comment options

@rafal1137 IDK, usually they are pretty active. I'm still not getting time to work on this, I'll try my best to review this issue as soon as possible.

Comment options

@abhiTronix I will give you more info/log to work with when using CMake it fails at openal

Scanning dependencies of target native-tools
[ 12%] Generating native-tools/bin2h, native-tools/bsincgen
-- The C compiler identification is GNU 10.3.0
-- The CXX compiler identification is GNU 10.3.0
-- Check for working C compiler: /opt/cross-pi-gcc/bin/armv7-rpi3-linux-gnueabihf-gcc
-- Check for working C compiler: /opt/cross-pi-gcc/bin/armv7-rpi3-linux-gnueabihf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/cross-pi-gcc/bin/armv7-rpi3-linux-gnueabihf-g++
-- Check for working CXX compiler: /opt/cross-pi-gcc/bin/armv7-rpi3-linux-gnueabihf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pow in m
-- Looking for pow in m - found
-- Configuring done
-- Generating done
-- Build files have been written to: /etlegacy/build/libs/openal/native-tools
Scanning dependencies of target bin2h
[ 25%] Building C object CMakeFiles/bin2h.dir/bin2h.c.o
[ 50%] Linking C executable bin2h
[ 50%] Built target bin2h
Scanning dependencies of target bsincgen
[ 75%] Building C object CMakeFiles/bsincgen.dir/bsincgen.c.o
[100%] Linking C executable bsincgen
[100%] Built target bsincgen
[ 12%] Built target native-tools
[ 14%] Generating bsinc_inc.h
/lib/ld-linux-armhf.so.3: No such file or directory
make[5]: *** [CMakeFiles/OpenAL.dir/build.make:70: bsinc_inc.h] Error 255
make[4]: *** [CMakeFiles/Makefile2:141: CMakeFiles/OpenAL.dir/all] Error 2
make[3]: *** [Makefile:130: all] Error 2
make[2]: *** [CMakeFiles/bundled_openal.dir/build.make:111: bundled_openal-prefix/src/bundled_openal-stamp/bundled_openal-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:180: CMakeFiles/bundled_openal.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

I did used here crosstool-ng toolchain but it same with yours.

PS: If you want me to post more log here. Just tell me

Comment options

@rafal1137 Lmao I feel stupid, I've already solved this problem but testing wrong file. 😆

Comment options

@rafal1137 Please wait I'll upload new instructions shortly. BTW, I tested new built SYSROOT on OpenCV and it worked flawlessly,

Comment options

You must be logged in to vote
22 replies
Comment options

@rafal1137 Everything seems fine, IDK what's the problem. Can you try following symlinks:

ln -sf /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf/libbsd.so.0 /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/usr/lib/libbsd.so.0
ln -sf /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf/libX11.so /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/usr/lib/libX11.so
ln -sf /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf/libxcb.so.1 /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/usr/lib/libxcb.so.1
ln -sf /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf/libdl.so.2 /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/usr/lib/libdl.so.2

and see if it works.

Comment options

@abhiTronix Just did those symlinks and nothing.

Comment options

@rafal1137 Then, it is a dead end for now. Can post the complete instructions you're using to compile the project, I'll try locally and will let you know if it works with some changes.

Comment options

@abhiTronix The Instructions.

Structure of dirs goes like this

cross-pi-gcc <- Toolchain
etlegacy <- Cloned repo
rpi_rootfs < Rootfs repo that contains the rootfs
  • In update_upgrade_install_package.sh of rpi_rootfs repo add:
apt -y install build-essential libfreeimage-dev libopenal-dev libpango1.0-dev libsndfile-dev libudev-dev \
libasound2-dev libjpeg8-dev libwebp-dev automake libgl1-mesa-glx libjpeg62-turbo libogg0 libopenal1 libvorbis0a \
libvorbisfile3 zlib1g libraspberrypi0 libraspberrypi-bin libraspberrypi-dev libx11-dev libdnet libbsd-dev libglew-dev \
nasm autoconf git cmake zip gcc g++ libtool libxrandr-dev x11proto-randr-dev libgles-dev
  • Create a fresh rootfs with those additional libs.
  • Clone a repo git clone -b cross_compile_rpi --recursive https://github.com/etlegacy/etlegacy.
  • In PI.cmake replace arm with armv7l not mentioning a correct path for toolchain and sysroot here.
  • Some additional changes has to be made since I did not set RASPBIAN_ROOTFS and SYSROOT_PATH ofc you can create them for simpilication. Set the path for PI.cmake.
diff --git a/cmake/ETLSetupFeatures.cmake b/cmake/ETLSetupFeatures.cmake
index 4048737ed..53c6eb543 100644
--- a/cmake/ETLSetupFeatures.cmake
+++ b/cmake/ETLSetupFeatures.cmake
@@ -29,10 +29,10 @@ if(BUILD_CLIENT)
 		if(EXISTS "/opt/vc/include/bcm_host.h")
 			MESSAGE("bcm_host.h found")
 			set(BCMHOST found)
-		elseif(EXISTS "$ENV{RASPBIAN_ROOTFS}/opt/vc/include/bcm_host.h")
+		elseif(EXISTS "/home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/opt/vc/include/bcm_host.h")
 			MESSAGE("bcm_host.h found")
- include_directories(${SYSROOT_PATH}/usr/include/arm-linux-gnueabihf)
- link_directories(${SYSROOT_PATH}/usr/lib/arm-linux-gnueabihf)
+ include_directories(/home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/usr/include/arm-linux-gnueabihf)
+ link_directories(/home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf)
 		else()
 			MESSAGE("bcm_host.h not found")
 		endif()
diff --git a/cmake/FindGLES.cmake b/cmake/FindGLES.cmake
index bfa84e1cb..fb19ca9ea 100644
--- a/cmake/FindGLES.cmake
+++ b/cmake/FindGLES.cmake
@@ -22,11 +22,11 @@ if(EXISTS "/opt/vc/include/bcm_host.h")
 		find_library(GLES_LIBRARY NAMES libGLESv1_CM.so.1 PATHS "/usr/lib/arm-linux-gnueabihf/")
 		MESSAGE("Raspberry Pi 4 found")
 	endif()
-elseif(EXISTS "$ENV{RASPBIAN_ROOTFS}/opt/vc/include/bcm_host.h")
+elseif(EXISTS "~/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/opt/vc/include/bcm_host.h")
 
 	#Set Only RPI 2/3 GLES
-	find_path(GLES_INCLUDE_DIR NAMES GLES/gl.h PATHS "$ENV{RASPBIAN_ROOTFS}/opt/vc/include/")
-	find_library(GLES_LIBRARY NAMES brcmGLESv2 PATHS "$ENV{RASPBIAN_ROOTFS}/opt/vc/lib/")
+	find_path(GLES_INCLUDE_DIR NAMES GLES/gl.h PATHS "~/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/opt/vc/include/")
+	find_library(GLES_LIBRARY NAMES brcmGLESv2 PATHS "~/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/opt/vc/lib/")
 	MESSAGE("Raspberry Pi 2/3 found")
 else()
 	find_path(GLES_INCLUDE_DIR GLES/gl.h)
diff --git a/easybuild.sh b/easybuild.sh
index 453adc411..5ef2ed98a 100755
--- a/easybuild.sh
+++ b/easybuild.sh
@@ -305,7 +305,7 @@ parse_commandline() {
 			FEATURE_AUTOUPDATE=0
 		elif [ "$var" = "-RPI" ]; then
 			einfo "Will enable Raspberry PI build ..."
-			CMAKE_TOOLCHAIN_FILE=cmake/Toolchain-cross-rpi-linux.cmake
+			CMAKE_TOOLCHAIN_FILE=../PI.cmake
 			ARM=1
 			CROSS_COMPILE32=0
 			x86_build=false
  • When all those changes has been made, run ./easybuild.sh generate -RPI inside etlegacy dir, this will create build dir with generated files to compile.
Comment options

@rafal1137 Thank you. I'll get back to you shortly if I'm able to crack the problems.

Comment options

@rafal1137 I'm opening this new thread for resolving new bugs.

You must be logged in to vote
15 replies
Comment options

@rafal1137 Also let's talk over gitter: https://gitter.im/vidgear/raspberry_pi_toolchains so that we can paste output in real-time and resolve this problem.

Comment options

@abhiTronix

Yes there is something fishy about rootfs creation.
Full Log:
rootfs.txt

################################################################################
###
### fixing absolute links
###
################################################################################
File Starting /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/etc/alternatives/rlogin link /usr/bin/slogin
File Starting /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/etc/alternatives/automake.1.gz link /usr/share/man/man1/automake-1.16.1.gz
File Starting /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/etc/alternatives/rlogin.1.gz link /usr/share/man/man1/slogin.1.gz
File Starting /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/etc/alternatives/rcp.1.gz link /usr/share/man/man1/scp.1.gz
File Starting /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/etc/alternatives/aclocal.1.gz link /usr/share/man/man1/aclocal-1.16.1.gz
File Starting /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/etc/alternatives/rcp link /usr/bin/scp
File Starting /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/etc/alternatives/automake link /usr/bin/automake-1.16
File Starting /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/etc/alternatives/aclocal link /usr/bin/aclocal-1.16
File Starting /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/etc/fonts/conf.d/45-generic.conf link /usr/share/fontconfig/conf.avail/45-generic.conf
Traceback (most recent call last):
 File "./rpi_rootfs.py", line 274, in <module>
 sys.exit(main(sys.argv))
 File "./rpi_rootfs.py", line 256, in main
 process_relativelinks(rootfs_path);
 File "./rpi_rootfs.py", line 106, in process_relativelinks
 relativelinks_handlelink(topdir, filep, subdir) 
 File "./rpi_rootfs.py", line 92, in relativelinks_handlelink
 os.unlink(filep)
OSError: [Errno 13] Permission denied: '/home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/rpi_rootfs/rootfs/etc/fonts/conf.d/45-generic.conf'
Unmounting /mnt
Comment options

Yes there is something fishy about rootfs creation.
Full Log:
rootfs.txt

Wait till I'll upload the fix.

Comment options

@rafal1137 My configure log:

~~> Will enable Raspberry PI build ...
 * ET: Legacy Easy Builder
 * ===============================
 * This script will check for binaries needed to compile ET: Legacy
 * Then it will build ET: Legacy into /home/abhishek/rpi_rootfs/etlegacy/build/ directory
~~> Checking for needed apps to compile...
 running on: Linux x86_64 - buster/sid
 autoconf found: /usr/bin/autoconf
 libtoolize found: /usr/bin/libtoolize
 cmake found: /usr/bin/cmake
 gcc found: /usr/lib/ccache/gcc
 g++ found: /usr/lib/ccache/g++
 clang found: /opt/rocm/opencl/bin/x86_64/clang
 clang++ not found but no problem
 git found: /usr/bin/git
 zip found: /usr/bin/zip
 nasm not found
~~> Using compilers:
 CC = gcc
 CXX = g++
~~> Configuring ET: Legacy...
: 
		-DCMAKE_TOOLCHAIN_FILE=/home/abhishek/rpi_rootfs/PI.cmake
		-DCMAKE_BUILD_TYPE=Release
		-DCROSS_COMPILE32=0
		-DZIP_ONLY=0
		-DARM=1
		-DBUILD_SERVER=1
		-DBUILD_CLIENT=1
		-DBUILD_MOD=1
		-DBUILD_MOD_PK3=1
		-DBUNDLED_LIBS=1
		-DBUNDLED_SDL=1
		-DBUNDLED_ZLIB=1
		-DBUNDLED_MINIZIP=1
		-DBUNDLED_JPEG=1
		-DBUNDLED_CURL=1
		-DBUNDLED_WOLFSSL=
		-DBUNDLED_OPENSSL=1
		-DBUNDLED_LUA=1
		-DBUNDLED_OGG_VORBIS=0
		-DBUNDLED_THEORA=0
		-DBUNDLED_OPENAL=1
		-DBUNDLED_GLEW=0
		-DBUNDLED_FREETYPE=0
		-DBUNDLED_PNG=1
		-DBUNDLED_SQLITE3=1
		-DFEATURE_CURL=1
		-DFEATURE_SSL=1
		-DFEATURE_OGG_VORBIS=0
		-DFEATURE_THEORA=0
		-DFEATURE_OPENAL=1
		-DFEATURE_FREETYPE=0
		-DFEATURE_PNG=0
		-DFEATURE_LUA=1
		-DFEATURE_MULTIVIEW=1
		-DFEATURE_EDV=1
		-DFEATURE_ANTICHEAT=1
		-DFEATURE_GETTEXT=1
		-DFEATURE_DBMS=1
		-DFEATURE_RATING=1
		-DFEATURE_PRESTIGE=1
		-DFEATURE_AUTOUPDATE=1
		-DFEATURE_RENDERER2=0
		-DFEATURE_RENDERER_GLES=1
		-DRENDERER_DYNAMIC=0
		-DFEATURE_LUASQL=1
		-DFEATURE_OMNIBOT=1
		-DINSTALL_EXTRA=1
		-DINSTALL_OMNIBOT=0
		-DINSTALL_GEOIP=1
		-DINSTALL_WOLFADMIN=1
	
		-DCMAKE_INSTALL_PREFIX=/home/abhishek/etlegacy
		-DINSTALL_DEFAULT_MODDIR=.
		-DINSTALL_DEFAULT_BINDIR=.
		-DINSTALL_DEFAULT_BASEDIR=.
		
~~> Generating makefiles: Unix Makefiles...
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/abhishek/rpi_rootfs/tools/cross-pi-gcc-10.2.0-1/bin/arm-linux-gnueabihf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/abhishek/rpi_rootfs/tools/cross-pi-gcc-10.2.0-1/bin/arm-linux-gnueabihf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- ARMV7 build options set.
-- Performing Test SUPPORT_VISIBILITY
-- Performing Test SUPPORT_VISIBILITY - Success
-- Detected ARMV7 target processor
-- System: Linux-1 (armv7l)
-- Lib arch: arm-linux-gnueabihf
-- Build type: Release
-- Install path: /home/abhishek/etlegacy
-- Compiler flags:
-- - C -fPIC -Wl,-rpath-link,/home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf -L/home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf -fPIC -Wl,-rpath-link,/home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf -L/home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf -pipe -mfloat-abi=hard -mfpu=neon -march=armv7-a -O2 -fvisibility=hidden
-- - C++ -fPIC -Wl,-rpath-link,/home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf -L/home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf -fPIC -Wl,-rpath-link,/home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf -L/home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf -pipe -mfloat-abi=hard -mfpu=neon -march=armv7-a -O2
-- Linker flags:
-- - Executable -fPIC -Wl,-rpath-link,/home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf -L/home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf -fPIC -Wl,-rpath-link,/home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf -L/home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf
-- - Module 
-- - Shared 
-- File version: 2.77.1.0
-- Using a non release version build: 'v2.77.1-296-ge61792e' != 'v2.77.1'
-- Version: 2.77.1.296 and int version: 277010296
-- Using bundled libraries located at /home/abhishek/rpi_rootfs/etlegacy/libs
SQLite3 version = 3.32.1
SQLite3 threadsafe is disabled
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Libraries rescanned
-- Found X11: /home/abhishek/rpi_rootfs/rootfs/usr/include 
-- Looking for XOpenDisplay in /home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf/libX11.so;/home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf/libXext.so
-- Looking for XOpenDisplay in /home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf/libX11.so;/home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
Looking for bcm_host.h
bcm_host.h found
-- Found GLES: /home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf/libGLESv1_CM.so 
-- Looking for pow in m
-- Looking for pow in m - found
-- Installing GeoIP
-- Downloading GeoIP archive to /home/abhishek/rpi_rootfs/etlegacy/build/legacy/GeoIP.dat.tar.gz
-- [download 0% complete]
-- [download 4% complete]
-- [download 5% complete]
-- [download 7% complete]
-- [download 9% complete]
-- [download 11% complete]
-- [download 12% complete]
-- [download 14% complete]
-- [download 16% complete]
-- [download 18% complete]
-- [download 21% complete]
-- [download 25% complete]
-- [download 26% complete]
-- [download 28% complete]
-- [download 30% complete]
-- [download 33% complete]
-- [download 35% complete]
-- [download 37% complete]
-- [download 39% complete]
-- [download 40% complete]
-- [download 42% complete]
-- [download 44% complete]
-- [download 46% complete]
-- [download 65% complete]
-- [download 67% complete]
-- [download 69% complete]
-- [download 70% complete]
-- [download 72% complete]
-- [download 76% complete]
-- [download 77% complete]
-- [download 83% complete]
-- [download 84% complete]
-- [download 86% complete]
-- [download 88% complete]
-- [download 91% complete]
-- [download 93% complete]
-- [download 95% complete]
-- [download 97% complete]
-- [download 98% complete]
-- [download 100% complete]
-- Extracting GeoIP archive to /home/abhishek/rpi_rootfs/etlegacy/build/legacy/GeoIP.dat
-- Adding GeoIP to installer scripts
-- Installing WolfAdmin
-- Downloading WolfAdmin archive to /home/abhishek/rpi_rootfs/etlegacy/build/legacy/wolfadmin.tar.gz
-- [download 3% complete]
-- [download 7% complete]
-- [download 9% complete]
-- [download 12% complete]
-- [download 13% complete]
-- [download 15% complete]
-- [download 17% complete]
-- [download 19% complete]
-- [download 23% complete]
-- [download 25% complete]
-- [download 26% complete]
-- [download 30% complete]
-- [download 32% complete]
-- [download 35% complete]
-- [download 36% complete]
-- [download 38% complete]
-- [download 39% complete]
-- [download 41% complete]
-- [download 44% complete]
-- [download 45% complete]
-- [download 46% complete]
-- [download 48% complete]
-- [download 49% complete]
-- [download 51% complete]
-- [download 52% complete]
-- [download 55% complete]
-- [download 57% complete]
-- [download 60% complete]
-- [download 61% complete]
-- [download 62% complete]
-- [download 67% complete]
-- [download 68% complete]
-- [download 70% complete]
-- [download 71% complete]
-- [download 73% complete]
-- [download 74% complete]
-- [download 77% complete]
-- [download 78% complete]
-- [download 80% complete]
-- [download 81% complete]
-- [download 83% complete]
-- [download 84% complete]
-- [download 86% complete]
-- [download 89% complete]
-- [download 90% complete]
-- [download 94% complete]
-- [download 99% complete]
-- [download 100% complete]
-- Extracting WolfAdmin archive to /home/abhishek/rpi_rootfs/etlegacy/build/legacy/wolfadmin
-- Adding WolfAdmin to installer scripts
-- ***********************************************************
-- Genuine W:ET files are not copied - ET: Legacy won't start!
-- In order to start the game, copy the pak0-2.pk3 asset files
-- to ./etmain
-- ***********************************************************
-- Configuring done
-- Generating done
Comment options

@rafal1137 Yeah I was wrong. Getting same error with OpenSSL:

[ 16%] Performing build step for 'bundled_openssl'
make[3]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule.
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/lib/ccache/cc
-- Check for working C compiler: /usr/lib/ccache/cc - broken
CMake Error at /usr/share/cmake-3.20/Modules/CMakeTestCCompiler.cmake:66 (message):
 The C compiler
 "/usr/lib/ccache/cc"
 is not able to compile a simple test program.
 It fails with the following output:
 Change Dir: /home/abhishek/rpi_rootfs/etlegacy/build/libs/openal/CMakeFiles/CMakeTmp
 
 Run Build Command(s):/usr/bin/make -f Makefile cmTC_b5048/fast && make[3]: Entering directory '/home/abhishek/rpi_rootfs/etlegacy/build/libs/openal/CMakeFiles/CMakeTmp'
 /usr/bin/make -f CMakeFiles/cmTC_b5048.dir/build.make CMakeFiles/cmTC_b5048.dir/build
 make[4]: Entering directory '/home/abhishek/rpi_rootfs/etlegacy/build/libs/openal/CMakeFiles/CMakeTmp'
 Building C object CMakeFiles/cmTC_b5048.dir/testCCompiler.c.o
 /usr/lib/ccache/cc -fPIC -Wl,-rpath-link,/home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf -L/home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf -fPIC -Wl,-rpath-link,/home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf -L/home/abhishek/rpi_rootfs/rootfs/usr/lib/arm-linux-gnueabihf -pipe -mfloat-abi=hard -mfpu=neon -march=armv7-a -O2 -fvisibility=hidden -o CMakeFiles/cmTC_b5048.dir/testCCompiler.c.o -c /home/abhishek/rpi_rootfs/etlegacy/build/libs/openal/CMakeFiles/CMakeTmp/testCCompiler.c
 cc: error: unrecognized command line option ‘-mfloat-abi=hard’
 cc: error: unrecognized command line option ‘-mfpu=neon’
 CMakeFiles/cmTC_b5048.dir/build.make:77: recipe for target 'CMakeFiles/cmTC_b5048.dir/testCCompiler.c.o' failed
 make[4]: *** [CMakeFiles/cmTC_b5048.dir/testCCompiler.c.o] Error 1
 make[4]: Leaving directory '/home/abhishek/rpi_rootfs/etlegacy/build/libs/openal/CMakeFiles/CMakeTmp'
 Makefile:127: recipe for target 'cmTC_b5048/fast' failed
 make[3]: *** [cmTC_b5048/fast] Error 2
 make[3]: Leaving directory '/home/abhishek/rpi_rootfs/etlegacy/build/libs/openal/CMakeFiles/CMakeTmp'
 
 
 
 CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
 CMakeLists.txt:5 (PROJECT)
-- Configuring incomplete, errors occurred!
See also "/home/abhishek/rpi_rootfs/etlegacy/build/libs/openal/CMakeFiles/CMakeOutput.log".
See also "/home/abhishek/rpi_rootfs/etlegacy/build/libs/openal/CMakeFiles/CMakeError.log".
CMakeFiles/bundled_openal.dir/build.make:91: recipe for target 'bundled_openal-prefix/src/bundled_openal-stamp/bundled_openal-configure' failed
make[2]: *** [bundled_openal-prefix/src/bundled_openal-stamp/bundled_openal-configure] Error 1
CMakeFiles/Makefile2:376: recipe for target 'CMakeFiles/bundled_openal.dir/all' failed
make[1]: *** [CMakeFiles/bundled_openal.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Comment options

@abhiTronix I will write in new post here since it gets some issue sorted out.

About OpenSSL as workaround I did exported CC and CXX

export CC=~/Pobrane/rpi_rootfs/cross_rpi_docker/cross-pi-gcc/bin/arm-linux-gnueabihf-gcc
export CXX=~/Pobrane/rpi_rootfs/cross_rpi_docker/cross-pi-gcc/bin/arm-linux-gnueabihf-g++

I have tried to force those with cmake file with no luck so workaround was way to go here.

Next one about lua turns out it sets CC in its Makefile I did just commented it out
So here is the diff

diff --git a/lua/src/Makefile b/lua/src/Makefile
index 30a72a3..e51bff2 100644
--- a/lua/src/Makefile
+++ b/lua/src/Makefile
@@ -6,7 +6,7 @@
 # Your platform. See PLATS for possible values.
 PLAT= guess
 
-CC= gcc -std=gnu99
+#CC= gcc -std=gnu99
 CFLAGS= -O2 -Wall -Wextra $(SYSCFLAGS) $(MYCFLAGS)
 LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
 LIBS= -lm $(SYSLIBS) $(MYLIBS)

Readelf:

ELF Header:
 Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
 Class: ELF32
 Data: 2's complement, little endian
 Version: 1 (current)
 OS/ABI: UNIX - System V
 ABI Version: 0
 Type: REL (Relocatable file)
 Machine: ARM
 Version: 0x1
 Entry point address: 0x0
 Start of program headers: 0 (bytes into file)
 Start of section headers: 17776 (bytes into file)
 Flags: 0x5000000, Version5 EABI
 Size of this header: 52 (bytes)
 Size of program headers: 0 (bytes)
 Number of program headers: 0
 Size of section headers: 40 (bytes)
 Number of section headers: 13
 Section header string table index: 12

Here is entire build log
build.log

It turns out curl need some attention too.

checking for a BSD-compatible install... /usr/bin/install -c
checking for gcc... /home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/cross-pi-gcc/bin/arm-linux-gnueabihf-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/home/rafal/Pobrane/rpi_rootfs/cross_rpi_docker/etlegacy/build/downloads/src/curl':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
make[2]: *** [CMakeFiles/bundled_curl.dir/build.make:111: libs/curl/src/bundled_curl-stamp/bundled_curl-configure] Błąd 1
make[1]: *** [CMakeFiles/Makefile2:299: CMakeFiles/bundled_curl.dir/all] Błąd 2
make: *** [Makefile:152: all] Błąd 2
Exiting!
You must be logged in to vote
0 replies
Comment options

@abhiTronix
Since my last post some time has passed. I did decided to get back with fresh mind and decided to compile openal standalone.
This is the configure/compile log:

cmake . -DCMAKE_TOOLCHAIN_FILE=../../PI.cmake -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Check for working C compiler: /opt/cross-pi-gcc/bin/arm-linux-gnueabihf-gcc
-- Check for working C compiler: /opt/cross-pi-gcc/bin/arm-linux-gnueabihf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/cross-pi-gcc/bin/arm-linux-gnueabihf-g++
-- Check for working CXX compiler: /opt/cross-pi-gcc/bin/arm-linux-gnueabihf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of long
-- Check size of long - done
-- Check size of long long
-- Check size of long long - done
-- Performing Test HAVE_STD_C11
-- Performing Test HAVE_STD_C11 - Success
-- Performing Test HAVE_STD_CXX11
-- Performing Test HAVE_STD_CXX11 - Success
-- Looking for posix_memalign
-- Looking for posix_memalign - not found
-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Checking _FILE_OFFSET_BITS for large files
-- Checking _FILE_OFFSET_BITS for large files - 64
-- Performing Test INLINE_IS_C99
-- Performing Test INLINE_IS_C99 - Success
-- Performing Test HAVE_STRUCT_TIMESPEC
-- Performing Test HAVE_STRUCT_TIMESPEC - Success
-- Performing Test HAVE_LIBATOMIC
-- Performing Test HAVE_LIBATOMIC - Success
-- Looking for __android_log_print in log
-- Looking for __android_log_print in log - not found
-- Performing Test HAVE_C99_BOOL
-- Performing Test HAVE_C99_BOOL - Success
-- Performing Test HAVE_C11_STATIC_ASSERT
-- Performing Test HAVE_C11_STATIC_ASSERT - Success
-- Performing Test HAVE_C11_ALIGNAS
-- Performing Test HAVE_C11_ALIGNAS - Success
-- Performing Test HAVE_C11_ATOMIC
-- Performing Test HAVE_C11_ATOMIC - Success
-- Performing Test HAVE_W_EXTRA
-- Performing Test HAVE_W_EXTRA - Success
-- Performing Test HAVE_FNO_MATH_ERRNO
-- Performing Test HAVE_FNO_MATH_ERRNO - Success
-- Performing Test HAVE_GCC_DESTRUCTOR
-- Performing Test HAVE_GCC_DESTRUCTOR - Success
-- Performing Test HAVE_GCC_PROTECTED_VISIBILITY
-- Performing Test HAVE_GCC_PROTECTED_VISIBILITY - Success
-- Performing Test HAVE_VISIBILITY_HIDDEN_SWITCH
-- Performing Test HAVE_VISIBILITY_HIDDEN_SWITCH - Success
-- Performing Test HAVE_ATTRIBUTE_ALIGNED
-- Performing Test HAVE_ATTRIBUTE_ALIGNED - Success
-- Performing Test HAVE___BUILTIN_ASSUME_ALIGNED
-- Performing Test HAVE___BUILTIN_ASSUME_ALIGNED - Success
-- Performing Test HAVE_MSSE_SWITCH
-- Performing Test HAVE_MSSE_SWITCH - Failed
-- Performing Test HAVE_MSSE2_SWITCH
-- Performing Test HAVE_MSSE2_SWITCH - Failed
-- Performing Test HAVE_MSSE3_SWITCH
-- Performing Test HAVE_MSSE3_SWITCH - Failed
-- Performing Test HAVE_MSSE4_1_SWITCH
-- Performing Test HAVE_MSSE4_1_SWITCH - Failed
-- Performing Test HAVE_MFPU_NEON_SWITCH
-- Performing Test HAVE_MFPU_NEON_SWITCH - Success
-- Performing Test HAVE_GCC_FORMAT
-- Performing Test HAVE_GCC_FORMAT - Success
-- Looking for stdbool.h
CMake Warning (dev) at /usr/share/cmake-3.13/Modules/CheckIncludeFile.cmake:70 (message):
 Policy CMP0075 is not set: Include file check macros honor
 CMAKE_REQUIRED_LIBRARIES. Run "cmake --help-policy CMP0075" for policy
 details. Use the cmake_policy command to set the policy and suppress this
 warning.
 CMAKE_REQUIRED_LIBRARIES is set to:
 atomic
 For compatibility with CMake 3.11 and below this check is ignoring it.
Call Stack (most recent call first):
 CMakeLists.txt:480 (CHECK_INCLUDE_FILE)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Looking for stdbool.h - found
-- Looking for stdalign.h
-- Looking for stdalign.h - found
-- Looking for malloc.h
-- Looking for malloc.h - found
-- Looking for dirent.h
-- Looking for dirent.h - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for cpuid.h
-- Looking for cpuid.h - not found
-- Looking for intrin.h
-- Looking for intrin.h - not found
-- Looking for sys/sysconf.h
-- Looking for sys/sysconf.h - not found
-- Looking for fenv.h
-- Looking for fenv.h - found
-- Looking for float.h
-- Looking for float.h - found
-- Looking for ieeefp.h
-- Looking for ieeefp.h - not found
-- Looking for guiddef.h
-- Looking for guiddef.h - not found
-- Looking for initguid.h
-- Looking for initguid.h - not found
-- Looking for pow in m
-- Looking for pow in m - found
-- Looking for dlopen in dl
-- Looking for dlopen in dl - found
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for sysconf
-- Looking for sysconf - found
-- Looking for aligned_alloc
-- Looking for aligned_alloc - found
-- Looking for posix_memalign
-- Looking for posix_memalign - found
-- Looking for _aligned_malloc
-- Looking for _aligned_malloc - not found
-- Looking for proc_pidpath
-- Looking for proc_pidpath - not found
-- Looking for lrintf
-- Looking for lrintf - found
-- Looking for modff
-- Looking for modff - found
-- Looking for log2f
-- Looking for log2f - found
-- Looking for cbrtf
-- Looking for cbrtf - found
-- Looking for copysignf
-- Looking for copysignf - found
-- Looking for _controlfp
-- Looking for _controlfp - not found
-- Looking for __control87_2
-- Looking for __control87_2 - not found
-- Looking for stat
-- Looking for stat - found
-- Looking for strtof
-- Looking for strtof - found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for strncasecmp
-- Looking for strncasecmp - found
-- Looking for strnlen
-- Looking for strnlen - not found
-- Looking for snprintf
-- Looking for snprintf - found
-- Looking for isfinite
-- Looking for isfinite - found
-- Looking for isnan
-- Looking for isnan - found
-- Looking for windows.h
-- Looking for windows.h - not found
-- Looking for gettimeofday
-- Looking for gettimeofday - found
-- Looking for nanosleep
-- Looking for nanosleep - found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for include files pthread.h, pthread_np.h
-- Looking for include files pthread.h, pthread_np.h - not found
-- Performing Test HAVE_PTHREAD
-- Performing Test HAVE_PTHREAD - Success
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Looking for pthread_setschedparam
-- Looking for pthread_setschedparam - found
-- Looking for pthread_setname_np
-- Looking for pthread_setname_np - not found
-- Looking for pthread_set_name_np
-- Looking for pthread_set_name_np - not found
-- Looking for pthread_mutexattr_setkind_np
-- Looking for pthread_mutexattr_setkind_np - not found
-- Looking for pthread_mutex_timedlock
-- Looking for pthread_mutex_timedlock - found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Looking for getopt
-- Looking for getopt - found
-- Looking for xmmintrin.h
-- Looking for xmmintrin.h - not found
-- Looking for emmintrin.h
-- Looking for emmintrin.h - not found
-- Looking for pmmintrin.h
-- Looking for pmmintrin.h - not found
-- Looking for smmintrin.h
-- Looking for smmintrin.h - not found
-- Looking for arm_neon.h
-- Looking for arm_neon.h - found
-- Found ALSA: /opt/rootfs/usr/lib/arm-linux-gnueabihf/libasound.so (found version "1.1.8") 
-- Found OSS: /opt/rootfs/usr/include/arm-linux-gnueabihf 
-- Could NOT find AudioIO (missing: AUDIOIO_INCLUDE_DIR) 
-- Could NOT find SoundIO (missing: SOUNDIO_LIBRARY SOUNDIO_INCLUDE_DIR) 
-- Could NOT find QSA (missing: QSA_LIBRARY QSA_INCLUDE_DIR) 
-- Could NOT find PortAudio (missing: PORTAUDIO_LIBRARY PORTAUDIO_INCLUDE_DIR) 
-- Could NOT find PulseAudio (missing: PULSEAUDIO_LIBRARY PULSEAUDIO_INCLUDE_DIR) 
-- Could NOT find JACK (missing: JACK_LIBRARY JACK_INCLUDE_DIR) 
-- Looking for include files SLES/OpenSLES.h, SLES/OpenSLES_Android.h
-- Looking for include files SLES/OpenSLES.h, SLES/OpenSLES_Android.h - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - found
-- Found Threads: TRUE 
-- Could NOT find SDL2 (missing: SDL2_LIBRARY SDL2_INCLUDE_DIR) 
-- Found Git: /usr/bin/git (found version "2.20.1") 
CMake Warning at utils/alsoft-config/CMakeLists.txt:15 (find_package):
 By not providing "FindQt5Widgets.cmake" in CMAKE_MODULE_PATH this project
 has asked CMake to find a package configuration file provided by
 "Qt5Widgets", but CMake did not find one.
 Could not find a package configuration file provided by "Qt5Widgets" with
 any of the following names:
 Qt5WidgetsConfig.cmake
 qt5widgets-config.cmake
 Add the installation prefix of "Qt5Widgets" to CMAKE_PREFIX_PATH or set
 "Qt5Widgets_DIR" to a directory containing one of the above files. If
 "Qt5Widgets" provides a separate development package or SDK, be sure it has
 been installed.
-- Found unsuitable Qt version "" from NOTFOUND
-- Could NOT find SDL2 (missing: SDL2_LIBRARY SDL2_INCLUDE_DIR) 
-- 
-- Building OpenAL with support for the following backends:
-- ALSA, OSS, WaveFile, Null
-- 
-- Building with support for CPU extensions:
-- Default, Neon
-- 
-- Embedding HRTF datasets
-- 
-- Installing sample configuration
-- 
-- Installing HRTF definitions
-- 
-- Installing AmbDec presets
-- 
-- Building utility programs
-- 
-- Building test programs
-- 
-- Building example programs
-- Configuring done
-- Generating done
-- Build files have been written to: /etlegacy/libs/openal
make
/usr/bin/cmake -S/etlegacy/libs/openal -B/etlegacy/libs/openal --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /etlegacy/libs/openal/CMakeFiles /etlegacy/libs/openal/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/etlegacy/libs/openal'
make -f CMakeFiles/native-tools.dir/build.make CMakeFiles/native-tools.dir/depend
make[2]: Entering directory '/etlegacy/libs/openal'
cd /etlegacy/libs/openal && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /etlegacy/libs/openal /etlegacy/libs/openal /etlegacy/libs/openal /etlegacy/libs/openal /etlegacy/libs/openal/CMakeFiles/native-tools.dir/DependInfo.cmake --color=
Scanning dependencies of target native-tools
make[2]: Leaving directory '/etlegacy/libs/openal'
make -f CMakeFiles/native-tools.dir/build.make CMakeFiles/native-tools.dir/build
make[2]: Entering directory '/etlegacy/libs/openal'
[ 1%] Generating native-tools/bin2h, native-tools/bsincgen
cd /etlegacy/libs/openal/native-tools && /usr/bin/cmake -G "Unix Makefiles" /etlegacy/libs/openal/native-tools/
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Check for working C compiler: /opt/cross-pi-gcc/bin/arm-linux-gnueabihf-gcc
-- Check for working C compiler: /opt/cross-pi-gcc/bin/arm-linux-gnueabihf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /opt/cross-pi-gcc/bin/arm-linux-gnueabihf-g++
-- Check for working CXX compiler: /opt/cross-pi-gcc/bin/arm-linux-gnueabihf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pow in m
-- Looking for pow in m - found
-- Configuring done
-- Generating done
-- Build files have been written to: /etlegacy/libs/openal/native-tools
cd /etlegacy/libs/openal/native-tools && /usr/bin/cmake -E remove /etlegacy/libs/openal/native-tools/bin2h /etlegacy/libs/openal/native-tools/bsincgen
cd /etlegacy/libs/openal/native-tools && /usr/bin/cmake --build . --config Release
make[3]: Entering directory '/etlegacy/libs/openal/native-tools'
make[4]: Entering directory '/etlegacy/libs/openal/native-tools'
make[5]: Entering directory '/etlegacy/libs/openal/native-tools'
Scanning dependencies of target bin2h
make[5]: Leaving directory '/etlegacy/libs/openal/native-tools'
make[5]: Entering directory '/etlegacy/libs/openal/native-tools'
[ 25%] Building C object CMakeFiles/bin2h.dir/bin2h.c.o
[ 50%] Linking C executable bin2h
make[5]: Leaving directory '/etlegacy/libs/openal/native-tools'
[ 50%] Built target bin2h
make[5]: Entering directory '/etlegacy/libs/openal/native-tools'
Scanning dependencies of target bsincgen
make[5]: Leaving directory '/etlegacy/libs/openal/native-tools'
make[5]: Entering directory '/etlegacy/libs/openal/native-tools'
[ 75%] Building C object CMakeFiles/bsincgen.dir/bsincgen.c.o
[100%] Linking C executable bsincgen
make[5]: Leaving directory '/etlegacy/libs/openal/native-tools'
[100%] Built target bsincgen
make[4]: Leaving directory '/etlegacy/libs/openal/native-tools'
make[3]: Leaving directory '/etlegacy/libs/openal/native-tools'
make[2]: Leaving directory '/etlegacy/libs/openal'
[ 1%] Built target native-tools
make -f CMakeFiles/common.dir/build.make CMakeFiles/common.dir/depend
make[2]: Entering directory '/etlegacy/libs/openal'
cd /etlegacy/libs/openal && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /etlegacy/libs/openal /etlegacy/libs/openal /etlegacy/libs/openal /etlegacy/libs/openal /etlegacy/libs/openal/CMakeFiles/common.dir/DependInfo.cmake --color=
Scanning dependencies of target common
make[2]: Leaving directory '/etlegacy/libs/openal'
make -f CMakeFiles/common.dir/build.make CMakeFiles/common.dir/build
make[2]: Entering directory '/etlegacy/libs/openal'
[ 2%] Building C object CMakeFiles/common.dir/common/alcomplex.c.o
/opt/cross-pi-gcc/bin/arm-linux-gnueabihf-gcc --sysroot=/opt/rootfs -DHAVE_STRUCT_TIMESPEC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -I/etlegacy/libs/openal/include -I/etlegacy/libs/openal/common -I/etlegacy/libs/openal -fno-gnu89-inline -std=c11 -fPIC -Wl,-rpath-link,/opt/rootfs/usr/lib/arm-linux-gnueabihf -L/opt/rootfs/usr/lib/arm-linux-gnueabihf -fPIC -Wl,-rpath-link,/opt/rootfs/usr/lib/arm-linux-gnueabihf -L/opt/rootfs/usr/lib/arm-linux-gnueabihf -O2 -g -D_DEBUG -fPIC -Winline -Wall -Wextra -fno-math-errno -fvisibility=hidden -pthread -o CMakeFiles/common.dir/common/alcomplex.c.o -c /etlegacy/libs/openal/common/alcomplex.c
[ 4%] Building C object CMakeFiles/common.dir/common/almalloc.c.o
/opt/cross-pi-gcc/bin/arm-linux-gnueabihf-gcc --sysroot=/opt/rootfs -DHAVE_STRUCT_TIMESPEC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -I/etlegacy/libs/openal/include -I/etlegacy/libs/openal/common -I/etlegacy/libs/openal -fno-gnu89-inline -std=c11 -fPIC -Wl,-rpath-link,/opt/rootfs/usr/lib/arm-linux-gnueabihf -L/opt/rootfs/usr/lib/arm-linux-gnueabihf -fPIC -Wl,-rpath-link,/opt/rootfs/usr/lib/arm-linux-gnueabihf -L/opt/rootfs/usr/lib/arm-linux-gnueabihf -O2 -g -D_DEBUG -fPIC -Winline -Wall -Wextra -fno-math-errno -fvisibility=hidden -pthread -o CMakeFiles/common.dir/common/almalloc.c.o -c /etlegacy/libs/openal/common/almalloc.c
[ 5%] Building C object CMakeFiles/common.dir/common/atomic.c.o
/opt/cross-pi-gcc/bin/arm-linux-gnueabihf-gcc --sysroot=/opt/rootfs -DHAVE_STRUCT_TIMESPEC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -I/etlegacy/libs/openal/include -I/etlegacy/libs/openal/common -I/etlegacy/libs/openal -fno-gnu89-inline -std=c11 -fPIC -Wl,-rpath-link,/opt/rootfs/usr/lib/arm-linux-gnueabihf -L/opt/rootfs/usr/lib/arm-linux-gnueabihf -fPIC -Wl,-rpath-link,/opt/rootfs/usr/lib/arm-linux-gnueabihf -L/opt/rootfs/usr/lib/arm-linux-gnueabihf -O2 -g -D_DEBUG -fPIC -Winline -Wall -Wextra -fno-math-errno -fvisibility=hidden -pthread -o CMakeFiles/common.dir/common/atomic.c.o -c /etlegacy/libs/openal/common/atomic.c
[ 7%] Building C object CMakeFiles/common.dir/common/rwlock.c.o
/opt/cross-pi-gcc/bin/arm-linux-gnueabihf-gcc --sysroot=/opt/rootfs -DHAVE_STRUCT_TIMESPEC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -I/etlegacy/libs/openal/include -I/etlegacy/libs/openal/common -I/etlegacy/libs/openal -fno-gnu89-inline -std=c11 -fPIC -Wl,-rpath-link,/opt/rootfs/usr/lib/arm-linux-gnueabihf -L/opt/rootfs/usr/lib/arm-linux-gnueabihf -fPIC -Wl,-rpath-link,/opt/rootfs/usr/lib/arm-linux-gnueabihf -L/opt/rootfs/usr/lib/arm-linux-gnueabihf -O2 -g -D_DEBUG -fPIC -Winline -Wall -Wextra -fno-math-errno -fvisibility=hidden -pthread -o CMakeFiles/common.dir/common/rwlock.c.o -c /etlegacy/libs/openal/common/rwlock.c
[ 8%] Building C object CMakeFiles/common.dir/common/threads.c.o
/opt/cross-pi-gcc/bin/arm-linux-gnueabihf-gcc --sysroot=/opt/rootfs -DHAVE_STRUCT_TIMESPEC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -I/etlegacy/libs/openal/include -I/etlegacy/libs/openal/common -I/etlegacy/libs/openal -fno-gnu89-inline -std=c11 -fPIC -Wl,-rpath-link,/opt/rootfs/usr/lib/arm-linux-gnueabihf -L/opt/rootfs/usr/lib/arm-linux-gnueabihf -fPIC -Wl,-rpath-link,/opt/rootfs/usr/lib/arm-linux-gnueabihf -L/opt/rootfs/usr/lib/arm-linux-gnueabihf -O2 -g -D_DEBUG -fPIC -Winline -Wall -Wextra -fno-math-errno -fvisibility=hidden -pthread -o CMakeFiles/common.dir/common/threads.c.o -c /etlegacy/libs/openal/common/threads.c
[ 10%] Building C object CMakeFiles/common.dir/common/uintmap.c.o
/opt/cross-pi-gcc/bin/arm-linux-gnueabihf-gcc --sysroot=/opt/rootfs -DHAVE_STRUCT_TIMESPEC -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGE_FILES -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -I/etlegacy/libs/openal/include -I/etlegacy/libs/openal/common -I/etlegacy/libs/openal -fno-gnu89-inline -std=c11 -fPIC -Wl,-rpath-link,/opt/rootfs/usr/lib/arm-linux-gnueabihf -L/opt/rootfs/usr/lib/arm-linux-gnueabihf -fPIC -Wl,-rpath-link,/opt/rootfs/usr/lib/arm-linux-gnueabihf -L/opt/rootfs/usr/lib/arm-linux-gnueabihf -O2 -g -D_DEBUG -fPIC -Winline -Wall -Wextra -fno-math-errno -fvisibility=hidden -pthread -o CMakeFiles/common.dir/common/uintmap.c.o -c /etlegacy/libs/openal/common/uintmap.c
[ 11%] Linking C static library libcommon.a
/usr/bin/cmake -P CMakeFiles/common.dir/cmake_clean_target.cmake
/usr/bin/cmake -E cmake_link_script CMakeFiles/common.dir/link.txt --verbose=1
/opt/cross-pi-gcc/bin/arm-linux-gnueabihf-ar qc libcommon.a CMakeFiles/common.dir/common/alcomplex.c.o CMakeFiles/common.dir/common/almalloc.c.o CMakeFiles/common.dir/common/atomic.c.o CMakeFiles/common.dir/common/rwlock.c.o CMakeFiles/common.dir/common/threads.c.o CMakeFiles/common.dir/common/uintmap.c.o
/opt/cross-pi-gcc/bin/arm-linux-gnueabihf-ranlib libcommon.a
make[2]: Leaving directory '/etlegacy/libs/openal'
[ 11%] Built target common
make -f CMakeFiles/OpenAL.dir/build.make CMakeFiles/OpenAL.dir/depend
make[2]: Entering directory '/etlegacy/libs/openal'
[ 13%] Generating bsinc_inc.h
native-tools/bsincgen /etlegacy/libs/openal/bsinc_inc.h
/lib/ld-linux-armhf.so.3: No such file or directory
make[2]: *** [CMakeFiles/OpenAL.dir/build.make:73: bsinc_inc.h] Error 255
make[2]: Leaving directory '/etlegacy/libs/openal'
make[1]: *** [CMakeFiles/Makefile2:188: CMakeFiles/OpenAL.dir/all] Error 2
make[1]: Leaving directory '/etlegacy/libs/openal'
make: *** [Makefile:133: all] Error 2

As it can be seen it always complains about ld-linux-armhf.so
Will try do some tinkering later when I will find time to do so.

You must be logged in to vote
5 replies
Comment options

@abhiTronix What an interesting find. Changing my docker base image from debian to ubuntu solved the missing ld-linux-armhf.so

Comment options

@abhiTronix What an interesting find. Changing my docker base image from debian to ubuntu solved the missing ld-linux-armhf.so

Apparently this was a bad call 🗡️
It just on ubuntu compilation goes in different order.

Comment options

@rafal1137 I did gave it a try in my free time but apparently etlegacy code is broken for ARM builds, and I don't think it supports anything besides x86/x86_64 architecture. So ask their developers to port etlegacy code to ARM architecture first that atleast works with official https://github.com/raspberrypi/tools toolchains. Only then we can talk about fixing this issue.

Comment options

@abhiTronix

@rafal1137 I did gave it a try in my free time but apparently etlegacy code is broken for ARM builds, and I don't think it supports anything besides x86/x86_64 architecture. So ask their developers to port etlegacy code to ARM architecture first that atleast works with official https://github.com/raspberrypi/tools toolchains. Only then we can talk about fixing this issue.

Funny story I am one of those devs.
Code is compiling fine on:

So code is completely compatible with arm.

Comment options

Code is compiling fine on:

Actual RPI Hardware
Another docker img https://github.com/lukechilds/dockerpi (only locally on pc)

@rafal1137 Of Couse it will compile. But I'm talking about on hardware other than raspberry pi, since with cross compiler toolchains, we are not working with actual pi hardware, nor we are simulating pi inside docker. So like I said fix the etlegacy compilation for atleast official raspberry pi cross-compiler toolchain(https://github.com/raspberrypi/tools) and I'll myself make sure my toolchains work for that project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
Invalid 🙅‍♂️ This doesn't seem right
Converted from issue

This discussion was converted from issue #70 on April 14, 2021 14:11.

AltStyle によって変換されたページ (->オリジナル) /