aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorGuillermo E. Martinez <guillermo.e.martinez@oracle.com>2022-06-13 08:34:26 -0500
committerChris Packham <judge.packham@gmail.com>2022-06-21 20:33:34 +1200
commit8a1ef667769653eb5b00c7d097321e58fdcf602e (patch)
treee2415732ad68ff44d8e8e47e3fc16faa942e2d89 /scripts
parent618affc78902e86815c908e08a1d0c51832ce7ce (diff)
downloadcrosstool-ng-8a1ef667769653eb5b00c7d097321e58fdcf602e.tar.gz
crosstool-ng-8a1ef667769653eb5b00c7d097321e58fdcf602e.tar.bz2
crosstool-ng-8a1ef667769653eb5b00c7d097321e58fdcf602e.zip
glibc: configure adding debug symbols in glibc build
After building the cross toolchain and compile a simple C program, objdump reports debug information even though -g modifier was not used. These debug segments are in glibc library and CRT files. So a new config entry: CT_GLIBC_ENABLE_DEBUG was added to control when we want to add debug information to glibc, by default is enabled. Signed-off-by: Guillermo E. Martinez <guillermo.e.martinez@oracle.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/libc/glibc.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh
index 2afefd41..e400b219 100644
--- a/scripts/build/libc/glibc.sh
+++ b/scripts/build/libc/glibc.sh
@@ -131,8 +131,12 @@ glibc_backend_once()
# Pre-seed the configparms file with values from the config option
printf "%s\n" "${CT_GLIBC_CONFIGPARMS}" > configparms
+ if [ "${CT_GLIBC_ENABLE_DEBUG}" = "y" ]; then
+ glibc_cflags+=" -g"
+ fi
+
# glibc can't be built without -O2 (reference needed!)
- glibc_cflags+=" -g -O2"
+ glibc_cflags+=" -O2"
if [ "${CT_GLIBC_ENABLE_COMMON_FLAG}" = "y" ]; then
glibc_cflags+=" -fcommon"