summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAlexey Neyman <stilor@att.net>2020-02-16 23:22:44 (GMT)
committerGitHub <noreply@github.com>2020-02-16 23:22:44 (GMT)
commit4fa0ba100b8924b27942ff253c5474c655427027 (patch)
tree40afe8c249a6476998715ecbf7db8625f65b6342 /scripts
parent4897426202e57d894eedaa01440e0a606829bb5c (diff)
parentbd0ea7ed21f140d4e911ff4a63693b54a455c349 (diff)
Merge pull request #1270 from nolange/prevent_glibc_cflags_override
prevent the glibc build from overwriting flags
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build/libc/glibc.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh
index 221752d..31fa067 100644
--- a/scripts/build/libc/glibc.sh
+++ b/scripts/build/libc/glibc.sh
@@ -199,7 +199,7 @@ glibc_backend_once()
printf "%s\n" "${CT_GLIBC_CONFIGPARMS}" > configparms
# glibc can't be built without -O2 (reference needed!)
- glibc_cflags+=" -O2"
+ glibc_cflags+=" -g -O2"
case "${CT_GLIBC_ENABLE_FORTIFIED_BUILD}" in
y) ;;
@@ -260,9 +260,12 @@ glibc_backend_once()
# CFLAGS are only applied when compiling .c files. .S files are compiled with ASFLAGS,
# but they are not passed by configure. Thus, pass everything in CC instead.
+ # The CFLAGS variable needs to be cleared, else the default "-g -O2"
+ # would override previous flags.
CT_DoExecLog CFG \
BUILD_CC=${CT_BUILD}-gcc \
CC="${CT_TARGET}-${CT_CC} ${glibc_cflags}" \
+ CFLAGS="" \
AR=${CT_TARGET}-ar \
RANLIB=${CT_TARGET}-ranlib \
"${CONFIG_SHELL}" \