This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: CFLAGS for the host in canadian cross build
- From: Waldemar Brodkorb <wbx at openadk dot org>
- To: Max Filippov <jcmvbkbc at gmail dot com>
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Wed, 8 Nov 2017 06:57:17 +0100
- Subject: Re: CFLAGS for the host in canadian cross build
- Authentication-results: sourceware.org; auth=none
- References: <CAMo8BfJ+ysnwnBZ6a_PEtS2ziEtb5P=miLJpR9=a_qZwS=GdtQ@mail.gmail.com>
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