aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorliuhongt <hongtao.liu@intel.com>2022-12-15 09:38:08 +0800
committerliuhongt <hongtao.liu@intel.com>2022-12-19 16:47:21 +0800
commit88b531d0323fc1fc4173f1975d6a4f408a096f8b (patch)
tree902dec4816057fef03e3b27b56e64dbded1593b2 /gcc/config
parente4337398620098f96a7680ce748c9da178514acf (diff)
downloadgcc-88b531d0323fc1fc4173f1975d6a4f408a096f8b.zip
gcc-88b531d0323fc1fc4173f1975d6a4f408a096f8b.tar.gz
gcc-88b531d0323fc1fc4173f1975d6a4f408a096f8b.tar.bz2
x86: Don't add crtfastmath.o for -shared
Don't add crtfastmath.o for -shared to avoid changing the MXCSR register when loading a shared library. crtfastmath.o will be used only when building executables. PR target/55522 * config/i386/gnu-user-common.h (GNU_USER_TARGET_MATHFILE_SPEC): Don't add crtfastmath.o for -shared. * doc/invoke.texi (-shared): Add related documentation.
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/gnu-user-common.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/config/i386/gnu-user-common.h b/gcc/config/i386/gnu-user-common.h
index cab9be2..9910cd6 100644
--- a/gcc/config/i386/gnu-user-common.h
+++ b/gcc/config/i386/gnu-user-common.h
@@ -47,7 +47,7 @@ along with GCC; see the file COPYING3. If not see
/* Similar to standard GNU userspace, but adding -ffast-math support. */
#define GNU_USER_TARGET_MATHFILE_SPEC \
- "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
+ "%{Ofast|ffast-math|funsafe-math-optimizations:%{!shared:crtfastmath.o%s}} \
%{mpc32:crtprec32.o%s} \
%{mpc64:crtprec64.o%s} \
%{mpc80:crtprec80.o%s}"