tech-toolchain archive

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

cross compiling and crtbeginS.o



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 ${_GCC_CRTBEGINS} and $ {_GCC_CRTENDS} 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 ${MKGCC} != 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.



Home | Main Index | Thread Index | Old Index