Quote:
Originally Posted by geekmaster
I built a lenny.ext3 from scratch (using his debootstrap intructions). I loop mounted it and did a qemu-static ch to it from my x86 linux mint. I installed build-essentials for architecture armeabi. I build a hello.c with "gcc -march=arm5te -o hello hello.c". It does not work, just like all the others.
Dynamic shared lib executables say "not found" when executed. Static builds seg fault. Just like always. I wonder if "not found" means it tried to run but could not find some library?
|
This sounds like the ELF interpreter, which is named in the PT_INTERP segment: libcs use this to name their dynamic linker, and uclibc and glibc are very much *not* compatible in this respect. Indeed, even the toolchains are not compatible: you must build a cross-compiler from *-gnu to *-uclibc if everything is to work (though mostly the failures would be in things like C++ exception handling, which you probably don't care about). Linking with -static would avoid all these problems, but would still give you static binaries linked against glibc, which would be huge: you want to use a cross-compiler to uclibc if you possibly can.
You almost certainly want to exploit the sysroot feature, if you can manage to use a new-enough compiler (which you probably can): <https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html>. This lets you drop a mini-root-directory full of libraries and headers and have GCC just use it and avoid ever using the libraries and headers on your build machine.
GCC still has ARMv5 support, so you should not need to use an ancient compiler: a new toolchain should work fine, as long as you stick with whatever ancient uclibc the K1 is using.