public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Which libgcc?
@ 2000-02-04  8:48 Kenneth Porter
  2000-02-04 10:59 ` [ECOS] " Bart Veer
  0 siblings, 1 reply; 8+ messages in thread
From: Kenneth Porter @ 2000-02-04  8:48 UTC (permalink / raw)
  To: eCos Discuss

I'm learning to drive gcc (under NT4) and I've gotten to the point
where I'm learning how to link. I've figured out that I need to link
with libgcc to provide the compiler support functions, but the
ecosSWtools directory contains 10 different instances of libgcc.a, all
under

ecosSWtools-990319\H-i586-cygwin32\lib\gcc-lib\powerpc-eabi\2.9-ecosSWto
ols-990319

libgcc.a
\ca\libgcc.a
\le\libgcc.a
\le\ca\libgcc.a
\lin\libgcc.a
\nof\libgcc.a
\nof\ca\libgcc.a
\nof\le\libgcc.a
\nof\le\ca\libgcc.a
\sol\libgcc.a

What are the differences between these? Where do I find this
documented?

Kenneth Porter
Kensington Laboratories, Inc.
mailto:kenneth_porter@kensingtonlabs.com
http://www.kensingtonlabs.com


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

* [ECOS] Re: Which libgcc?
  2000-02-04  8:48 [ECOS] Which libgcc? Kenneth Porter
@ 2000-02-04 10:59 ` Bart Veer
  2000-02-04 11:13   ` [ECOS] " Kenneth Porter
  2000-02-04 11:16   ` [ECOS] " Andrew Lunn
  0 siblings, 2 replies; 8+ messages in thread
From: Bart Veer @ 2000-02-04 10:59 UTC (permalink / raw)
  To: kenneth_porter; +Cc: ecos-discuss

>>>>> "Kenneth" == Kenneth Porter <kenneth_porter@kensingtonlabs.com> writes:

    Kenneth> I'm learning to drive gcc (under NT4) and I've gotten to
    Kenneth> the point where I'm learning how to link. I've figured
    Kenneth> out that I need to link with libgcc to provide the
    Kenneth> compiler support functions, but the ecosSWtools directory
    Kenneth> contains 10 different instances of libgcc.a, all under

    Kenneth> ecosSWtools-990319\H-i586-cygwin32\lib\gcc-lib\powerpc-eabi\2.9-ecosSWto
    Kenneth> ols-990319

    Kenneth> libgcc.a
    Kenneth> \ca\libgcc.a
    Kenneth> \le\libgcc.a
    Kenneth> \le\ca\libgcc.a
    Kenneth> \lin\libgcc.a
    Kenneth> \nof\libgcc.a
    Kenneth> \nof\ca\libgcc.a
    Kenneth> \nof\le\libgcc.a
    Kenneth> \nof\le\ca\libgcc.a
    Kenneth> \sol\libgcc.a

    Kenneth> What are the differences between these? Where do I find
    Kenneth> this documented?

You have discovered something called multilibs, which I am afraid is
one of the more obscure aspects of the compiler. A given gcc
executable, say for the PowerPC architecture, can cope with some
variations of that architecture. For example it can generate code for
either little-endian or big-endian mode, there is no need to build two
separate compilers. Such variations require slightly different
libgcc.a support libraries, so libgcc.a is multilibbed.

Of the list you give, I suspect that "ca" is related to System V.4
calling conventions; "le" controls endianness; "nof" indicates no
hardware floating point support; I am not sure about "sol" about
"lin", probably something to do with Solaris and Linux respectively.
So if you are generating little-endian executables for a PowerPC
variant which does not have hardware floating-point, you will want
\nof\le\libgcc.a

Fortunately you do not need to know about any of this because the
compiler will pick up the right version automatically - as long as you
do not confuse it. The basic rule is that you need to use compatible
flags when compiling and linking. If you specify a particular
processor variant at compile-time, e.g. -mcpu=860, then specify the
same cpu at link-time. If you want little-endian code specify -mlittle
at both compile and link time. As long as you remember this the
compiler will just do the right thing.

There may be some more detailed information about multilibs in the
compiler documentation, but a quick search did not reveal anything
obvious. If anybody wants to know more then the gcc mailing list would
probably be the right forum. Archives are available at:
http://gcc.gnu.org/ml/gcc/

Bart Veer // eCos net maintainer

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

