This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Arm and big endian
- From: Pierre Habraken <Pierre dot Habraken at imag dot fr>
- To: Ian Lance Taylor <ian at wasabisystems dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 24 May 2004 14:23:22 +0200
- Subject: Re: Arm and big endian
- Organization: Université Joseph Fourier
- References: <40AA1A03.C24308D8@imag.fr> <m3iset22vc.fsf@gossamer.airs.com>
Ian Lance Taylor wrote:
>
> > So my question is : What configure option I have to set up for
> > gcc in order to get newlib being cross-compiled to big endian code ?
> >
> > Has someone succeeded in doing that (with or without multilib
> > support) ?
>
> I don't think there is any way to do that without patching the source.
>
> It's easy to patch the source to make -mbig-endian the default: change
> the definition of TARGET_DEFAULT to include ARM_FLAG_BIG_END.
> TARGET_DEFAULT is defined in config/arm/*.h; the exact definition
> depends upon your target.
>
> It is only slightly more work to add support for --with-endian to
> config.gcc.
My goal is not to get -mbig-endian being the default. I just want that
whenever I link a big endian object file the proper big endian version
of newlib be coosen by gcc instead of the little endian default one.
I tried the trick suggested some time ago by Michael Butts in
http://sources.redhat.com/ml/newlib/2001/msg00561.html, i.e. changing
the setting of the MULTILIB_OPTIONS and MULTILIB_DIRNAMES variables in
gcc/Makefile, right after the configure stage.
The resulting build behaves as I expected.
The command arm-elf-gcc -print-multi-lib prints then:
.;
thumb;@mthumb
be;@mbig-endian
thumb/be;@mthumb@mbig-endian
Pierre
--
Pierre HABRAKEN - mailto:Pierre.Habraken@imag.fr
Tél: 04 76 82 72 83 - Fax: 04 76 82 72 87
IMAG-LSR BP72 38402 SAINT MARTIN D'HERES Cedex