On Fri, 2013-11-22 at 13:48 -0800, H.J. Lu wrote:
> On Fri, Nov 22, 2013 at 1:24 PM, Steve Ellcey <sell...@mips.com> wrote:
> >
> > 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.  That is wrong because 
> > the
> > GCC compiler that I just built (targeting MIPS) does not understand the
> > -m32 flag and I don't want to override the options used when building the
> > libraries anyway, only the options used to build executables.
> >
> > Am I setting the wrong CFLAGS/CXXFLAGS variables?  Or is this a bug?
> >
> 
> Can you not touch CFLAGS/CXXFLAGS? Instead, you do
> 
> # CC="gcc -m32" CXX="g++ -m32" .../configure ....
> # make CC="gcc -m32" CXX="g++ -m32" ...

Doh.  I don't know why that didn't occur to me.  It should work
and that is what I will do.

Steve


Reply via email to