diff options
author | Than McIntosh <thanm@google.com> | 2015-11-02 19:45:25 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2015-11-02 19:45:25 +0000 |
commit | 8e2f2a79c592126555cd51ed017d05afdd3134cb (patch) | |
tree | 28557437f44c784ae89202d61118336b6a88f6d5 | |
parent | f38133c56787778bb451d4e18e5f90db2dbf541e (diff) | |
parent | a1eeec631ca1d654d00995315a150dfdc59512b8 (diff) | |
download | toolchain_gcc-8e2f2a79c592126555cd51ed017d05afdd3134cb.tar.gz toolchain_gcc-8e2f2a79c592126555cd51ed017d05afdd3134cb.tar.bz2 toolchain_gcc-8e2f2a79c592126555cd51ed017d05afdd3134cb.zip |
Merge "Add --build-debuggable option to build-gcc.sh"
-rwxr-xr-x | build-gcc.sh | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/build-gcc.sh b/build-gcc.sh index 3366e01f6..28cff4973 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, |