Re: glibc configure: error: Need linker with .init_array/.fini_array support

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

 



jeffiedward wrote:
> 
> Hi,
> I'm new to the GNU tool building environment.

  The main gcc list is for questions about the coding design and internals of
the compiler itself; please send questions about how to *use* the compiler to
the gcc-help list.  (I've changed the Cc: line, please make sure any
follow-ups go there).

> I'm trying to build cross GCC for powerpc-linux platform.

> checking whether ranlib is necessary... /tmp/ccE5O0vD.s: Assembler messages:
> /tmp/ccE5O0vD.s:7: Error: Unrecognized opcode: `pushl'
> /tmp/ccE5O0vD.s:8: Error: Unrecognized opcode: `movl'
> /tmp/ccE5O0vD.s:9: Error: Unrecognized opcode: `popl'
> /tmp/ccE5O0vD.s:10: Error: Unrecognized opcode: `ret'

  Ok, what's happening here is that configure is using the x86 assembler when
it should be using the ppc cross-assembler.  Here's why:

> first-stage gcc:
> ---------------
> ../configure --target=powerpc-linux-gnu --prefix=/home/tellabs/GNU/PPC
> --disable-shared --disable-threads --enable-languages=c

  Here you configure your cross-compiler correctly.  It runs on the host
machine (your x86-linux machine that you're building on, since you didn't
specify any explicit --host) and generates code that runs on the --target
machine - the powerpc you're trying to cross-compile for.

> when i try to compile glibc, the following configuration error occurs:
> 
> ../configure CFLAGS=" -march=i686 -O2" --host=i686-pc-linux-gnu
> --target=powerpc-linux-gnu --prefix=/home/tellabs/GNU/PPC
> --with-headers=/home/tellabs/GNU/include
> --with-binutils=/home/tellabs/GNU/PPC/powerpc-linux-gnu/bin

  Right, it's a bit confusing, but you'll see if you think it through: when
you go to compile the library, you are no longer compiling something that
"runs on" your x86 machine, it runs on the powerpc machine; and since it's
just a library, it doesn't generate any code for anything at all, so the
concept of "target" means nothing to it.

  So when it comes to the library, that means that what /was/ the target for
the compiler and binutils now becomes the *host* for the library, and the
library has no target setting at all.  So try this instead:

> ../configure CFLAGS=" -march=i686 -O2" --host=powerpc-linux-gnu
> --prefix=/home/tellabs/GNU/PPC
> --with-headers=/home/tellabs/GNU/include
> --with-binutils=/home/tellabs/GNU/PPC/powerpc-linux-gnu/bin

    cheers,
      DaveK


[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