diff options
author | Norbert Lange <nolange79@gmail.com> | 2019-10-27 23:05:54 +0100 |
---|---|---|
committer | Norbert Lange <nolange79@gmail.com> | 2019-10-27 23:12:25 +0100 |
commit | bd0ea7ed21f140d4e911ff4a63693b54a455c349 (patch) | |
tree | 1aa4b705384f3326379359c5e4acf202bd3e7ab9 | |
parent | 3f461da11f1f8e9dcfdffef24e1982b5ffd10305 (diff) | |
download | crosstool-ng-bd0ea7ed21f140d4e911ff4a63693b54a455c349.tar.gz crosstool-ng-bd0ea7ed21f140d4e911ff4a63693b54a455c349.tar.bz2 crosstool-ng-bd0ea7ed21f140d4e911ff4a63693b54a455c349.zip |
prevent the glibc build from overwriting flags
The glibc will append the content of the CFLAGS variable,
overriding previous flags.
If unset, the CFLAGS variable is not empty, so explicitly set it.
Instead prepend the default CFLAGS flags.
Signed-off-by: Norbert Lange <nolange79@gmail.com>
-rw-r--r-- | scripts/build/libc/glibc.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/build/libc/glibc.sh b/scripts/build/libc/glibc.sh index 221752d0..31fa067f 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}" \ |