thinkski / osx-arm-linux-toolchains

Pre-built ARM/Linux C cross-compilers for MacOS
https://thinkski.github.io/osx-arm-linux-toolchains
MIT License
123 stars 4 forks source link

arm-unknown-linux-gnueabihf/bin/ld.bfd: cannot find crt1.o: No such file or directory #10

Closed friedemannm closed 1 year ago

friedemannm commented 2 years ago

Hey!

I hope you can help me. I have a new M1 Mac and I'm still trying to get all my Raspberry Pi toolchains working again. Specifically, I'm trying to compile Qt 5.15.2 for Raspberry Pi zero using your toolchain. In the first step the toolchain is tested, which leads directly to an error.

The following linker command executed by ./configure of Qt fails...

/Users/friedemannmetzger/rpi-zero-new/arm-unknown-linux-gnueabihf/bin/arm-unknown-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/Users/friedemannmetzger/rpi-zero-new/sysroot -Wl,-O1 -Wl,-rpath-link,/Users/friedemannmetzger/rpi-zero-new/sysroot/opt/vc/lib -Wl,-rpath-link,/Users/friedemannmetzger/rpi-zero-new/sysroot/usr/lib/arm-unknown-linux-gnueabihf -Wl,-rpath-link,/Users/friedemannmetzger/rpi-zero-new/sysroot/lib/arm-unknown-linux-gnueabihf -o verifyspec verifyspec.o

It can't find these files:

/Users/friedemannmetzger/rpi-zero-new/arm-unknown-linux-gnueabihf/bin/../lib/gcc/arm-unknown-linux-gnueabihf/8.3.0/../../../../arm-unknown-linux-gnueabihf/bin/ld.bfd: cannot find crt1.o: No such file or directory
/Users/friedemannmetzger/rpi-zero-new/arm-unknown-linux-gnueabihf/bin/../lib/gcc/arm-unknown-linux-gnueabihf/8.3.0/../../../../arm-unknown-linux-gnueabihf/bin/ld.bfd: cannot find crti.o: No such file or directory
/Users/friedemannmetzger/rpi-zero-new/arm-unknown-linux-gnueabihf/bin/../lib/gcc/arm-unknown-linux-gnueabihf/8.3.0/../../../../arm-unknown-linux-gnueabihf/bin/ld.bfd: cannot find -lm

Basically the files are shipped in the sysroot folder. But how do I teach the linker to find and take them? All attempts with LIBRARY_PATH, LD_LIBRARY_PATH, -I etc.. failed until now. Do you have any idea?

My system: macOS 12.2.1, M1 Pro

Thank you very much in advance!

thinkski commented 1 year ago

Try copying the files into the sysroot.

Closing, as this does not appear to be an issue with the toolchain.