This is the mail archive of the
mailing list for the binutils project.
Re: Passing AM_CFLAGS to CC_FOR_BUILD compiler leads to errors when cross-compiling
- From: Nick Clifton <nickc at redhat dot com>
- To: Vlad Zakharov <Vladislav dot Zakharov at synopsys dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>
- Cc: Eugeniy Paltsev <Eugeniy dot Paltsev at synopsys dot com>, "amodra at gmail dot com" <amodra at gmail dot com>, Alexey Brodkin <Alexey dot Brodkin at synopsys dot com>, "amodra at bigpond dot net dot au" <amodra at bigpond dot net dot au>, Anton Kolesov <Anton dot Kolesov at synopsys dot com>, "hongjiu dot lu at intel dot com" <hongjiu dot lu at intel dot com>
- Date: Fri, 19 Aug 2016 14:04:28 +0100
- Subject: Re: Passing AM_CFLAGS to CC_FOR_BUILD compiler leads to errors when cross-compiling
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org>
> cc1: error: unrecognized command line option "-Wstack-usage=262144"
> $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(NO_WERROR) sysinfo.c ; \
> AM_CFLAGS = $(WARN_CFLAGS) $(ZLIBINC)
Have you tried configuring the toolchain with --enable-build-warnings=no ?
> So solutions could be either to have WARN_CFLAGS_FOR_BUILD or AM_CLFLAGS_FOR_BUILD
> variable with corresponding options and verify CC_FOR_BUILD to be compatible with
> such options
Hmm, I think that I would prefer this option. Using both variables. Ie compute
WARN_CFLAGS_FOR_BUILD and assign it to AM_CFLAGS_FOR_BUILD along with ZLIBINC.
> or just not to use AM_FLAGS with CC_FOR_BUILD compiler at all
> as AM_FLAGS seems to be compatible only with CC compiler.
I think that this is not a good idea as there may be important options in AM_CFLAGS
which are really needed. For example the ZLIBINC flags.
> Any ideas or suggestions?
Would you like to create a patch as outlined above ? My concern however is that
you may not be able to use the AC_EGREP_CPP macro. Possibly you can override the
definition of ac_cpp that is being used, or maybe there is another macro that you
can use instead.