public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Arm and big endian
@ 2004-05-18 14:11 Pierre Habraken
  2004-05-18 15:09 ` Ian Lance Taylor
  0 siblings, 1 reply; 3+ messages in thread
From: Pierre Habraken @ 2004-05-18 14:11 UTC (permalink / raw)
  To: gcc-help

Having browsed the archive of the list, I know that a lot of questions
around this subject were posted in the past, but I did not found any
clear answer to the problem I am faced to :

I want to compile gcc and newlib so that big endian code is generated
for newlib (this is for teaching purpose).

Though I understand that multilib is activated by default, I do not need
the multilib option since I want 32 bits and big endian code only.

The configure doc. (in INSTALL dir.) says that there is an option for
disabling biendian (BTW, does here "bi" mean "big" or "bi-" ?...), but
nothing for enabling it.

I tried --enable-biendian : configure does not complain about it but
apparently does not take it in account.

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) ?

Thanks a lot in advance for any help !

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Arm and big endian
  2004-05-18 14:11 Arm and big endian Pierre Habraken
@ 2004-05-18 15:09 ` Ian Lance Taylor
  2004-05-24 12:20   ` Pierre Habraken
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Lance Taylor @ 2004-05-18 15:09 UTC (permalink / raw)
  To: Pierre Habraken; +Cc: gcc-help

Pierre Habraken <Pierre.Habraken@imag.fr> writes:

> I want to compile gcc and newlib so that big endian code is generated
> for newlib (this is for teaching purpose).
> 
> Though I understand that multilib is activated by default, I do not need
> the multilib option since I want 32 bits and big endian code only.
> 
> The configure doc. (in INSTALL dir.) says that there is an option for
> disabling biendian (BTW, does here "bi" mean "big" or "bi-" ?...), but
> nothing for enabling it.
> 
> I tried --enable-biendian : configure does not complain about it but
> apparently does not take it in account.
> 
> 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.

Ian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Arm and big endian
  2004-05-18 15:09 ` Ian Lance Taylor
@ 2004-05-24 12:20   ` Pierre Habraken
  0 siblings, 0 replies; 3+ messages in thread
From: Pierre Habraken @ 2004-05-24 12:20 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-05-24 12:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-18 14:11 Arm and big endian Pierre Habraken
2004-05-18 15:09 ` Ian Lance Taylor
2004-05-24 12:20   ` Pierre Habraken

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).