summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2021-06-04 08:45:10 -0400
committerSolomon Peachy <pizza@shaftnet.org>2021-06-04 10:05:05 -0400
commit62098a0cc9300e3aa7192615d05d52b92484972c (patch)
treeadbc03a149ff6a67d99fc8ae8024847a83244cbc /tools
parent49dfc8be2729b1b38f716e741d748b881472adeb (diff)
toolchain: To build GCC for hosted targets, we need -std=gnu++11 for stage2.
But for stage1 (and non-hosted targets) we can stick with -std=gnu++03. This keeps everyone happy with no apparent regerssions on older host compilers. Change-Id: I1300574557bc8d4d13e5cf07d4ae85645998f071
Diffstat (limited to 'tools')
-rwxr-xr-xtools/rockboxdev.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/rockboxdev.sh b/tools/rockboxdev.sh
index a5dfcc3f94..c45ed0b615 100755
--- a/tools/rockboxdev.sh
+++ b/tools/rockboxdev.sh
@@ -354,6 +354,14 @@ buildtool() {
;;
esac
+ if [ "$RESTART_STEP" == "gcc-stage1" ] ; then
+ CXXFLAGS="-std=gnu++03"
+ elif [ "$RESTART_STEP" == "gcc-stage2" ] ; then
+ CXXFLAGS="-std=gnu++11"
+ else
+ CXXFLAGS=""
+ fi
+
if [ "$tool" == "zlib" ]; then
echo "ROCKBOXDEV: $toolname/configure"
# NOTE glibc requires to be compiled with optimization
@@ -363,7 +371,7 @@ buildtool() {
elif [ "$config_opt" != "NO_CONFIGURE" ]; then
echo "ROCKBOXDEV: $toolname/configure"
# NOTE glibc requires to be compiled with optimization
- CFLAGS='-U_FORTIFY_SOURCE -fgnu89-inline -O2' CXXFLAGS='-std=c++03' run_cmd "$logfile" \
+ CFLAGS='-U_FORTIFY_SOURCE -fgnu89-inline -O2' CXXFLAGS="$CXXFLAGS" run_cmd "$logfile" \
"$cfg_dir/configure" "--prefix=$prefix" \
--disable-docs $config_opt
fi
@@ -473,7 +481,7 @@ build() {
./configure --prefix=$prefix $configure_params
;;
*)
- CFLAGS='-U_FORTIFY_SOURCE -fgnu89-inline -fcommon' CXXFLAGS='-std=c++03' ../$toolname-$version/configure --target=$target --prefix=$prefix --enable-languages=c --disable-libssp --disable-docs $configure_params
+ CFLAGS='-U_FORTIFY_SOURCE -fgnu89-inline -fcommon' CXXFLAGS='-std=gnu++03' ../$toolname-$version/configure --target=$target --prefix=$prefix --enable-languages=c --disable-libssp --disable-docs $configure_params
;;
esac
@@ -634,11 +642,13 @@ build_linux_toolchain () {
# build glibc using the first stage cross compiler
# we need to set the prefix to /usr because the glibc runs on the actual
# target and is indeed installed in /usr
+ RESTART_STEP="glibc" \
prefix="/usr" \
buildtool "glibc" "$glibc_ver" "--target=$target --host=$target --build=$MACHTYPE \
--with-__thread --with-headers=$sysroot/usr/include $glibc_opts" \
"" "install install_root=$sysroot"
# build stage 2 compiler
+ RESTART_STEP="gcc-stage2" \
buildtool "gcc" "$gcc_ver" "$gcc_opts --enable-languages=c,c++ --target=$target \
--with-sysroot=$sysroot" "" ""
}