[discuss] Problem building cross compiler for x86_64

Manish Katiyar mkatiyar@gmail.com
Sat Jan 21 07:12:00 GMT 2006

On 1/21/06, Kurt Roeckx <kurt@roeckx.be> wrote:
> The point of a "cross compiler" is that the "host" and "build"
> system are different.  In your case host seems to be a 32 bit
> i386, and build is x86_64/amd64.  This means all your compiler
> exectutables are 32 bit, but they generate 64 bit code.  So this
> far everything seems to be as it should.
  Sorry for asking so many stupid questions but i am really confused.
Let me tell u the exact requirement. Basically we are porting our
application to a 64 bit machine and we dont have a compiler for that
so all we want is to have a compiler on 64 bit machine so that our
build succeeds on 64 bit machines. Since I didn't have any prior idea
of doing this thing before and my manager asked me to develop a
compiler for it. As he used the term "cross compilation" while our
talk I searched through net and found that we can build a compiler for
64 bit machines on a 32 bit machine. This is the only info that i have
. My build system is a 32 bit RHEL-4 machine (Old SLES-9 32 bit
machine crashed while doing experiments :-( ) and my host(=target)
will be a 64bit x86_64 AMD64 machine. Please tell me the options i
have for fulfilling this requirement. Is it possible without doing any
cross compilation just using any switches for gcc. Please guide
me...and sorry again for asking silly questions. Thanks in advance

> Now with x86_64 and i386 we have a special combination in that
> the x86_64 kernel can also run i386 executables.  Why do you
> generate a cross compiler for 64 bit mode on a 32 bit host system
> if you want to run it on a 64 bit host anyway?
> I also don't see why someone would still like to create a cross
> compiler for this.
> Also note that gcc can actually build a biarch compiler, one that
> can generate both 32 and 64 bit code depending on the -m32 or
> -m64 switch.
> > SLESAMD64:/tmp # strace ./x86_64-unknown-linux-gnu-gcc
> > execve("./x86_64-unknown-linux-gnu-gcc",
> > ["./x86_64-unknown-linux-gnu-gcc"], [/* 51 vars */]) = 0
> > [ Process PID=21560 runs in 32 bit mode. ]
> > x86_64-unknown-linux-gnu-gcc: no input files
> This strace doesn't tell much, since it just generates an error
> message, it doesn't explain why it can't find cc1.
> There can be various problems, such as it really can't find the
> location of cc1.  That it's looking for cc1 with the wrong name,
> like it's looking for something called
> x86_64-unknown-linux-gnu-cc1 while it's really called
> x86_64-unknown-gnu-cc1 or something, looking in a different path
> than where it is, which you can work around with the -B switch,
> and things like that.
> Kurt

Thanks & Regards,
Manish Katiyar
Ozone 2, SP Infocity (Software Park),
New Survey #208 Manjari Stud Farms Ltd.,
Phursungi Village, Haveli Taluka, Saswad Road,
Hadapsar, Pune - 412308, India

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

More information about the crossgcc mailing list