[GCC-XML] Re: [Bug 1812] Changed - a 64bit mode compiler ist built on x86_64 / 32bit mode

Johnny Casey jjcasey+gccxml at pobox.com
Mon May 2 16:00:32 EDT 2005


Andreas Degert wrote:
> phpbt at public.kitware.com writes:
> 
> 
>>----- Posted by brad.king at kitware.com at 7:54 PM on 05-01-2005 -----
>>GCC's build system (duplicated in GCC-XML's CMake listfile code)
>>distinguishes between host and target platform.  The configuration with
>>which GCC is built determines the host platform.  Runtime options to the
>>compiler determine the target platform.
>>
>>Try running "man gcc" on the machine and look for the section titled
>>"Intel 386 and AMD x86-64 Options".  There should be options like
>>-mcpu= and -march=.  GCC changes the sizes/alignments of its types
>>based on the target architecture.  I suspect these options can be
>>passed to gccxml to achieve the same result.  Since the machine is
>>64-bit I bet GCC is choosing 64-bit by default even though it was
>>built as a 32-bit executable.
> 
> 
> Yes, that's right. My understanding was that gcc would be built with
> the 32 bit target as default when its built on x86_64 running in 32
> bit mode (and if that is true the build system for gccxml should do
> the same).
> 
> To say it another way: I can build gccxml on i686 and run it in 32 bit
> mode on an amd64 (and it will have 32 bit as default target), but it
> seems I can't build such an executable on an amd64 in 32 bit mode
> (gccxml will have 64 bit as default target then). So perhaps what's
> missing is a way to set the default target in the build process (maybe
> there is such a way and I don't know enough about cmake).
> 
> I'll try to find out how the standard build process of gcc handles
> this.
> 
> ciao
> Andreas

My guess is that it just looks at the output of uname -m.

If you are using a Redhat distro, have you tried setarch?  It apparently
changes the environment so that uname -m returns i686 instead of x86_64...

HTH,
Johnny



More information about the gccxml mailing list