public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Cross Compilation Problem
@ 2000-01-05 21:45 ebony5146
  2000-04-01  0:00 ` ebony5146
  0 siblings, 1 reply; 5+ messages in thread
From: ebony5146 @ 2000-01-05 21:45 UTC (permalink / raw)
  To: help-gcc

Hi everybody,
I am new to Linux environment and was trying to cross compile binutils.
The compilation proceeds properly and I do get all the binutils. But
when I try to compile the "hello world" code I get an error stdio not
found. I preprocess the file,the file was being searced in sys-include
directory. I would like to know when this is made in the process of
cross-compilation.



Sent via Deja.com http://www.deja.com/
Before you buy.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Cross Compilation Problem
  2000-01-05 21:45 Cross Compilation Problem ebony5146
@ 2000-04-01  0:00 ` ebony5146
  0 siblings, 0 replies; 5+ messages in thread
From: ebony5146 @ 2000-04-01  0:00 UTC (permalink / raw)
  To: help-gcc

Hi everybody,
I am new to Linux environment and was trying to cross compile binutils.
The compilation proceeds properly and I do get all the binutils. But
when I try to compile the "hello world" code I get an error stdio not
found. I preprocess the file,the file was being searced in sys-include
directory. I would like to know when this is made in the process of
cross-compilation.



Sent via Deja.com http://www.deja.com/
Before you buy.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cross compilation problem
  2012-03-26 20:50 ` Ian Lance Taylor
@ 2012-03-27  6:30   ` Alexey Umnov
  0 siblings, 0 replies; 5+ messages in thread
From: Alexey Umnov @ 2012-03-27  6:30 UTC (permalink / raw)
  To: gcc-help

>> The problem is that the tools that is being built are not 32bit
>> executables, they are rather 64bit (ELF 64-bit LSB executable,
>> x86-64). This is not what I expected because of
>> "--with-host=i386-linux-gnu" parameter which as far as I understand
>> tells the build system to build a compiler that runs on 32bit linux
>> machine.
>
> Specifying --with-host tells the build system that the resulting
> executables should run on that host.  However, you also have to provide
> a compiler that generates executables that run on that host.  If you
> don't, the configure script will try to find such a compiler.  In your
> case it appears to be getting it wrong.
>
> I would recommend passing BOOT_CFLAGS=-m32 when you run configure and/or
> make.
>
> Ian

Thank You!
I tried to add following parameters and they helped:
--disable-bootstrap CFLAGS=-m32
I also added CFLAGS=-m32 to "make" command just in case
I don't know what exactly made such an effect but the problem is
solved now. Thank You!
----------------------------
Best regards!

Alexey Umnov
umnoff@gmail.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Cross compilation problem
  2012-03-26 12:25 Cross compilation problem Alexey Umnov
@ 2012-03-26 20:50 ` Ian Lance Taylor
  2012-03-27  6:30   ` Alexey Umnov
  0 siblings, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 2012-03-26 20:50 UTC (permalink / raw)
  To: Alexey Umnov; +Cc: gcc-help

Alexey Umnov <umnoff@gmail.com> writes:

> The problem is that the tools that is being built are not 32bit
> executables, they are rather 64bit (ELF 64-bit LSB executable,
> x86-64). This is not what I expected because of
> "--with-host=i386-linux-gnu" parameter which as far as I understand
> tells the build system to build a compiler that runs on 32bit linux
> machine.

Specifying --with-host tells the build system that the resulting
executables should run on that host.  However, you also have to provide
a compiler that generates executables that run on that host.  If you
don't, the configure script will try to find such a compiler.  In your
case it appears to be getting it wrong.

I would recommend passing BOOT_CFLAGS=-m32 when you run configure and/or
make.

Ian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Cross compilation problem
@ 2012-03-26 12:25 Alexey Umnov
  2012-03-26 20:50 ` Ian Lance Taylor
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey Umnov @ 2012-03-26 12:25 UTC (permalink / raw)
  To: gcc-help

Dear all!
I'm trying to build a cross-compiler.
My build machine is 64bit linux (Ubuntu 11.10).
Here is the configuration command:
../configure --prefix=$PREFIX --target=arm-linux-androideabi
--with-sysroot=$SYSROOT --with-host=i386-linux-gnu --with-gnu-as
--with-gnu-ld --enable-languages=c,c++ --disable-sjlj-exceptions
--disable-libssp --enable-threads --disable-nls --disable-libmudflap
--disable-shared --disable-tls --with-float=soft --with-fpu=vfp
--with-arch=armv5te --enable-target-optspace --enable-initfini-array

After that I run usual "make"

The problem is that the tools that is being built are not 32bit
executables, they are rather 64bit (ELF 64-bit LSB executable,
x86-64). This is not what I expected because of
"--with-host=i386-linux-gnu" parameter which as far as I understand
tells the build system to build a compiler that runs on 32bit linux
machine.
Actually I have the toolchain built to be ran on 64bit linux. Now I
need a 32bit linux toolchain. To be more clear, I need a cross
compiler that is being built on 64bit linux, runs on 32bit linux and
produces binaries for android. I suppose the following parameters
should be set as following:
--with-build=x86_64-linux-gnu ( I suppose it's not necessary - will be
autodetected)
--with-host=i386-linux-gnu
--with-target=arm-linux-androideabi

But this doesn't work as I expect. What could be the mistake?
Thank You in advance!

----------------------------
Best regards!

Alexey Umnov
umnoff@gmail.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-27  6:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-05 21:45 Cross Compilation Problem ebony5146
2000-04-01  0:00 ` ebony5146
2012-03-26 12:25 Cross compilation problem Alexey Umnov
2012-03-26 20:50 ` Ian Lance Taylor
2012-03-27  6:30   ` Alexey Umnov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).