cross-compilation documentation

Peter Barada peter@baradas.org
Mon Jun 23 12:15:00 GMT 2003


>Well, sure!  My script at http://kegel.com/crosstool does this:
>1) configure glibc and do 'make install-headers'; a wee bit of hackery
>    circumvents its urge to build everything
>2) build and install bootstrap compiler
>3) build and install real glibc
>4) build and install real gcc
>
>My step #1 isn't pretty, but it only takes a couple minutes, and I'm
>sure it's faster than what you described.  I thought you knew about
>that already...

Yes I did.  I use the following Makefile fragment to get the headers:

glibc1: ${GLIBC_BUILDDIR1} glibc1-fix
	export PATH=${INSTALL_DIR}/bin:${HOST_INSTALL_DIR}/bin:$$PATH; \
	cd ${GLIBC_BUILDDIR1}; \
	CC=${TARGET}-gcc AR=${TARGET}-ar RANLIB=${TARGET}-ranlib \
	${GLIBC_SOURCE_PATH}/configure --host=${TARGET} \
	--prefix=/usr --without-cvs --disable-sanity-checks \
	--with-headers=${INSTALL_DIR}/${TARGET}/include ; \
	make cross-compiling=yes install_root=${INSTALL_DIR}/${TARGET} prefix="" install-headers

glibc1-fix:
	mkdir -p ${INSTALL_DIR}/${TARGET}/include/gnu ; \
	touch ${INSTALL_DIR}/${TARGET}/include/gnu/stubs.h ; \
	cp -f ${GLIBC_SOURCE_PATH}/include/features.h ${INSTALL_DIR}/include/features.h


But this fragment *requires* a cross-compiler to build it.  I'm sure I
could futz it further, but I'm hoping people see that there *is* a
problem making blanket statements that "its perfectly normal to insist
that the system headers be installed when building the bootstrap".

I don't know what the solution is, but I trying to figure out the
minimal set of changes necessary to make a(or most/if not
all -linux toolchains).  That way hopefully with the next release of
gcc/glibc I won't have to go through this mess all over again...

-- 
Peter Barada
peter@baradas.org



More information about the Gcc mailing list