Re: unable to build gcc 4.9.0 for i686-elf target with posix threads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2014-07-02 at 16:36 +0300, Ragnar Rüütel wrote:
> Hi,
> 
> Thanks for the reply and I apologize for my ignorance.
> 
> On Wed, Jul 2, 2014 at 4:00 PM, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote:
> > What do you mean by "generic linux binaries"?
> > With no dependency on a C library?
> > Why do you need "i686-elf" rather than e.g. i686-unknown-linux-gnu ?
> > What are you actually trying to do in the end?
> 
> I need to create linux binaries of my tools that will run on any x86
> linux distribution. So I can compile them once and copy to other linux
> machines. As I understood i686-elf target should be best choice for
> this.

Then you are really using the wrong instructions!
The OSDEV Wiki is helpful for people writing binaries which run without
any operating system! No Linux, no OS at all, just bare metal.

What you need as Andrew says is a compiler targetting Linux : most
likely you can simply install one as a package. Perhaps 2 packages, one
for 32-bit and another for 64 bit (amd64) targets.

Then you need to learn to use it : building to run on any Linux distro,
you probably want to minimise dependence on shared libraries (.so files)
which may not be installed, or the wrong version, on the target system.
So learn to "statically link" your executables. They will be larger,
because they carry their dependencies instead of assuming things about
the distro.

If you DO decide to build your own gcc (targeting Linux), follow
instructions that use the "contrib/download_prerequisites" script. This
is the simplest way round troubles with gmp and friends.

- Brian






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux