This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Darin Johnson <chezdj@earthlink.net> 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

gcc/gcc/config/rs6000/t-ppcgas

in the GCC sources with something like this:

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

MULTILIB_OPTIONS	= meabi
MULTILIB_DIRNAMES	= eabi
MULTILIB_EXTRA_OPTS	= mno-relocatable mno-relocatable-lib mcall-sysv \
   msdata=none mstrict-align
MULTILIB_EXCEPTIONS	=
MULTILIB_MATCHES	= ${MULTILIB_MATCHES_FLOAT} \
			  ${MULTILIB_MATCHES_ENDIAN} \
			  ${MULTILIB_MATCHES_SYSV}


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.

-- 
Sergei.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]