This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question about CFLAGS/CXXFLAGS when building GCC


> I am building a cross GCC (targeting MIPS) on an x86-64 Linux system but I
> want to build the compiler as a 32 bit executable.  I thought the right way
> to do this was to do:
> 
> export CFLAGS='-O2 -g -m32'
> export CXXFLAGS-'-O2 -g -m32'
> 
> before running configure and make.
> 
> This is working in that it created cc1 as a 32 bit executable like I wanted
> it to but when the build continues and builds libgcc, it uses CFLAGS when
> it is using the newly built gcc to compile libgcc.

The usual way to do this is to set CC and CXX at the configure stage:

CC="gcc -m32" CXX="g++ -m32" $(srcdir)/configure ...

-- 
Eric Botcazou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]