aboutsummaryrefslogtreecommitdiffstats
path: root/build-gcc.sh
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2015-11-02 17:12:51 (GMT)
committerThan McIntosh <thanm@google.com>2015-11-02 17:12:51 (GMT)
commita1eeec631ca1d654d00995315a150dfdc59512b8 (patch)
treea03756360b7f4ec8b23d25a091b207744a068dbd /build-gcc.sh
parent37248b072c78201ba30cf46e9c7d423aa9423956 (diff)
downloadtoolchain_gcc-a1eeec631ca1d654d00995315a150dfdc59512b8.zip
toolchain_gcc-a1eeec631ca1d654d00995315a150dfdc59512b8.tar.gz
toolchain_gcc-a1eeec631ca1d654d00995315a150dfdc59512b8.tar.bz2
Add --build-debuggable option to build-gcc.sh
Add an option to build-gcc.sh to build a more debuggable (-O0 -g, not stripped) copy of gcc. Change-Id: Ieabcfc8b02796041eb89fa4c1b9614994466a5b6
Diffstat (limited to 'build-gcc.sh')
-rwxr-xr-xbuild-gcc.sh27
1 files changed, 18 insertions, 9 deletions
diff --git a/build-gcc.sh b/build-gcc.sh
index 6a48195..0b6e2a6 100755
--- a/build-gcc.sh
+++ b/build-gcc.sh
@@ -73,6 +73,10 @@ register_var_option "--package-dir=<path>" PACKAGE_DIR "Create archive tarball i
ENABLE_LANGUAGES="c,c++"
register_var_option "--enable-languages=<name>" ENABLE_LANGUAGES "Experimental: specify which languages to build"
+BUILD_DEBUGGABLE="no"
+register_var_option "--build-debuggable=<yes|no>" BUILD_DEBUGGABLE "Experimental: build debuggable version of gcc"
+
+
register_jobs_option
register_canadian_option
register_try64_option
@@ -229,7 +233,11 @@ export CXXFLAGS_FOR_TARGET="$ABI_CXXFLAGS_FOR_TARGET"
export ABI=$HOST_GMP_ABI
# Note that the following flags only apply for "build" in canadian
-CFLAGS_FOR_BUILD="-O2 -s"
+if [ "$BUILD_DEBUGGABLE" = "yes" ] ; then
+ CFLAGS_FOR_BUILD="-O0 -g"
+else
+ CFLAGS_FOR_BUILD="-O2 -s"
+fi
LDFLAGS_FOR_BUILD=
if [ "$MINGW" = "yes" ] ; then
@@ -470,14 +478,15 @@ run rm -rf $TOOLCHAIN_INSTALL_PATH/$ABI_CONFIGURE_TARGET/lib/*/libstdc++.*
run rm -rf $TOOLCHAIN_INSTALL_PATH/$ABI_CONFIGURE_TARGET/include/c++
# strip binaries to reduce final package size
-test -z "$STRIP" && STRIP=strip
-
-run $STRIP $TOOLCHAIN_INSTALL_PATH/bin/*
-run $STRIP $TOOLCHAIN_INSTALL_PATH/$ABI_CONFIGURE_TARGET/bin/*
-run $STRIP $TOOLCHAIN_INSTALL_PATH/libexec/gcc/*/*/cc1$HOST_EXE
-run $STRIP $TOOLCHAIN_INSTALL_PATH/libexec/gcc/*/*/cc1plus$HOST_EXE
-run $STRIP $TOOLCHAIN_INSTALL_PATH/libexec/gcc/*/*/collect2$HOST_EXE
-run $STRIP $TOOLCHAIN_INSTALL_PATH/libexec/gcc/*/*/lto*$HOST_EXE
+if [ "$BUILD_DEBUGGABLE" != "yes" ] ; then
+ test -z "$STRIP" && STRIP=strip
+ run $STRIP $TOOLCHAIN_INSTALL_PATH/bin/*
+ run $STRIP $TOOLCHAIN_INSTALL_PATH/$ABI_CONFIGURE_TARGET/bin/*
+ run $STRIP $TOOLCHAIN_INSTALL_PATH/libexec/gcc/*/*/cc1$HOST_EXE
+ run $STRIP $TOOLCHAIN_INSTALL_PATH/libexec/gcc/*/*/cc1plus$HOST_EXE
+ run $STRIP $TOOLCHAIN_INSTALL_PATH/libexec/gcc/*/*/collect2$HOST_EXE
+ run $STRIP $TOOLCHAIN_INSTALL_PATH/libexec/gcc/*/*/lto*$HOST_EXE
+fi
# Some of the files should really be links to save space.
# This is mostly to reduce the size of the Windows zip archives,