List Info

Thread: cross compiling and crtbeginS.o




cross compiling and crtbeginS.o
user name
2008-02-26 00:48:34
Hi all,
I'm cross compiling NetBSD for an embedded platform. I've
been eyeing  
up the MK* variables listed in share/mk/bsd.README. One that
caught  
my eye is MKGCC=no. I won't need to run GCC on the target  
environment, so why waste time compiling it?

There seems to be some confusion over where crtbeginS.o (and
 
crtendS.o) fit into the scheme of things.

gnu/lib/crtstuff4/Makefile will not do anything if MKGCC=no
with the  
comment "If using an external toolchain, we expect
crtbegin/crtend to  
be supplied by that toolchain's run-time support". OK.

share/mk/bsd.lib.mk unconditionally refers to
$ and $ 
 which in turn seems to cause problems
generating  
dependencies because make can't work out how these files
should be  
built. I can fix this by putting .if $ != no ... in
share/mk/ 
bsd.lib.mk. OK.

Then we fail to create libc.so.12.149 because
$TOOLDIR/bin/arm-- 
netbsdelf-gcc doesn't have it's own copy of crtbeginS.o. I
created  
one after reading tools/gcc/README.mknative and added an
appropriate - 
B flag the link line for libc.so.12.149 at which point
libgcc_pic  
couldn't be found.

Is it my imagination, or am I the first person to use
MKGCC=no with  
the new(ish) tools infrastructure?

Am I right in guessing that the only real solution is to
have a full  
installation of GCC for cross compilation?

Cheers,
Lloyd
p.s. I'm cross compiling from NetBSD/amd64 4.0 to
NetBSD/evbarm 4.0,  
but I don't think that will make a difference.


re: cross compiling and crtbeginS.o
country flaguser name
Australia
2008-02-26 02:21:56

MKGCC=no has issues in general.  i haven't heard of anyone
using an external compiler lately but maybe those who do
could speak up, if they use it.

if you don't want certain parts build for your embedded
platform, i would hack the makefiles to not build the
gcc dirs in gnu/usr.bin and gnu/lib that you don't want.

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )