diff options
author | Alastair D'Silva <alastair@d-silva.org> | 2016-12-24 01:26:05 +1100 |
---|---|---|
committer | Alastair D'Silva <alastair@d-silva.org> | 2017-01-10 10:51:32 +1100 |
commit | 14896a2600f99ddb86d7c100ec8e57557c013438 (patch) | |
tree | 941ba5f4e19c5475754fce22348fb5a73cbbb294 /scripts/build/libc/newlib.sh | |
parent | 2ac39621bcb8fa205029591d3e6c67d66080e001 (diff) | |
download | crosstool-ng-14896a2600f99ddb86d7c100ec8e57557c013438.tar.gz crosstool-ng-14896a2600f99ddb86d7c100ec8e57557c013438.tar.bz2 crosstool-ng-14896a2600f99ddb86d7c100ec8e57557c013438.zip |
Support building Newlib with Link Time Optimisation
Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
Diffstat (limited to 'scripts/build/libc/newlib.sh')
-rw-r--r-- | scripts/build/libc/newlib.sh | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh index 442b92c0..0a87581e 100644 --- a/scripts/build/libc/newlib.sh +++ b/scripts/build/libc/newlib.sh @@ -116,6 +116,9 @@ ENABLE_TARGET_OPTSPACE:target-optspace [ "${CT_LIBC_NEWLIB_EXTRA_SECTIONS}" = "y" ] && \ CT_LIBC_NEWLIB_TARGET_CFLAGS="${CT_LIBC_NEWLIB_TARGET_CFLAGS} -ffunction-sections -fdata-sections" + [ "${CT_LIBC_NEWLIB_LTO}" = "y" ] && \ + CT_LIBC_NEWLIB_TARGET_CFLAGS="${CT_LIBC_NEWLIB_TARGET_CFLAGS} -flto" + [ "${CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE}" = "y" ] && newlib_opts+=("--enable-target-optspace") cflags_for_target="${CT_TARGET_CFLAGS} ${CT_LIBC_NEWLIB_TARGET_CFLAGS}" @@ -125,16 +128,16 @@ ENABLE_TARGET_OPTSPACE:target-optspace # build : not used # host : the machine building newlib # target : the machine newlib runs on - CT_DoExecLog CFG \ - CC_FOR_BUILD="${CT_BUILD}-gcc" \ - CFLAGS_FOR_TARGET="${cflags_for_target}" \ - AR=${CT_TARGET}-ar \ - RANLIB=${CT_TARGET}-ranlib \ - "${CT_SRC_DIR}/newlib-${CT_LIBC_VERSION}/configure" \ - --host=${CT_BUILD} \ - --target=${CT_TARGET} \ - --prefix=${CT_PREFIX_DIR} \ - "${newlib_opts[@]}" \ + CT_DoExecLog CFG \ + CC_FOR_BUILD="${CT_BUILD}-gcc" \ + CFLAGS_FOR_TARGET="${cflags_for_target}" \ + AR_FOR_TARGET="`which ${CT_TARGET}-gcc-ar`" \ + RANLIB_FOR_TARGET="`which ${CT_TARGET}-gcc-ranlib`" \ + "${CT_SRC_DIR}/newlib-${CT_LIBC_VERSION}/configure" \ + --host=${CT_BUILD} \ + --target=${CT_TARGET} \ + --prefix=${CT_PREFIX_DIR} \ + "${newlib_opts[@]}" \ "${CT_LIBC_NEWLIB_EXTRA_CONFIG_ARRAY[@]}" CT_DoLog EXTRA "Building C library" |