public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* compiling gcc for multiple targets?
@ 2004-03-31  8:17 Carl B. Constantine
  2004-03-31 11:40 ` Ian Lance Taylor
  2004-03-31 19:36 ` Ken Wolcott
  0 siblings, 2 replies; 4+ messages in thread
From: Carl B. Constantine @ 2004-03-31  8:17 UTC (permalink / raw)
  To: gcc-help

I've done a google search on this, but most of the information I found
was old and the crossgcc list no longer exists, so I thought I would
bring it up again.

Is there any way to compile gcc and related utils (binutils, gdb) for
multiple targets in one binary? So I want to compile it to support both
Solaris intel and m68hc11 in one gcc instead of having separate binaries
for each?

If I cannot do this, but have to compile separate versions
(--program-prefix=m6811-elf) are there any issues wrt to libraries if
they are installed to the same place? libiberty.so for example?

Thanks in advance.

-- 
Carl B. Constantine         University of Victoria
Programmer Analyst          http://www.csc.uvic.ca
UNIX System Administrator   Victoria, BC, Canada
cconstan@csc.uvic.ca        ELW A248, 721-8766

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

* Re: compiling gcc for multiple targets?
  2004-03-31  8:17 compiling gcc for multiple targets? Carl B. Constantine
@ 2004-03-31 11:40 ` Ian Lance Taylor
  2004-03-31 19:36 ` Ken Wolcott
  1 sibling, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2004-03-31 11:40 UTC (permalink / raw)
  To: Carl B. Constantine; +Cc: gcc-help

"Carl B. Constantine" <cconstan@csc.uvic.ca> writes:

> Is there any way to compile gcc and related utils (binutils, gdb) for
> multiple targets in one binary? So I want to compile it to support both
> Solaris intel and m68hc11 in one gcc instead of having separate binaries
> for each?

For gcc, no.  For gas and gdb, sometimes.  For the binutils and ld,
yes (use --enable-targets).

> If I cannot do this, but have to compile separate versions
> (--program-prefix=m6811-elf) are there any issues wrt to libraries if
> they are installed to the same place? libiberty.so for example?

libiberty.so is target independent, so it is safe to install the
libiberty.so for multiple targets in the same place.  The target
libraries, such as libstdc++-v3, will by default be installed in
directories whose names depend upon the target, so they should not
ordinarily cause any conflicts.  You should avoid building a shared
libbfd.so, as it will be target-dependent; that is, do not configure
the GNU binutils with --enable-shared.

Ian

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

* Re: compiling gcc for multiple targets?
  2004-03-31  8:17 compiling gcc for multiple targets? Carl B. Constantine
  2004-03-31 11:40 ` Ian Lance Taylor
@ 2004-03-31 19:36 ` Ken Wolcott
  2004-04-01  6:40   ` Bernd Jendrissek
  1 sibling, 1 reply; 4+ messages in thread
From: Ken Wolcott @ 2004-03-31 19:36 UTC (permalink / raw)
  To: Carl B. Constantine; +Cc: gcc-help, crossgcc

Hi Carl;

  You must be mistaken about the crossgcc mailing list.  I am a
subscriber and there is recent traffic and there are some very *nice*,
*helpful* and *knowledgeable* subscribers.  There is also crosstool
(http://www.kegel.com/crosstool/), a very nice tool written by Dan
Kegel, that might help you, I'm not sure.

http://sources.redhat.com/ml/crossgcc/
crossgcc@sources.redhat.com

Ken

On Tue, 2004-03-30 at 17:20, Carl B. Constantine wrote:
> I've done a google search on this, but most of the information I found
> was old and the crossgcc list no longer exists, so I thought I would
> bring it up again.
> 
> Is there any way to compile gcc and related utils (binutils, gdb) for
> multiple targets in one binary? So I want to compile it to support both
> Solaris intel and m68hc11 in one gcc instead of having separate binaries
> for each?
> 
> If I cannot do this, but have to compile separate versions
> (--program-prefix=m6811-elf) are there any issues wrt to libraries if
> they are installed to the same place? libiberty.so for example?
> 
> Thanks in advance.


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

* Re: compiling gcc for multiple targets?
  2004-03-31 19:36 ` Ken Wolcott
@ 2004-04-01  6:40   ` Bernd Jendrissek
  0 siblings, 0 replies; 4+ messages in thread
From: Bernd Jendrissek @ 2004-04-01  6:40 UTC (permalink / raw)
  To: Ken Wolcott; +Cc: Carl B. Constantine, gcc-help, crossgcc

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, Mar 31, 2004 at 09:46:30AM -0600, Ken Wolcott wrote:
> On Tue, 2004-03-30 at 17:20, Carl B. Constantine wrote:
> > I've done a google search on this, but most of the information I found
> > was old and the crossgcc list no longer exists, so I thought I would
> > bring it up again.

So who's writing all these replies, then?  :)

> > Is there any way to compile gcc and related utils (binutils, gdb) for
> > multiple targets in one binary? So I want to compile it to support both
> > Solaris intel and m68hc11 in one gcc instead of having separate binaries
> > for each?

binutils can be configured with --enable-targets=all, and I use a such
configured binutils daily without problems.  But don't be fooled: it
just configured the BFD and opcodes libraries to *support* all targets
binutils knows; the tools still default to the --target=foo with which
you configured the tools.  And gas (the assembler) cannot generate code
for any other target than the one specified with --target=foo.

GCC supports only one target at a time, but I think if someone wanted to
put in the work, it'd be not-all-that-hard (for a competent hacker) to
make it possible to use multiple backends.  The actual compiler, cc1,
lives in its own target-specific directory, so at a minimum you'd just
need to re-teach the compiler driver (gcc) to find different compilers
again (if it can't still do this - the man page seems to say it can).

More interesting would be if GCC would install a libbackend.so (GPL'ed
and with an undocumented API, of course, to avoid all that
GPL-subversive intermediate-representation stuff) against which a
target-neutral compiler is linked.  And if you watch your namespaces
properly, and hookify  all the target macros, you might get a
libbackend.so that can be configured with --enable-targets=all.

> > If I cannot do this, but have to compile separate versions
> > (--program-prefix=m6811-elf) are there any issues wrt to libraries if
> > they are installed to the same place? libiberty.so for example?

I have binutils configured with --enable-targets=all, and the resulting
libbfd.so and libopcodes.so live in /usr/lib.  I use it daily.

Hmm, no, you'd have to install target libraries (libiberty.{a,so}) to
different places.

- -- 
"IBM has more patent litigation lawyers than SCO has employees." - unknown
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFAa7gb/FmLrNfLpjMRAqWBAJ4s9TJnc1rq7byIWMpl42lSuoIsIACgknmk
OexGgbdiG4+flo1CJk+JUeI=
=1lzi
-----END PGP SIGNATURE-----

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

end of thread, other threads:[~2004-04-01  6:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-31  8:17 compiling gcc for multiple targets? Carl B. Constantine
2004-03-31 11:40 ` Ian Lance Taylor
2004-03-31 19:36 ` Ken Wolcott
2004-04-01  6:40   ` Bernd Jendrissek

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