[Clfs-support] Need help building the cross toolchain

Jon Dufresne jon.dufresne at gmail.com
Sat Nov 8 09:02:33 PST 2008


>
> Thank you. And I just built the toolchain successfully for ARM,and it works
> well for building u-boot bootloader.
>
> Only add:
>
> --without-headers
>
> to the gcc configure and with out "--with-newlib"
>
> Testing is going on for the kernel and rootfs.
>

I'm glad you had some success. However, I found I needed the
"--with-newlib" in order to build gcc. I also removed the installation
of the glibc-headers, you should too especially since you're using
uClibc. From what I've read, --with-newlib cause gcc to build against
newlib (as a libc replacement), but --without-headers instructs gcc to
not look for newlib headers. All other configurations seem to require
some piece of a libc without being able to compile a libc.

This is what my gcc_static build stage looks like, keep in mind I am
using glibc, and not uClibc.

build_gcc_static()
{
	echo "Building gcc-${GCC_VERSION} static"

	tar xjf ${PACKAGES}/gcc-${GCC_VERSION}.tar.bz2 -C ${BUILD}
	tar -xjf ${PACKAGES}/mpfr-${MPFR_VERSION}.tar.bz2 -C
${BUILD}/gcc-${GCC_VERSION}
	mv ${BUILD}/gcc-${GCC_VERSION}/mpfr-${MPFR_VERSION}
${BUILD}/gcc-${GCC_VERSION}/mpfr
	tar -xjf ${PACKAGES}/gmp-${GMP_VERSION}.tar.bz2 -C ${BUILD}/gcc-${GCC_VERSION}
	mv ${BUILD}/gcc-${GCC_VERSION}/gmp-${GMP_VERSION}
${BUILD}/gcc-${GCC_VERSION}/gmp

	mkdir -p ${BUILD}/gcc-static-build
	cd ${BUILD}/gcc-static-build

	${BUILD}/gcc-${GCC_VERSION}/configure \
		--prefix=${TOOLS} \
		--build=${HOST} \
		--host=${HOST} \
		--target=${TARGET} \
		--with-sysroot=${ROOTFS} \
		--enable-languages=c \
		--disable-multilib \
		--disable-nls \
		--disable-shared \
		--disable-threads \
		--disable-libmudflap \
		--disable-libssp \
		--disable-libgomp \
		--disable-decimal-float \
		--disable-bootstrap \
		--without-headers \
		--with-newlib \
		|| exit

	make || exit
	make install || exit

	ln -s libgcc.a ${TOOLS}/lib/gcc/${TARGET}/${GCC_VERSION}/libgcc_eh.a

	cd ${PRJROOT}
}



More information about the Clfs-support mailing list