cross-arm-none-eabi-gcc: update to 9.2.0 + build libgcc

This does other reworking, such as building in a separate directory
like is recommended by the project.

By importing some changes from Arch, I managed to fix building of
libgcc, which further enables building the rest of the toolchain.

However, building libstdc++ is skipped, as that requires newlib
to build, which itself is not available at this point. Newlib on
the other hand requires a built toolchain to compile. We solve
this by building gcc (complete but without libstdc++) first,
followed by building newlib, followed by building just libstdc++
on its own.
This commit is contained in:
q66 2019-12-27 23:40:18 +01:00 committed by Daniel Kolesa
parent 5b24588e43
commit 541236ac9e

View File

@ -1,55 +1,13 @@
# Template file for 'cross-${_triplet}-${_pkgname}'
# Template file for 'cross-${_triplet}-gcc'
_triplet=arm-none-eabi
_pkgname=gcc
pkgname=cross-${_triplet}-${_pkgname}
version=9.1.0
pkgname=cross-${_triplet}-gcc
version=9.2.0
revision=1
wrksrc="${_pkgname}-${version}"
wrksrc="gcc-${version}"
build_wrksrc=build
build_style=gnu-configure
configure_args="
--disable-decimal-float
--disable-libffi
--disable-libgomp
--disable-libmudflap
--disable-libquadmath
--disable-libssp
--disable-libstdcxx-pch
--disable-nls
--disable-shared
--disable-threads
--disable-tls
--disable-werror
--enable-__cxa_atexit
--enable-c99
--enable-gnu-indirect-function
--enable-interwork
--enable-languages=c,c++
--enable-long-long
--enable-multilib
--enable-plugins
--host=${XBPS_CROSS_TRIPLET}
--libdir=/usr/lib
--libexecdir=/usr/lib
--prefix=/usr
--target=${_triplet}
--with-gmp
--with-gnu-as
--with-gnu-ld
--with-headers=/usr/${_triplet}/include
--with-host-libstdcxx='-static-libgcc'
--with-isl
--with-libelf
--with-mpc
--with-mpfr
--with-multilib-list=rmprofile
--with-native-system-header-dir=/include
--with-newlib
--with-python-dir=share/${_pkgname}-${_triplet}
--with-sysroot=/usr/${_triplet}
--with-system-zlib
"
make_build_target="all-gcc"
make_install_target="install-gcc"
make_build_args="INHIBIT_LIBC_CFLAGS='-DUSE_TM_CLONE_REGISTRY=0'"
hostmakedepends="autoconf automake cross-arm-none-eabi-binutils bison flex perl"
makedepends="gmp-devel isl15-devel libmpc-devel mpfr-devel zlib-devel"
depends="cross-arm-none-eabi-binutils"
@ -57,12 +15,72 @@ short_desc="GNU Compiler Collection"
maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
homepage="https://gcc.gnu.org"
distfiles="${GNU_SITE}/${_pkgname}/${_pkgname}-${version}/${_pkgname}-${version}.tar.xz"
checksum=79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
checksum=ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
alternatives="arm-none-eabi:/usr/bin/arm-none-eabi-cc:/usr/bin/arm-none-eabi-gcc"
nocross=yes
nopie=yes
nostrip_files="libgcc.a libgcov.a"
post_extract() {
mkdir -p build
}
pre_configure() {
export CFLAGS_FOR_TARGET="-g -Os -ffunction-sections -fdata-sections"
export CXXFLAGS_FOR_TARGET="-g -Os -ffunction-sections -fdata-sections"
}
do_configure() {
../configure \
--disable-decimal-float \
--disable-libffi \
--disable-libgomp \
--disable-libmudflap \
--disable-libquadmath \
--disable-libssp \
--disable-libstdcxx-pch \
--disable-libstdc__-v3 \
--disable-nls \
--disable-shared \
--disable-threads \
--disable-tls \
--disable-werror \
--enable-__cxa_atexit \
--enable-c99 \
--enable-gnu-indirect-function \
--enable-interwork \
--enable-languages=c,c++ \
--enable-long-long \
--enable-multilib \
--enable-plugins \
--host=${XBPS_CROSS_TRIPLET} \
--libdir=/usr/lib \
--libexecdir=/usr/lib \
--prefix=/usr \
--target=${_triplet} \
--with-gmp \
--with-gnu-as \
--with-gnu-ld \
--with-headers=/usr/${_triplet}/include \
--with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' \
--with-isl \
--with-libelf \
--with-mpc \
--with-mpfr \
--with-multilib-list=rmprofile \
--with-native-system-header-dir=/include \
--with-newlib \
--with-python-dir=share/gcc-${_triplet} \
--with-sysroot=/usr/${_triplet} \
--with-system-zlib
}
pre_build() {
pre_configure
}
post_install() {
rm -fr ${DESTDIR}/usr/share/{info,man/man7}
rm -fr ${DESTDIR}/usr/lib/libcc1.*
}