• Uncategorized

About linux : ld-cant-find-crtio-when-trying-to-build-libgcc-for-arm-unknown-linux-gnuabi

Question Detail

I’m currently trying to build a cross compiler toolchain to compile the linux kernel for aarch64 and everything worked fine until I tried building libgcc.

When running make all-target-libgcc I get the error /opt/cross/arm-unknown-linux-gnueabi/bin/ld: cannot find crti.o: no such file or directory. Same goes for ‘crtn.o’ and ‘-lc’.
I’ve searched the /opt/cross/lib dir for the files and could not find them, but I did come across the unassembled .S files in the gcc source directory (crti.S, ….).

The binaries also exist in /usr/lib but I’m assuming that’s irrelevant since those are x86-64.

What I’m wondering now is why the .S files in the gcc source dir (version 10.1.x) weren’t assembled into binaries and how I could change that.

Thank you in advance for any help

PS: I’ve found a similar post here on stack overflow about crti.o missing but that was unhelpful.

Question Answer

Seems my research was rather bad, you don’t actually need glibc / libgcc to cross compile the linux kernel.
I found this article which was very helpful if anyone is having a similar problem: https://gts3.org/2017/cross-kernel.html

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.