diff options
Diffstat (limited to 'scripts/build/libc')
-rw-r--r-- | scripts/build/libc/glibc.sh | 5 | ||||
-rw-r--r-- | scripts/build/libc/musl.sh | 3 | ||||
-rw-r--r-- | scripts/build/libc/newlib.sh | 5 |
3 files changed, 10 insertions, 3 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}" \ diff --git a/scripts/build/libc/musl.sh b/scripts/build/libc/musl.sh index 807b3bd8..05da1d40 100644 --- a/scripts/build/libc/musl.sh +++ b/scripts/build/libc/musl.sh @@ -98,7 +98,8 @@ musl_backend_once() { # host : same as --target # target : the machine musl runs on CT_DoExecLog CFG \ - CFLAGS="${extra_cflags[*]}" \ + CFLAGS="${CT_TARGET_CFLAGS} ${extra_cflags[*]}" \ + LDFLAGS="${CT_TARGET_LDFLAGS}" \ CROSS_COMPILE="${CT_TARGET}-" \ ${CONFIG_SHELL} \ ${src_dir}/configure \ diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh index 95ab7910..ddecdb19 100644 --- a/scripts/build/libc/newlib.sh +++ b/scripts/build/libc/newlib.sh @@ -55,7 +55,7 @@ newlib_main() yn_args="IO_POS_ARGS:newlib-io-pos-args IO_C99FMT:newlib-io-c99-formats IO_LL:newlib-io-long-long -NEWLIB_REGISTER_FINI:newlib-register-fini +REGISTER_FINI:newlib-register-fini NANO_MALLOC:newlib-nano-malloc NANO_FORMATTED_IO:newlib-nano-formatted-io ATEXIT_DYNAMIC_ALLOC:newlib-atexit-dynamic-alloc @@ -63,7 +63,10 @@ GLOBAL_ATEXIT:newlib-global-atexit LITE_EXIT:lite-exit REENT_SMALL:newlib-reent-small MULTITHREAD:newlib-multithread +RETARGETABLE_LOCKING:newlib-retargetable-locking WIDE_ORIENT:newlib-wide-orient +FSEEK_OPTIMIZATION:newlib-fseek-optimization +FVWRITE_IN_STREAMIO:newlib-fvwrite-in-streamio UNBUF_STREAM_OPT:newlib-unbuf-stream-opt ENABLE_TARGET_OPTSPACE:target-optspace " |