Building PPC EABI without "-mno-eabi -mrelocatable-lib"?

Sergei Organov
Thu Jul 7 08:52:00 GMT 2005

Darin Johnson <> writes:
> Is there an easy way to build for "powerpc-*-eabi" so that the
> "-mno-eabi -mrelocatable-lib" options are not enabled?  Ie,
> this is for a statically linked and unrelocatable system, and
> I don't want a large GOT2 table.
> I can see how to patch libgloss and newlib to do this, but I'd have
> to redo this for every release.   Having non-relocatable embedded
> PPC systems is very common, so I suspect there may be a config
> option that I'm missing.

The problem is that gcc internal libraries are still compiled with the
options you don't like. Radical way to fix that is to replace contents
of the


in the GCC sources with something like this:

# PowerPC embedded support with gas.
# Build libgcc.a with different options.

MULTILIB_EXTRA_OPTS	= mno-relocatable mno-relocatable-lib mcall-sysv \
   msdata=none mstrict-align

and rebuild GCC. After that all the libraries that support multilib,
including newlib will be built with two option sets one of which
includes -meabi. I didn't manage to leave single variant as it seems to
be considered a "no-multilib" build and MULTILIB_EXTRA_OPTS aren't used.

Please be warned that in fact GCC is flawed on sysv/eabi when -msdata is
different from 'none'. The last version that works reasonably with
-msdata different from 'none' I know about is 2.95.2. For example, 4.0.x
is broken. There are corresponding bug reports filed to GCC bugzilla.


More information about the Newlib mailing list