CFLAGS for the host in canadian cross build
Waldemar Brodkorb
wbx@openadk.org
Wed Nov 8 05:57:00 GMT 2017
Hi Max,
Max Filippov wrote,
> Hello,
>
> I'm trying to build a canadian cross compiler with build == x86_64-linux,
> host == xtensa-linux and target == xtensa-linux. I need to specify an
> xtensa-specific flag in CFLAGS that will be applied to the host binary.
I think you are trying to build a cross-native, see
http://crosstool-ng.github.io/docs/toolchain-types/
Canadian-Cross is something like building a GCC compiler on Linux/x86_64,
which runs on Cygwin/x86_64 and compiles code for Linux/ppc.
> I put this flag into CFLAGS and CXXFLAGS. The first question: is that
> the right place for it?
No, it seems not.
The right thing to do is to set CC/CXX in the configure step and
append your specific CFLAGS/CXXFLAGS to it.
I tested (build-only) this with OpenADK building a cross-native for Linux/xtensa.
I needed to fix my package/gcc/Makefile for this, see:
https://gogs.waldemar-brodkorb.de/linux/openadk/commit/e7383dee0c3fc20a2752b13f21d0bb3f5988aad6
best regards
Waldemar
More information about the Gcc
mailing list