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: Matias Fonzo <selk at dragora 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: Mon, 6 Nov 2017 15:38:49 -0300
- 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>
On Mon, 6 Nov 2017 10:30:14 -0800
Max Filippov <jcmvbkbc@gmail.com> 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 put this flag into CFLAGS and CXXFLAGS. The first question: is that
> the right place for it?
>
> The build process tries to build libcpp for the build system and it
> runs x86_64 gcc with that xtensa-specific option. That's where the
> build breaks for me, because the option is not recognized by the
> build gcc. Is it supposed to work?
>
> If CFLAGS/CXXFLAGS is the right place for the option, how can the
> build tell whether it's intended for the build or for the host?
GCC has $CFLAGS_FOR_BUILD and $CFLAGS_FOR_TARGET.