cross armhf tangle
Hal Murray
halmurray at sonic.net
Tue Feb 4 09:04:55 UTC 2025
>>> Oh, now I have context. The only extra code for cross builds would
>>> be the --march. When you use --march then /usr/include/sys may not
>>> be used for <sys/time.h>. cc swaps sys directory to one approriate
>>> to the target.
>> Are you sure of that?
> 100%
I don't have a cross build setup working yet.
It looks to me like the CI stuff uses the same headers from /usr/include/.
Looking in the header files, they are doing a lot of ifdefs on symbols
that come from the compiler. It sure looks to me like the same headers
will work on both normal and cross builds.
The thing that started this for me was a long long where I expected a
long, and that hapened while cross compiling on a system where non-cross
worked OK. Digging deeper, I found some #if-s.
There are a few header file provided by the compiler. For example, locate
finds thee:
/usr/include/c++/13/tr1/stdbool.h
/usr/include/c++/14/tr1/stdbool.h
/usr/lib/gcc-cross/arm-linux-gnueabihf/14/include/stdbool.h
/usr/lib/gcc/x86_64-linux-gnu/11/include/stdbool.h
/usr/lib/gcc/x86_64-linux-gnu/12/include/stdbool.h
/usr/lib/gcc/x86_64-linux-gnu/13/include/stdbool.h
/usr/lib/gcc/x86_64-linux-gnu/14/include/stdbool.h
/usr/lib/llvm-14/lib/clang/14.0.6/include/stdbool.h
/usr/lib/llvm-15/lib/clang/15.0.7/include/stdbool.h
/usr/lib/llvm-16/lib/clang/16/include/stdbool.h
/usr/lib/llvm-18/lib/clang/18/include/stdbool.h
/usr/lib/llvm-19/lib/clang/19/include/stdbool.h
There are a whole bunch of header files in /usr/lib/gcc/x86_64-linux-gnu/14
/include/
Most of them I don't recognize.
So I guess we are both right.
That's really only half-cross. You are building the same distro and
version, just another march. If you want to build, say, say FreeBSD, on a
Linux box you would need different headers.
You also have to get libraries that are built for the target arch.
--
These are my opinions. I hate spam.
More information about the devel
mailing list