cross-arm-linux-gnueabihf7: update toolchain components; misc cleanups.

This commit is contained in:
Juan RP 2015-05-01 10:59:39 +02:00
parent fdc356cb60
commit 8460c06b40
1 changed files with 28 additions and 41 deletions

View File

@ -1,8 +1,8 @@
# Template build file for 'cross-arm-linux-gnueabihf7'
#
_binutils_version=2.24
_binutils_version=2.25
_gcc_version=4.9.2
_glibc_version=2.19
_glibc_version=2.21
_linux_version=3.10.6
_triplet=arm-linux-gnueabihf7
@ -12,7 +12,7 @@ _CROSS_SYSROOT="/usr/${_triplet}"
pkgname=cross-${_triplet}
version=0.19
revision=2
revision=3
short_desc="GNU Cross toolchain for the ${_triplet} LE target (binutils/gcc/glibc)"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
homepage="http://www.voidlinux.eu"
@ -23,15 +23,15 @@ distfiles="
http://ftp.gnu.org/gnu/glibc/glibc-${_glibc_version}.tar.xz
http://www.kernel.org/pub/linux/kernel/v3.x/linux-${_linux_version}.tar.xz"
checksum="
e5e8c5be9664e7f7f96e0d09919110ab5ad597794f5b1809871177a0f0f14137
22defc65cfa3ef2a3395faaea75d6331c6e62ea5dfacfed3e2ec17b08c882923
2020c98295856aa13fda0f2f3a4794490757fc24bcca918d52cc8b4917b972dd
2d3997f588401ea095a0b27227b1d50cdfdd416236f6567b564549d3b46ea2a2
aeeb362437965a5d3f40b151094ca79def04a115bd363fdd4a9a0c69482923b8
ed4dfd9f56b7c82e9c71331bbf8d2ea01ddfddc1b6209bd3f3c8640aa24065cf"
lib32disabled=yes
nocross=yes
nodebug=yes
create_wrksrc=yes
replaces="cross-armv7l-linux-gnueabihf>=0 cross-armv7l-linux-gnueabihf-libc>=0"
hostmakedepends="perl flex"
makedepends="zlib-devel gmp-devel mpfr-devel libmpc-devel"
@ -75,7 +75,8 @@ _binutils_build() {
--with-sysroot=${_CROSS_SYSROOT} --disable-nls --disable-shared \
--disable-multilib --disable-werror
make configure-host && make ${makejobs}
make configure-host
make ${makejobs}
make install
touch ${wrksrc}/.binutils_build_done
@ -92,7 +93,8 @@ _gcc_bootstrap() {
[ ! -d ../gcc-bootstrap ] && mkdir ../gcc-bootstrap
cd ../gcc-bootstrap
../gcc-${_gcc_version}/configure --prefix=/usr \
CFLAGS="-O0 -g0" CXXFLAGS="-O0 -g0" \
../gcc-${_gcc_version}/configure --prefix=/usr \
--target=${_triplet} --without-headers \
--disable-nls --disable-shared --disable-libquadmath \
--disable-decimal-float --disable-libgomp --disable-libmudflap \
@ -125,8 +127,7 @@ _glibc_headers() {
../glibc-${_glibc_version}/configure \
--host=${_triplet} --prefix=/usr \
--with-headers=${_CROSS_SYSROOT}/usr/include \
--config-cache --enable-add-ons=nptl,ports \
--enable-obsolete-rpc \
--config-cache --enable-obsolete-rpc \
--enable-kernel=2.6.27 ${_fpuflags}
make -k install-headers cross_compiling=yes \
@ -152,11 +153,10 @@ _glibc_build() {
export CFLAGS="-Os -pipe ${_archflags}"
../glibc-${_glibc_version}/configure \
--host=${_triplet} --prefix=/usr --libdir=/usr/lib \
--host=${_triplet} --prefix=/usr \
--with-headers=${_CROSS_SYSROOT}/usr/include \
--config-cache --enable-add-ons=nptl,ports \
--enable-obsolete-rpc --disable-profile \
--enable-kernel=2.6.27 ${_fpuflags}
--config-cache --disable-profile --enable-obsolete-rpc \
--disable-werror --enable-kernel=2.6.27 ${_fpuflags}
make ${makejobs}
make install_root=${_CROSS_SYSROOT} install
@ -173,8 +173,8 @@ _gcc_build() {
[ ! -d gcc-build ] && mkdir gcc-build
cd gcc-build
unset LD AS CPP
export CC="gcc" CFLAGS="-Os -pipe"
unset LD AS
# Make this link to target libs.
if [ ! -f .sed_subst_done ]; then
@ -182,12 +182,13 @@ _gcc_build() {
-i ${_CROSS_SYSROOT}/lib/libc.so ${_CROSS_SYSROOT}/lib/libpthread.so
touch .sed_subst_done
fi
../gcc-${_gcc_version}/configure \
--target=${_triplet} --prefix=/usr --libdir=/usr/lib \
--with-sysroot=${_CROSS_SYSROOT} --enable-languages=c,c++,lto \
--libexecdir=/usr/lib --with-sysroot=${_CROSS_SYSROOT} \
--enable-languages=c,c++,lto \
--with-gnu-as --with-gnu-ld --disable-multilib \
--disable-nls --disable-sjlj-exceptions \
--disable-werror --disable-nls --disable-sjlj-exceptions \
--enable-threads=posix --enable-long-longx \
--enable-shared --enable-linker-build-id \
--enable-gnu-unique-object --enable-lto \
@ -203,10 +204,7 @@ _gcc_build() {
}
do_build() {
unset LDFLAGS
export CFLAGS="-Os" CXXFLAGS="-Os"
for f in include lib libexec bin sbin; do
for f in include lib bin; do
if [ ! -d ${_CROSS_SYSROOT}/usr/${f} ]; then
mkdir -p ${_CROSS_SYSROOT}/usr/${f}
fi
@ -214,6 +212,10 @@ do_build() {
ln -sfr ${_CROSS_SYSROOT}/usr/${f} ${_CROSS_SYSROOT}/${f}
fi
done
# Ensure we use sane environment
unset CC CXX CPP LD AS AR RANLIB OBJDUMP READELF NM
unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
export CFLAGS="-Os" CXXFLAGS="-Os"
_binutils_build
_gcc_bootstrap
@ -224,7 +226,7 @@ do_build() {
}
do_install() {
for f in include lib libexec bin sbin; do
for f in include lib bin; do
if [ ! -d ${DESTDIR}/${_CROSS_SYSROOT}/usr/${f} ]; then
mkdir -p ${DESTDIR}/${_CROSS_SYSROOT}/usr/${f}
fi
@ -233,7 +235,6 @@ do_install() {
${DESTDIR}/${_CROSS_SYSROOT}/${f}
fi
done
# install cross binutils
cd ${wrksrc}/binutils-build
make DESTDIR=${DESTDIR} install
@ -252,26 +253,15 @@ do_install() {
cd ${wrksrc}/glibc-build
make install_root=${DESTDIR}/${_CROSS_SYSROOT} install install-headers
# XXX hard-float only toolchain.
ln -sfr ${DESTDIR}/${_CROSS_SYSROOT}/usr/include/gnu/stubs-hard.h \
${DESTDIR}/${_CROSS_SYSROOT}/usr/include/gnu/stubs-soft.h
ln -sfr ${DESTDIR}/${_CROSS_SYSROOT}/usr/lib/ld-linux-armhf.so.3 \
${DESTDIR}/${_CROSS_SYSROOT}/usr/lib/ld-linux.so.3
# Remove unnecessary stuff
rm -f ${DESTDIR}/usr/lib*/libiberty.a
rm -rf ${DESTDIR}/usr/share
rm -rf ${DESTDIR}/${_CROSS_SYSROOT}/{etc,var}
rm -rf ${DESTDIR}/${_CROSS_SYSROOT}/{sbin,etc,var}
rm -rf ${DESTDIR}/${_CROSS_SYSROOT}/usr/{sbin,share,libexec}
rm -rf ${DESTDIR}/${_CROSS_SYSROOT}/usr/lib/gconv
rm -f ${DESTDIR}/${_CROSS_SYSROOT}/libexec
for f in sprof localedef gencat pldd sotruss tzselect iconv mtrace \
catchsegv xtrace makedb pcprofiledump locale rpcgen getconf \
getent ldd; do
rm -f ${DESTDIR}/${_CROSS_SYSROOT}/usr/bin/${f}
done
# remove temporary symlinks in sysroot
find ${DESTDIR}/${_CROSS_SYSROOT} -maxdepth 1 -type l -delete
}
cross-arm-linux-gnueabihf7-libc_package() {
@ -282,8 +272,5 @@ cross-arm-linux-gnueabihf7-libc_package() {
pkg_install() {
vmove usr/${_triplet}
mkdir -p ${DESTDIR}/usr/${_triplet}/usr/
mv ${PKGDESTDIR}/usr/${_triplet}/usr/bin \
${DESTDIR}/usr/${_triplet}/usr
}
}