gcc: unbreak native musl build; plus some misc changes.
- On native musl, disable go and java (not supported or needs external patches). - i686/glibc: for consistency use the same triplet than xbps-src. - aarch64/glibc: use /lib for 64bit multiarch. - x86_64/glibc: use /lib for 64bit multiarch and dynamic linker, rather than /lib64. - Remove obsolete stuff for the bootstrap build. Tested in all possible combinations, both native/cross musl/glibc and x86/ARM.
This commit is contained in:
parent
4cfc638061
commit
1cf59aa444
1 changed files with 26 additions and 16 deletions
|
@ -2,7 +2,7 @@
|
||||||
pkgname=gcc
|
pkgname=gcc
|
||||||
_majorver=4.9
|
_majorver=4.9
|
||||||
version=${_majorver}.2
|
version=${_majorver}.2
|
||||||
revision=2
|
revision=3
|
||||||
short_desc="The GNU C Compiler"
|
short_desc="The GNU C Compiler"
|
||||||
maintainer="Juan RP <xtraeme@voidlinux.eu>"
|
maintainer="Juan RP <xtraeme@voidlinux.eu>"
|
||||||
homepage="http://gcc.gnu.org"
|
homepage="http://gcc.gnu.org"
|
||||||
|
@ -25,19 +25,24 @@ subpackages="libgcc libgomp libgomp-devel libatomic libatomic-devel"
|
||||||
subpackages+=" libitm libitm-devel libssp libssp-devel gcc-c++"
|
subpackages+=" libitm libitm-devel libssp libssp-devel gcc-c++"
|
||||||
|
|
||||||
if [ "$CHROOT_READY" -a -z "$CROSS_BUILD" ]; then
|
if [ "$CHROOT_READY" -a -z "$CROSS_BUILD" ]; then
|
||||||
# Required by gcj
|
subpackages+=" gcc-fortran gcc-objc gcc-objc++"
|
||||||
hostmakedepends+=" zip unzip"
|
|
||||||
subpackages+=" gcc-gcj gcc-go gcc-fortran gcc-objc gcc-objc++"
|
|
||||||
subpackages+=" libgcj-devel libgcj libgo-devel libgo"
|
|
||||||
subpackages+=" libgfortran-devel libgfortran"
|
subpackages+=" libgfortran-devel libgfortran"
|
||||||
subpackages+=" libobjc-devel libobjc"
|
subpackages+=" libobjc-devel libobjc"
|
||||||
|
# Required by gcj
|
||||||
|
case "$XBPS_TARGET_MACHINE" in
|
||||||
|
*-musl);;
|
||||||
|
*) # XXX disable go and java with musl
|
||||||
|
hostmakedepends+=" zip unzip"
|
||||||
|
subpackages+=" gcc-go libgo-devel libgo gcc-gcj libgcj-devel libgcj"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
subpackages+=" libstdc++-devel libstdc++"
|
subpackages+=" libstdc++-devel libstdc++"
|
||||||
|
|
||||||
case "$XBPS_TARGET_MACHINE" in
|
case "$XBPS_TARGET_MACHINE" in
|
||||||
i686) _triplet="i686-pc-linux-gnu";;
|
i686) _triplet="i686-pc-linux-gnu";;
|
||||||
i686-musl) _triplet="i686-pc-linux-musl";;
|
i686-musl) _triplet="i686-linux-musl";;
|
||||||
x86_64) _triplet="x86_64-unknown-linux-gnu";;
|
x86_64) _triplet="x86_64-unknown-linux-gnu";;
|
||||||
x86_64-musl) _triplet="x86_64-linux-musl";;
|
x86_64-musl) _triplet="x86_64-linux-musl";;
|
||||||
armv5tel) _triplet="arm-linux-gnueabi";;
|
armv5tel) _triplet="arm-linux-gnueabi";;
|
||||||
|
@ -78,7 +83,14 @@ do_configure() {
|
||||||
armv5*) _args+=" --with-arch=armv5te --with-float=soft";;
|
armv5*) _args+=" --with-arch=armv5te --with-float=soft";;
|
||||||
armv6l*) _args+=" --with-arch=armv6 --with-fpu=vfp --with-float=hard";;
|
armv6l*) _args+=" --with-arch=armv6 --with-fpu=vfp --with-float=hard";;
|
||||||
armv7l*) _args+=" --with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard";;
|
armv7l*) _args+=" --with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard";;
|
||||||
aarch64*) _args+=" --with-arch=armv8-a";;
|
aarch64*) # use lib not lib64 by default
|
||||||
|
_args+=" --with-arch=armv8-a"
|
||||||
|
sed -i '/m64=/s/lib64/lib/' gcc/config/aarch64/t-aarch64-linux
|
||||||
|
;;
|
||||||
|
x86_64*) # use lib not lib64 by default
|
||||||
|
sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
|
||||||
|
sed -i 's/lib64/lib/' gcc/config/i386/linux64.h
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ "$CROSS_BUILD" ]; then
|
if [ "$CROSS_BUILD" ]; then
|
||||||
|
@ -90,10 +102,11 @@ do_configure() {
|
||||||
_args+=" --disable-multilib --host=$XBPS_CROSS_TRIPLET --with-build-sysroot=${XBPS_CROSS_BASE}"
|
_args+=" --disable-multilib --host=$XBPS_CROSS_TRIPLET --with-build-sysroot=${XBPS_CROSS_BASE}"
|
||||||
else
|
else
|
||||||
case "$XBPS_TARGET_MACHINE" in
|
case "$XBPS_TARGET_MACHINE" in
|
||||||
arm*|aarch64*) _args+=" --build=${_triplet}";;
|
# XXX disable go and java with musl
|
||||||
|
*-musl) _langs="c,c++,objc,obj-c++,fortran,lto";;
|
||||||
|
*) _langs="c,c++,objc,obj-c++,fortran,lto,go,java";;
|
||||||
esac
|
esac
|
||||||
_langs="c,c++,objc,obj-c++,fortran,lto,go,java"
|
_args+=" --build=${_triplet} --enable-java-gc=boehm --enable-fast-character"
|
||||||
_args+=" --enable-java-gc=boehm --enable-fast-character"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$CHROOT_READY" ]; then
|
if [ -z "$CHROOT_READY" ]; then
|
||||||
|
@ -106,8 +119,7 @@ do_configure() {
|
||||||
_langs="c,c++,lto"
|
_langs="c,c++,lto"
|
||||||
fi
|
fi
|
||||||
case "$XBPS_TARGET_MACHINE" in
|
case "$XBPS_TARGET_MACHINE" in
|
||||||
*-musl) _args+=" --disable-libsanitizer";;
|
aarch64*|*-musl) _args+=" --disable-libsanitizer";;
|
||||||
aarch64*) _args+=" --disable-libsanitizer";;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
|
export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}"
|
||||||
|
@ -122,12 +134,10 @@ do_configure() {
|
||||||
--enable-linker-build-id --enable-gnu-unique-object \
|
--enable-linker-build-id --enable-gnu-unique-object \
|
||||||
--enable-checking=release --disable-libstdcxx-pch \
|
--enable-checking=release --disable-libstdcxx-pch \
|
||||||
--enable-cloog-backend=isl --with-linker-hash-style=gnu \
|
--enable-cloog-backend=isl --with-linker-hash-style=gnu \
|
||||||
--enable-languages=${_langs} --enable-sjlj-exceptions=no ${_args}
|
--disable-werror --enable-languages=${_langs} \
|
||||||
|
--enable-sjlj-exceptions=no ${_args}
|
||||||
}
|
}
|
||||||
do_build() {
|
do_build() {
|
||||||
if [ -z "$CHROOT_READY" ]; then
|
|
||||||
export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
|
|
||||||
fi
|
|
||||||
make ${makejobs}
|
make ${makejobs}
|
||||||
}
|
}
|
||||||
pre_install() {
|
pre_install() {
|
||||||
|
|
Loading…
Reference in a new issue