* [ECOS] Which libgcc?
  2000-02-04 10:59 ` [ECOS] " Bart Veer
@ 2000-02-04 11:13   ` Kenneth Porter
  2000-02-04 11:22     ` Andrew Lunn
  2000-02-04 12:15     ` Jonathan Larmour
  2000-02-04 11:16   ` [ECOS] " Andrew Lunn
  1 sibling, 2 replies; 8+ messages in thread
From: Kenneth Porter @ 2000-02-04 11:13 UTC (permalink / raw)
  To: ecos-discuss

On Fri, 4 Feb 2000 18:58:10 GMT, Bart Veer wrote:

> You have discovered something called multilibs, which I am afraid is
> one of the more obscure aspects of the compiler.

I immediately knew what I was looking at, as DOS/Windows/OS/2 compilers
have been doing this all along to support different memory models,
presence/absence of threads, static vs. dynamic link, etc. I  just
didn't know what the magic directories meant. In the non-gcc world, the
different libraries have different things concatenated to their names,
instead of having the same name but in different subdirectories.

> Of the list you give, I suspect that "ca" is related to System V.4
> calling conventions; "le" controls endianness; "nof" indicates no
> hardware floating point support; I am not sure about "sol" about
> "lin", probably something to do with Solaris and Linux respectively.

Yeah, I figured much the same. I think I want the one in the top of the
nof tree.

> Fortunately you do not need to know about any of this because the
> compiler will pick up the right version automatically - as long as you
> do not confuse it. The basic rule is that you need to use compatible
> flags when compiling and linking.

I guess my question really amounts to what to put in the -L flag. I
need to tell ld where to look for libgcc.a, and I don't know if I
specify a directory higher up the tree or the specific subdirectory for
the architecture I'm building to.

> There may be some more detailed information about multilibs in the
> compiler documentation, but a quick search did not reveal anything
> obvious. If anybody wants to know more then the gcc mailing list would
> probably be the right forum. Archives are available at:
> http://gcc.gnu.org/ml/gcc/

Will do. I'll also try the gnu.gcc.help newsgroup. I'm kinda unsure
where the best place to ask about cross-compilers is, whether there's
more knowledge here on the eCos list or over on the gcc list, as I
expect the gcc list would deal more with native compilers on Unix
systems.

[No need to cc a reply to me; I'm happy reading it on the list.]

Kenneth Porter
Kensington Laboratories, Inc.
mailto:kenneth_porter@kensingtonlabs.com
http://www.kensingtonlabs.com


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

* Re: [ECOS] Re: Which libgcc?
  2000-02-04 10:59 ` [ECOS] " Bart Veer
  2000-02-04 11:13   ` [ECOS] " Kenneth Porter
@ 2000-02-04 11:16   ` Andrew Lunn
  2000-02-04 12:10     ` Jonathan Larmour
  1 sibling, 1 reply; 8+ messages in thread
From: Andrew Lunn @ 2000-02-04 11:16 UTC (permalink / raw)
  To: bartv; +Cc: kenneth_porter, ecos-discuss

> Fortunately you do not need to know about any of this because the
> compiler will pick up the right version automatically - as long as you
> do not confuse it. 

Maybe im confused :-)

I configure and build the arm-elf compiler with multilibs
disabled. There is an option you can give to it to do this. I've not
had problems build eCos binaries. I belive Jifl said that the miltilib
libraries not used for eCos.

        Andrew

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

* Re: [ECOS] Which libgcc?
  2000-02-04 11:13   ` [ECOS] " Kenneth Porter
@ 2000-02-04 11:22     ` Andrew Lunn
  2000-02-04 12:11       ` Kenneth Porter
  2000-02-04 12:15     ` Jonathan Larmour
  1 sibling, 1 reply; 8+ messages in thread
From: Andrew Lunn @ 2000-02-04 11:22 UTC (permalink / raw)
  To: kenneth_porter; +Cc: ecos-discuss

> I guess my question really amounts to what to put in the -L flag. I
> need to tell ld where to look for libgcc.a

This may be a silly question, but why do you need to tell gcc where to
look for libgcc.a? I never do.

I just link with -L{ecos-work-dir}/install/lib -Ttarget.ld -nostdlib

        Andrew

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

* Re: [ECOS] Re: Which libgcc?
  2000-02-04 11:16   ` [ECOS] " Andrew Lunn
