tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: libgcc not built?



Yann Sionneau writes:
> Hello Matthew,
> 
> Thanks for your answer :)
> 
> Is src/tools/gcc/README.mknative relevant for my cross compilation
> toolchain?

> Or only for a *native* (host=lm32 target=lm32) toolchain?

you need libgcc from somewhere.  typically that comes from
base netbsd, but for brand new ports with no in-tree help
it may come from the $EXTERNAL_TOOLCHAIN.  for new ports
using base gcc, we typically use libgcc built normally,
but if you don't want a host compiler, MKGCCCMDS=no is
supported (and default, on eg sun2.)

which compiler are you using?

> For now I am only building a cross toolchain and I don't plan on
> building a native one.
> 
> I'm trying to see how those parts plug together.
> 
> IIUC, the kernel only links with libkern and does not need libgcc (but
> some symbols which usually are in libgcc need to be put in libkern).

libkern implements the parts of libgcc that are required 
by the compiler itself -- run time routines for common
operations.  so typically we have to reimplement them in
libkern to use the compiler.
 
> For the user space the picture is a bit blury for me.
> 
> I guess I need to consider two cases: statically linked programs, and
> dynamically linked ones.

you'll need to deal with both eventually, but if you want
to just start with static for now that's an option.


.mrg.

> Thanks!
> 
> Regards,
> 
> Yann
> 
> Le 31/03/2019 à 20:43, matthew green a écrit :
> > Yann Sionneau writes:
> >> Hello,
> >>
> >> Yesterday I had a look at my lm32 NetBSD port (which is stalled since
> >> 2014 for lack of time).
> >>
> >> And I noticed that I cannot link user space binaries because the built
> >> cross toolchain lacks libgcc.
> >>
> >> I wonder: why is libgcc not built?
> >>
> >> Any guru of NetBSD/gcc build system could tell me? I didn't find
> >> anything obvious but I'm not a pro on this.
> > hi Yann,
> >
> > this is entirely on purpose.  we don't use libgcc built out of the
> > toolchain tree as it has a chicken/egg problem with shared libraries
> > and configure.  the netbsd toolchain does not include any parts that
> > are shipped -- it merely builds it.
> >
> > you may want to look at src/tools/gcc/README.mknative and look at
> > the bootstrap libgcc parts.
> >
> > feel free to ask more questions -- mknative is difficut to get
> > bootstrapped (worse than it was, for sure.)
> >
> >
> > .mrg.
> 


Home | Main Index | Thread Index | Old Index