aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/gcc/APKBUILD38
-rw-r--r--main/gcc/fix-cxxflags-passing.patch10
-rw-r--r--main/gcc/gcc-4.8-build-args.patch41
3 files changed, 77 insertions, 12 deletions
diff --git a/main/gcc/APKBUILD b/main/gcc/APKBUILD
index 51ff93a537..0e64642594 100644
--- a/main/gcc/APKBUILD
+++ b/main/gcc/APKBUILD
@@ -20,15 +20,18 @@ subpackages="$pkgname-doc libgcc libgomp libstdc++:libcxx g++:gpp"
replaces="libstdc++"
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}"
+ # fixup flags. seems gcc treats CPPFLAGS as global without
+ # _FOR_xxx variants. wrap it in CFLAGS and CXXFLAGS.
+ export CFLAGS="$CPPFLAGS $CFLAGS"
+ export CXXFLAGS="$CPPFLAGS $CXXFLAGS"
+ unset CPPFLAGS
+
+ # reset flags and cc for build
+ export CC_FOR_BUILD="gcc"
+ export CXX_FOR_BUILD="g++"
+ export CFLAGS_FOR_BUILD=" "
+ export CXXFLAGS_FOR_BUILD=" "
+ export LDFLAGS_FOR_BUILD=" "
LANG_OBJC=off
LANG_JAVA=off
@@ -78,6 +81,9 @@ source="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-$pkgver.tar.bz2
gcc-4.8-dynamic-linker.patch
boehem-gc-uclibc.patch
gcc-pure64.patch
+
+ gcc-4.8-build-args.patch
+ fix-cxxflags-passing.patch
"
# gcc-go.patch
@@ -178,6 +184,8 @@ build() {
if [ "${CHOST#*musl}" != "$CHOST" ]; then
# musl does not support mudflap
_arch_configure="$_arch_configure --disable-mudflap --disable-libmudflap"
+ # gcc does not detect musl's ssp support, force it
+ export gcc_cv_libc_provides_ssp=yes
else
_arch_configure="$_arch_configure --without-system-libunwind"
fi
@@ -468,7 +476,9 @@ ab83248e10b2bf4b3d9240de0fefb52b pt_gnu_eh_frame.patch
32e8e4c0e23ed8f5de95a591cb30f1da gcc-4.6-pr32219.patch
79d00ee1284fac5192456f7f7d3908aa gcc-4.8-dynamic-linker.patch
2c6cb49bb9bfd8b6e690222e66ccc901 boehem-gc-uclibc.patch
-2e2b787bb988d9007c9f7ce42178dfe6 gcc-pure64.patch"
+2e2b787bb988d9007c9f7ce42178dfe6 gcc-pure64.patch
+0a2041bbf83648e6c4f6d3484f7249ca gcc-4.8-build-args.patch
+4aea37d334ab00bb6bba37cd8c481367 fix-cxxflags-passing.patch"
sha256sums="545b44be3ad9f2c4e90e6880f5c9d4f0a8f0e5f67e1ffb0d45da9fa01bb05813 gcc-4.8.1.tar.bz2
4aa0ab0f114b0ff8af5d0c19c18930e3fcd5e5b0956f56ca24e58e5a243964b1 gcc-4.8.1-piepatches-v0.5.6.tar.bz2
f6c7cb99beead66dd4d06f7004c5731a9360330cbe878ce79792c618e008eed2 gcc-4.4.3-specs-0.2.0.tar.bz2
@@ -489,7 +499,9 @@ da6bbb5dc654d5e1df8ecae5c9ebb56265426c405931f14f5878248b8c79f78d 51_all_libiber
89207a8b62137a857ee2c43499d6b5247d37b530d1338844dbb330a6846b2ad2 gcc-4.6-pr32219.patch
f3863b997acf8fdf5ad1d3626b41a8a0670b896505e9b7afb517916c7599fb1c gcc-4.8-dynamic-linker.patch
02751ccf223dcfc898c0ce2214cd0859d275e90b742f1a66e38db5c50f94b38c boehem-gc-uclibc.patch
-f5473c6aea96d5137defd68898ba31042944a3f3ed26c05b964a40bd876c6f47 gcc-pure64.patch"
+f5473c6aea96d5137defd68898ba31042944a3f3ed26c05b964a40bd876c6f47 gcc-pure64.patch
+bd7a6f514fcc457f29e5fda157203f3bcd013aeba5d53b3459196eef3ce752ab gcc-4.8-build-args.patch
+a395ba4cf047c48cac56985726fddf0948f4425c9f1a0c9ddba1812b2b3d8300 fix-cxxflags-passing.patch"
sha512sums="1becc874aad77a469069b6d9da4158aae9e013e24afa9364fe4feff9a5094d0673ee7694b3840e892c860f73a56b3ece6174338a8214438c42b9f86dd6c35ea7 gcc-4.8.1.tar.bz2
274e16ef5136348415898d4e5a3bc71763078de8ae7c18645e8b07f54d705609b08c0efadbdb55117fdfb5f6490529b446d09def448174c2747372829d029a9d gcc-4.8.1-piepatches-v0.5.6.tar.bz2
779ecb0a064d2138b54569c8ae501975b8a6b72e5a3acbf8597619a8db77ee42ef9b0e62608d5192a15e4393e7dfc009bb50b994782236faa744b2c46b5fe517 gcc-4.4.3-specs-0.2.0.tar.bz2
@@ -510,4 +522,6 @@ e3edf75df1f27af8771bd263e1bd607f6207c4eb5b2a5e11032577deba43ea201825e3b5008a7201
9fc5e32f2573ae67b6cf22119d636d10a47c42718635bceff7d457a93a3f664ae1ed10e154f70964ba2d26b0de04f879a8c05de6411112760d40433373dd0a80 gcc-4.6-pr32219.patch
db84b6582950378116723116be4f277881f7bdd05add216c58c2b86c0fb3a70abeb7798507a74a64b9b949d5b311167bd4df84a048d2d2d32f5836ea1d34c42e gcc-4.8-dynamic-linker.patch
e1d6a450dfb40b134ad7f759c4c10174d2490b0093fe47cb33479245f26a3a8c54ebcf6255943c0ccfcb5095600d1c05e530baeed35609c8ffe75caac8e57c49 boehem-gc-uclibc.patch
-4a5aeff0399782c752e6e3f2f48d984b2056dfb5d229b23a24eee1562d241339989b2203f139821cfc03c9b25c9bd7da6ccbbdc7a09d242e4de7f0d606c6f63c gcc-pure64.patch"
+4a5aeff0399782c752e6e3f2f48d984b2056dfb5d229b23a24eee1562d241339989b2203f139821cfc03c9b25c9bd7da6ccbbdc7a09d242e4de7f0d606c6f63c gcc-pure64.patch
+abe9aaf9aa956058d0386a4396a511d176a46bb3906b90e952383646cdc158cbeb0a5dc616a1ccb1ca7d49fd0b5e351532aa15a3b13362abbf1ca4266f54a687 gcc-4.8-build-args.patch
+35d6d59f0b7b968f282f56767c9e0823a7bdc5aa0d450aca50fbd802649a7ca608b47671244a3faa208a9b0d6832cabb5a22724157dc817b2c0ad63d09f93282 fix-cxxflags-passing.patch"
diff --git a/main/gcc/fix-cxxflags-passing.patch b/main/gcc/fix-cxxflags-passing.patch
new file mode 100644
index 0000000000..8eb1de77d5
--- /dev/null
+++ b/main/gcc/fix-cxxflags-passing.patch
@@ -0,0 +1,10 @@
+--- gcc-4.8.1/Makefile.in.orig
++++ gcc-4.8.1/Makefile.in
+@@ -169,6 +169,7 @@
+ # built for the build system to override those in BASE_FLAGS_TO_PASSS.
+ EXTRA_BUILD_FLAGS = \
+ CFLAGS="$(CFLAGS_FOR_BUILD)" \
++ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)" \
+ LDFLAGS="$(LDFLAGS_FOR_BUILD)"
+
+ # This is the list of directories to built for the host system.
diff --git a/main/gcc/gcc-4.8-build-args.patch b/main/gcc/gcc-4.8-build-args.patch
new file mode 100644
index 0000000000..c27e009619
--- /dev/null
+++ b/main/gcc/gcc-4.8-build-args.patch
@@ -0,0 +1,41 @@
+When cross compiling a target gcc, target flags may be used on the host
+
+Configure identifies a number of warning flags (WARN_CFLAGS and
+WARN_CXXFLAGS) from the $CC value. The cross compiler may be different
+from the host compiler and may not support the same set of flags. This
+leads to problems such as:
+
+cc1plus: error: unrecognized command line option "-Wno-narrowing"
+cc1plus: error: unrecognized command line option "-Wno-overlength-strings"
+
+Work around this problem by removing the warning flags from the
+BUILD_CXXFLAGS value, in a way similar to the BUILD_CFLAGS.
+
+Upstream-Status: Pending
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+Index: gcc-4.8.0/gcc/configure
+===================================================================
+--- gcc-4.8.0.orig/gcc/configure
++++ gcc-4.8.0/gcc/configure
+@@ -11720,6 +10581,7 @@ STMP_FIXINC=stmp-fixinc
+ if test x$build != x$host || test "x$coverage_flags" != x
+ then
+ BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
++ BUILD_CXXFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
+ BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)'
+ fi
+
+Index: gcc-4.8.0/gcc/configure.ac
+===================================================================
+--- gcc-4.8.0.orig/gcc/configure.ac
++++ gcc-4.8.0/gcc/configure.ac
+@@ -1901,6 +1901,7 @@ STMP_FIXINC=stmp-fixinc AC_SUBST(STMP_F
+ if test x$build != x$host || test "x$coverage_flags" != x
+ then
+ BUILD_CFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
++ BUILD_CXXFLAGS='$(INTERNAL_CFLAGS) $(T_CFLAGS) $(CFLAGS_FOR_BUILD)'
+ BUILD_LDFLAGS='$(LDFLAGS_FOR_BUILD)'
+ fi
+