diff options
author | Alexey Neyman <stilor@att.net> | 2018-05-25 23:57:29 -0700 |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2018-06-05 00:16:37 -0700 |
commit | 07ec87f14f2bb078235a7db25d4a923e9319f53c (patch) | |
tree | 2b1f357525d71bdc1ca609ce1ae69c938e7fd057 /scripts/build/cc | |
parent | ec384f2b9fa1337c7bbcd7ed7e972516bd696b3b (diff) | |
download | crosstool-ng-07ec87f14f2bb078235a7db25d4a923e9319f53c.tar.gz crosstool-ng-07ec87f14f2bb078235a7db25d4a923e9319f53c.tar.bz2 crosstool-ng-07ec87f14f2bb078235a7db25d4a923e9319f53c.zip |
Avoid adding arch/cpu/tune flags for target to GCC build
... as it may need to override them for building runtime-selectable code.
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/build/cc')
-rw-r--r-- | scripts/build/cc/gcc.sh | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index a6bf1ac5..f38fd7f1 100644 --- a/scripts/build/cc/gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -171,13 +171,13 @@ cc_gcc_multilib_housekeeping() { fi done CT_DoLog DEBUG "Filtered target CFLAGS: '${new_cflags}'" - CT_EnvModify CT_TARGET_CFLAGS "${new_cflags} ${CT_TARGET_CFLAGS}" + CT_EnvModify CT_ALL_TARGET_CFLAGS "${new_cflags} ${CT_TARGET_CFLAGS}" CT_EnvModify CT_ARCH_TARGET_CFLAGS_MULTILIB "" # Currently, the only LDFLAGS are endianness-related CT_DoLog DEBUG "Configured target LDFLAGS: '${CT_ARCH_TARGET_LDFLAGS_MULTILIB}'" if [ "${ml_endian}" != "seen" ]; then - CT_EnvModify CT_TARGET_LDFLAGS "${CT_ARCH_TARGET_LDFLAGS_MULTILIB} ${CT_TARGET_LDFLAGS}" + CT_EnvModify CT_ALL_TARGET_LDFLAGS "${CT_ARCH_TARGET_LDFLAGS_MULTILIB} ${CT_TARGET_LDFLAGS}" CT_EnvModify CT_ARCH_TARGET_LDFLAGS_MULTILIB "" fi CT_DoLog DEBUG "Filtered target LDFLAGS: '${CT_ARCH_TARGET_LDFLAGS_MULTILIB}'" @@ -561,7 +561,11 @@ do_gcc_core_backend() { fi fi - # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532) + # Use --with-local-prefix so older gccs don't look in /usr/local (http://gcc.gnu.org/PR10532). + # Pass only user-specified CFLAGS/LDFLAGS in CFLAGS_FOR_TARGET/LDFLAGS_FOR_TARGET: during + # the build of, for example, libatomic, GCC tried to compile multiple variants for runtime + # selection and passing architecture/CPU selectors, as detemined by crosstool-NG, may + # miscompile or outright fail. CT_DoExecLog CFG \ CC_FOR_BUILD="${CT_BUILD}-gcc" \ CFLAGS="${cflags}" \ @@ -1110,6 +1114,8 @@ do_gcc_backend() { fi fi + # NB: not using CT_ALL_TARGET_CFLAGS/CT_ALL_TARGET_LDFLAGS here! + # See do_gcc_core_backend for explanation. CT_DoExecLog CFG \ CC_FOR_BUILD="${CT_BUILD}-gcc" \ CFLAGS="${cflags}" \ |