aboutsummaryrefslogtreecommitdiffstats
path: root/main/gcc/APKBUILD
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-07-12 12:26:37 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-07-12 12:42:13 +0000
commit0a61db5bf5537be193aada0990fcdd355ebc264d (patch)
treeaedde0cbf58eede8b359adac00964e7633f7fe98 /main/gcc/APKBUILD
parent8f6d5f7df8924178bb5dba5e519d6577e0044922 (diff)
downloadaports-0a61db5bf5537be193aada0990fcdd355ebc264d.tar.gz
aports-0a61db5bf5537be193aada0990fcdd355ebc264d.tar.bz2
aports-0a61db5bf5537be193aada0990fcdd355ebc264d.tar.xz
main/gcc: crosscompile, musl and arm support
Diffstat (limited to 'main/gcc/APKBUILD')
-rw-r--r--main/gcc/APKBUILD71
1 files changed, 56 insertions, 15 deletions
diff --git a/main/gcc/APKBUILD b/main/gcc/APKBUILD
index 7d480f752a..db0f88de0f 100644
--- a/main/gcc/APKBUILD
+++ b/main/gcc/APKBUILD
@@ -7,7 +7,7 @@ _specs_gcc_ver=4.4.3
_uclibc_abiver=0.9.32
-pkgrel=7
+pkgrel=8
pkgdesc="The GNU Compiler Collection"
url="http://gcc.gnu.org"
arch="all"
@@ -19,9 +19,20 @@ makedepends="bison flex gmp-dev mpfr-dev texinfo mpc1-dev gawk zlib-dev zip
subpackages="$pkgname-doc libgcc libgomp libstdc++:libcxx g++:gpp"
replaces="libstdc++"
-if [ -n "$BOOTSTRAP" ]; then
+if [ "$CBUILD" != "$CHOST" ]; then
+ export CFLAGS_FOR_HOST="$CFLAGS"
+ export CXXFLAGS_FOR_HOST="$CXXFLAGS"
+ export CPPFLAGS_FOR_HOST="$CPPFLAGS"
+ export LDFLAGS_FOR_HOST="$LDFLAGS"
+ unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
+
+ export CFLAGS="--sysroot=${CBUILDROOT}"
+ export CXXFLAGS="--sysroot=${CBUILDROOT}"
+ export LDFLAGS="--sysroot=${CBUILDROOT}"
+
LANG_OBJC=off
LANG_JAVA=off
+ LANG_GO=off
LANG_FORTRAN=off
fi
@@ -60,6 +71,9 @@ source="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-$pkgver.tar.bz2
74_all_gcc47_cloog-dl.patch
gcc-spec-env.patch
+ gcc-4.7.3-musl.patch
+ libgcc-backports.patch
+ libgcc-always-build-gcceh.a.patch
pt_gnu_eh_frame.patch
uclibc-getipinfo.patch
gcc-4.7-dynamic-linker.patch
@@ -67,6 +81,7 @@ source="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-$pkgver.tar.bz2
boehem-gc-uclibc.patch
gcc-pure64.patch
gcc-go.patch
+ pr45078.patch
"
@@ -97,7 +112,7 @@ prepare() {
case "$i" in
*.patch)
msg "Applying $i"
- patch -p1 -i "$srcdir"/$i || _err="$_err $i"
+ patch -p1 -F3 -i "$srcdir"/$i || _err="$_err $i"
;;
esac
done
@@ -128,8 +143,10 @@ prepare() {
build() {
local _dynamic_linker=
+ local _arch_configure=
+ local _symvers="--disable-symvers"
cd "$_gccdir"
- export CFLAGS="-fno-stack-protector"
+ export CFLAGS="-fno-stack-protector $CFLAGS"
[ -z "$CBUILD" ] && CBUILD="$CHOST"
[ -z "$CTARGET" ] && CTARGET="$CHOST"
@@ -142,9 +159,11 @@ build() {
;;
x86_64-*-gnu)
_dynamic_linker="--with-dynamic-linker=ld-linux-x86-64.so.2"
+ _symvers=
;;
*-gnu)
_dynamic_linker="--with-dynamic-linker=ld-linux.so.2"
+ _symvers=
;;
*) _dynamic_linker=
;;
@@ -152,7 +171,18 @@ build() {
# --enable-target-optspace is broken on powerpc
if [ "$CARCH" != "powerpc" ]; then
- _target_optspace="--enable-target-optspace"
+ _arch_configure="$_arch_configure --enable-target-optspace"
+ fi
+
+ case "$CARCH" in
+ arm*) _arch_configure="$_arch_configure --with-float=hard";;
+ esac
+
+ if [ "${CHOST#*musl}" != "$CHOST" ]; then
+ # musl does not support mudflap
+ _arch_configure="$_arch_configure --disable-mudflap --disable-libmudflap"
+ else
+ _arch_configure="$_arch_configure --without-system-libunwind"
fi
msg "Building the following:"
@@ -162,7 +192,7 @@ build() {
echo " CTARGET=$CTARGET"
echo " languages=$_languages"
echo " dynamic_linker=$_dynamic_linker"
- echo " target_optspace=$_target_optspace"
+ echo " arch_configure=$_arch_configure"
echo ""
mkdir -p "$_builddir"
@@ -183,19 +213,19 @@ build() {
--disable-multilib \
--disable-nls \
--disable-werror \
+ $_symvers \
--enable-__cxa_atexit \
--enable-cld \
--enable-esp \
--enable-cloog-backend \
--enable-languages=$_languages \
--enable-shared \
- $_target_optspace \
+ $_arch_configure \
--enable-tls \
--enable-threads \
$_dynamic_linker \
--with-dynamic-linker-prefix=/lib \
--with-system-zlib \
- --without-system-libunwind \
|| return 1
make || return 1
@@ -228,7 +258,7 @@ package() {
|| return 1
# strip debug info from some statib libs
- strip -g `find "$pkgdir" \( -name libgfortran.a -o -name libobjc.a -o -name libgomp.a \
+ ${CROSS_COMPILE}strip -g `find "$pkgdir" \( -name libgfortran.a -o -name libobjc.a -o -name libgomp.a \
-o -name libmudflap.a -o -name libmudflapth.a \
-o -name libgcc.a -o -name libgcov.a -o -name libquadmath.a \
-o -name libitm.a -o -name libgo.a -o -name libcaf\*.a \
@@ -240,8 +270,7 @@ package() {
"$pkdir"/usr/lib/libgcj.spec
# remove ffi
- rm "$pkgdir"/usr/lib/libffi* "$pkgdir"/usr/share/man/man3/ffi* \
- || return 1
+ rm -f "$pkgdir"/usr/lib/libffi* "$pkgdir"/usr/share/man/man3/ffi*
find "$pkgdir" -name 'ffi*.h' | xargs rm -f
mkdir -p "$pkgdir"/usr/share/gdb/python/auto-load/usr/lib
@@ -299,7 +328,7 @@ libgcc() {
pkgdesc="GNU C compiler runtime libraries"
depends=
mkdir -p "$subpkgdir"/usr/lib
- mv "$pkgdir"/usr/lib/libgcc_s.so.* "$subpkgdir"/usr/lib/
+ mv "$pkgdir"/usr/lib/libgcc_s.so.* "$subpkgdir"/usr/lib/ || return 1
}
libgomp() {
@@ -436,13 +465,17 @@ d8692c56f04b92667096f59d843e95c5 51_all_libiberty-pic.patch
406fc6f29ab3d746eaef0202c50fd7e9 67_all_gcc-poison-system-directories.patch
f24f07ed008324eaecb0f75417c99116 74_all_gcc47_cloog-dl.patch
a695d7648509b4f8e18b389a19e6037c gcc-spec-env.patch
+789c5ace577a7c4aea769af614cffa86 gcc-4.7.3-musl.patch
+15c03ac46867377f347412b05796ae72 libgcc-backports.patch
+504c7dd8651c5d98229892c4cd9ea591 libgcc-always-build-gcceh.a.patch
ab83248e10b2bf4b3d9240de0fefb52b pt_gnu_eh_frame.patch
6cc2385c5bbd6d0da6eaedd53c8bf547 uclibc-getipinfo.patch
ac11128f201ee00287f8852697cb86a6 gcc-4.7-dynamic-linker.patch
32e8e4c0e23ed8f5de95a591cb30f1da gcc-4.6-pr32219.patch
2c6cb49bb9bfd8b6e690222e66ccc901 boehem-gc-uclibc.patch
2e2b787bb988d9007c9f7ce42178dfe6 gcc-pure64.patch
-c94014ece84407a36d239417a2bad25d gcc-go.patch"
+c94014ece84407a36d239417a2bad25d gcc-go.patch
+aa98f3b0db9e5d342792cad4e197ccd9 pr45078.patch"
sha256sums="2f7c37eb4fc14422ff2358a9ef59c974a75ab41204ef0e49fc34ab1d8981a9c3 gcc-4.7.3.tar.bz2
26aee7449cd3cd642065a0860d723dbb8062066ad87a398241f61210c68513d9 gcc-4.7.1-piepatches-v0.5.3.tar.bz2
f6c7cb99beead66dd4d06f7004c5731a9360330cbe878ce79792c618e008eed2 gcc-4.4.3-specs-0.2.0.tar.bz2
@@ -457,13 +490,17 @@ da6bbb5dc654d5e1df8ecae5c9ebb56265426c405931f14f5878248b8c79f78d 51_all_libiber
830028c0d08f43a0f5ae1f60c20256f1cad6bdae95c05ac901a10bf5a7406899 67_all_gcc-poison-system-directories.patch
ce041ae09033d8d170a942b30f26d85ef720bf846c90963b39083c2963334c82 74_all_gcc47_cloog-dl.patch
64b01f29fb853fee5ecda998b66eeaa7ec86ff1fc3b21432bfd69eb543c93e6a gcc-spec-env.patch
+7ef3c4804ea16c2da10860931349251a6ad2cabc57d77029a8d55cd6de89a10e gcc-4.7.3-musl.patch
+163ae7e199ba9751744794c82cbb927bd87d87c89c6a2b6f39fb4a322a1b90cf libgcc-backports.patch
+1975189156d70f5428cb7f1516533965d1c8734f3009fc89a9b8e289b72326f1 libgcc-always-build-gcceh.a.patch
78e75cb378bdfe870c98ab3cffef37f54be729d3912979191f27ca00651ad6c4 pt_gnu_eh_frame.patch
53184f842477569973c232dac7c85e71b0018cbe5c4962f95dd9e0273f42083e uclibc-getipinfo.patch
633b46b3b433550a1ad8f3150904eec0a5fee5f3a284d38dc0b7013f45505b96 gcc-4.7-dynamic-linker.patch
89207a8b62137a857ee2c43499d6b5247d37b530d1338844dbb330a6846b2ad2 gcc-4.6-pr32219.patch
02751ccf223dcfc898c0ce2214cd0859d275e90b742f1a66e38db5c50f94b38c boehem-gc-uclibc.patch
f5473c6aea96d5137defd68898ba31042944a3f3ed26c05b964a40bd876c6f47 gcc-pure64.patch
-e6b57e7c7d860550a4f7befa3e622024ba077a5906e6f2fd104b33fd47921be0 gcc-go.patch"
+e6b57e7c7d860550a4f7befa3e622024ba077a5906e6f2fd104b33fd47921be0 gcc-go.patch
+af214cc21f5c4de5f222b049d8e27238a951f7b6262d2767c03b10087c362788 pr45078.patch"
sha512sums="5671a2dd3b6ac0d23f305cb11a796aebd823c1462b873136b412e660966143f4e07439bd8926c1443b78442beb6ae370ef91d819ec615920294875b722b7b0bd gcc-4.7.3.tar.bz2
47e16c41ec6678f9960bd39b8f7f01a0a956ae112584c3aa8b7fa5107eef1b598eba191d5199280131399ff096a1b0d14c9b5799cdfee837451e48a3405b2374 gcc-4.7.1-piepatches-v0.5.3.tar.bz2
779ecb0a064d2138b54569c8ae501975b8a6b72e5a3acbf8597619a8db77ee42ef9b0e62608d5192a15e4393e7dfc009bb50b994782236faa744b2c46b5fe517 gcc-4.4.3-specs-0.2.0.tar.bz2
@@ -478,10 +515,14 @@ f8dfe0b6907fab10009ab009f7b23df80a2b900c02da672f2d795e7609ec344d6ae66e521518d5d7
77d9383361bbc6701b34ba35356a09b97ebd45d8595c79bac9e3b8277def83caef47418ed813c2d138f2016779dce511c6e68155787c2462ab8ca1479c46c967 67_all_gcc-poison-system-directories.patch
739fd5e05dbab5090802eb447c24d5f03ed0b581f76acd8d69729c1bbfab9f92a41491eb313415f0f0e80cd80961eb8ea420170efbd705136d682ba71cff87da 74_all_gcc47_cloog-dl.patch
ce9c1f923e2c6d17347ec2d3d8482351a9644194b2753627389294d43bb4f11b9c2ef41eda1b46ad83d09901a0bedebd5b6b8a57a198646030ab61e8d2d8cb48 gcc-spec-env.patch
+f8988835c996c6cc4bb60096aaa9f712e835957ff745db66d78adf65ad09afa3a828ff7767ad11410d51b4b52d1c03bfdc96e3607a789f01faec11ec504f89dd gcc-4.7.3-musl.patch
+719642ba2bc501e270bf09ae1a1b4151510b68006fcd8e8655a7c30d1e678fe134e7de0fb2a2366a9c6a13835a499a82b36b544c203853e556f16b0a2ea2ab59 libgcc-backports.patch
+d08d7ead2de0429e5c9055d5b029ec2be9a8c821d22cecaf9b51f633652c493333f98963d9267fa2fa63850c50ae5eefd5f59e5910ec10d20044dac082182a8b libgcc-always-build-gcceh.a.patch
8464197f01d107872dfa6b47e86e95ae8d75c053527bafbdb7a86bcc7aff4bc5b20a8ec40d6e48d1ad455b0187a3cba9db337cff6c0a6245507c4533e4832d99 pt_gnu_eh_frame.patch
e3edf75df1f27af8771bd263e1bd607f6207c4eb5b2a5e11032577deba43ea201825e3b5008a720105f24e49d2821dd77a61c7ceba7ed91b3621c0dbd9292fc6 uclibc-getipinfo.patch
91332bea084d13d165bac8abe826c3656f77c8872898a4d86b7e258dbf5af85d1b25b7e51f262f4b19b11ca89bf5d77ab0ac5554068419f15bf017a37a9d1822 gcc-4.7-dynamic-linker.patch
9fc5e32f2573ae67b6cf22119d636d10a47c42718635bceff7d457a93a3f664ae1ed10e154f70964ba2d26b0de04f879a8c05de6411112760d40433373dd0a80 gcc-4.6-pr32219.patch
e1d6a450dfb40b134ad7f759c4c10174d2490b0093fe47cb33479245f26a3a8c54ebcf6255943c0ccfcb5095600d1c05e530baeed35609c8ffe75caac8e57c49 boehem-gc-uclibc.patch
4a5aeff0399782c752e6e3f2f48d984b2056dfb5d229b23a24eee1562d241339989b2203f139821cfc03c9b25c9bd7da6ccbbdc7a09d242e4de7f0d606c6f63c gcc-pure64.patch
-1a09175bbb9c457893d4e921aa1bfe81fa7d657255d76ddb45f2f6db9232fb74bbc5fbac74d29d972ef74ab01df6a1a70e9ce83092e434a2d7c6b4155ea177b8 gcc-go.patch"
+1a09175bbb9c457893d4e921aa1bfe81fa7d657255d76ddb45f2f6db9232fb74bbc5fbac74d29d972ef74ab01df6a1a70e9ce83092e434a2d7c6b4155ea177b8 gcc-go.patch
+8822d2d7e32b1158169f58e34372c06fa122e2dfbd33ad5b7bd6fc13d57eedc592ba290381134bb078a6cca7a52109289389d0a52b72399903bcfc9584704e45 pr45078.patch"