This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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: x86_64 with m32 support


Doug Reiland wrote:

Yes, I am porting my own Linux for x86_64. My "host" system is a Redhat 6.x based system. I have successfully created toolchains for ia64 and x86_64. However, I want the ability to compile apps, ... in my x86_64 crossbuild environment to use the -m32 option. Currrently, my env fails to link since the 32-bit libs didn't get built.

The simple solution is like a tandem, you will need to produce another toolchain to work as the another cyclist. First you should decide what the '-m32' should produce.. Ok, with the defaults the '-m32' should produce quite similar output as a 'athlon_xp-linux-gnu' targeted 32-bit toolchain. But SuSE's 32-bit libs are SuSE 9.0/x86 compatible, ie. tuned for i586 and their GCC probably activates the '-march=i586' with '-m32'...

 Using the 'x86_64-linux-gnu' targeted GCC for compiling a 32-bit glibc
can be tougher than one could expect, maybe changing the target name to
'athlon_xp-linux-gnu' or something could help...

 This same approach is the natural one with 'sparc/sparc64', 'mips/mips64',
'powerpc/powerpc64' etc., the 32-bit one and the 64-bit one are subsets in
the complete 64/32-bit toolchain. Producing the 64-bit toolchain gives only
the 64-bit libraries because the 32-bit ones are already available in the
another '32-bit only' toolchain... Of course every bi-arch builder wants
that 32-bit-only toolchain, if for nothing else then for serving as a
reference toolchain.

> Do I just configure, build, and install glibc a second time with another
> target option (i386) and the same --prefix as the first?

 Producing another cross-toolchain for what the '-m32' is wanted to be
could be one way, but with some workarounds using the 'x86_64' target
GCC with '-m32' to build a 32-bit glibc, could also succeed.  Using a
fake target name for the 32-bit mode could be possible... It has passed
months since I tried this and saw it being vain because I already had
a crosstoolchain for 'athlon_xp-linux-gnu' and symlinking its glibc to
the 'x86_64-linux-gnu' toolchain was easier than trying to reproduce the
existing with another GCC...  And in my case even having those self-built
glibcs wasn't motivated because I thought to simply purchase a
SuSE 9.0/x86_64 into the possibly soon bought Athlon64 based PC, ie. my
toolchain would be for producing apps into that 64-bit mode beforehands...
No dreams about producing my own Linux distro to compete with SuSE...

 Producing a cross-toolchain for something like SuSE 9.0/x86_64 in the
first place in my case would have been much easier but I experimented
with these tools long before the SuSE-distro appeared...

 Ok, using the same $prefix with two, ten, hundred or more cross-GCCs
should work always... But glibc is another thing, I could think the
right order being the 32-bit glibc first, then the 64-bit glibc because
the 64-bit includes probably will support both but 32-bit-only headers
only the 32-bit target...

Cheers, Kai


------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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