@ 2000-02-04 12:10     ` Jonathan Larmour
  0 siblings, 0 replies; 8+ messages in thread
From: Jonathan Larmour @ 2000-02-04 12:10 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: bartv, kenneth_porter, ecos-discuss

Andrew Lunn wrote:
> 
> > Fortunately you do not need to know about any of this because the
> > compiler will pick up the right version automatically - as long as you
> > do not confuse it.
> 
> Maybe im confused :-)
> 
> I configure and build the arm-elf compiler with multilibs
> disabled. There is an option you can give to it to do this. I've not
> had problems build eCos binaries. I belive Jifl said that the miltilib
> libraries not used for eCos.

Ooh, no, I would never have said that :-). You may be thinking of
libio/newlib/libstdc++ etc. which aren't used by eCos at all. And for libgcc
you can certainly remove some of the multilib permutations that you know you
won't need, e.g. for recent arm-elf toolchains you can configure with any of
--disable-fpu, --disable-26bit, --disable-underscore, --disable-biendian and
possibly others.

Or you can hack gcc/config/arm/t-arm-elf to set up the multilibs you really
want.

For most users, I would recommend just building all the libgcc multilibs -
they aren't big enough to be a problem.

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

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

* Re: [ECOS] Which libgcc?
  2000-02-04 11:22     ` Andrew Lunn
@ 2000-02-04 12:11       ` Kenneth Porter
  0 siblings, 0 replies; 8+ messages in thread
From: Kenneth Porter @ 2000-02-04 12:11 UTC (permalink / raw)
  To: ecos-discuss

On Fri, 4 Feb 2000 20:22:21 +0100 (MET), Andrew Lunn wrote:

> > I guess my question really amounts to what to put in the -L flag. I
> > need to tell ld where to look for libgcc.a
> 
> This may be a silly question, but why do you need to tell gcc where to
> look for libgcc.a? I never do.
> 
> I just link with -L{ecos-work-dir}/install/lib -Ttarget.ld -nostdlib

Hadn't even thought to try it. I just figured that since it wasn't in
.../install/lib, that I needed to say where it was. It didn't occur to
me that ld would have that path compiled in. I'll give it a shot.

Kenneth Porter
Kensington Laboratories, Inc.
mailto:kenneth_porter@kensingtonlabs.com
http://www.kensingtonlabs.com


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

* Re: [ECOS] Which libgcc?
  2000-02-04 11:13   ` [ECOS] " Kenneth Porter
  2000-02-04 11:22     ` Andrew Lunn
@ 2000-02-04 12:15     ` Jonathan Larmour
  1 sibling, 0 replies; 8+ messages in thread
From: Jonathan Larmour @ 2000-02-04 12:15 UTC (permalink / raw)
  To: Kenneth Porter; +Cc: ecos-discuss

Kenneth Porter wrote:
> I guess my question really amounts to what to put in the -L flag. I
> need to tell ld where to look for libgcc.a, and I don't know if I
> specify a directory higher up the tree or the specific subdirectory for
> the architecture I'm building to.

You shouldn't need to. It should be in default link path already, and
target.ld contains the directive "GROUP(libtarget.a libgcc.a)" which means
you don't need to specify -ltarget -lgcc on the link line either.

> Will do. I'll also try the gnu.gcc.help newsgroup. I'm kinda unsure
> where the best place to ask about cross-compilers is, whether there's
> more knowledge here on the eCos list or over on the gcc list, as I
> expect the gcc list would deal more with native compilers on Unix
> systems.

Many people who deal with cross-compilers (myself included) read the gcc
list, so don't worry on that front. There's also
crossgcc@sourceware.cygnus.com. Go to http://sourceware.cygnus.com/ml/ for
info on how to subscribe.

Jifl
-- 
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS  Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow."  ||  These opinions are all my own fault

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

end of thread, other threads:[~2000-02-04 12:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-04  8:48 [ECOS] Which libgcc? Kenneth Porter
2000-02-04 10:59 ` [ECOS] " Bart Veer
2000-02-04 11:13   ` [ECOS] " Kenneth Porter
2000-02-04 11:22     ` Andrew Lunn
2000-02-04 12:11       ` Kenneth Porter
2000-02-04 12:15     ` Jonathan Larmour
2000-02-04 11:16   ` [ECOS] " Andrew Lunn
2000-02-04 12:10     ` Jonathan Larmour

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