From: Richard Biener Date: Fri, 13 Jan 2023 08:01:12 +0000 (+0100) Subject: LoongArch: Don't add crtfastmath.o for -shared X-Git-Tag: basepoints/gcc-14~1783 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=476efe839e069e556b4b03cf6ec8c18870867960;p=thirdparty%2Fgcc.git LoongArch: Don't add crtfastmath.o for -shared Don't add crtfastmath.o for -shared to avoid altering the FP environment when loading a shared library. PR target/55522 * config/loongarch/gnu-user.h (GNU_USER_TARGET_MATHFILE_SPEC): Don't add crtfastmath.o for -shared. --- diff --git a/gcc/config/loongarch/gnu-user.h b/gcc/config/loongarch/gnu-user.h index fb7106fd85f6..aecaa02a1999 100644 --- a/gcc/config/loongarch/gnu-user.h +++ b/gcc/config/loongarch/gnu-user.h @@ -49,7 +49,7 @@ along with GCC; see the file COPYING3. If not see /* Similar to standard Linux, but adding -ffast-math support. */ #undef GNU_USER_TARGET_MATHFILE_SPEC #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}}" #undef LIB_SPEC #define LIB_SPEC GNU_USER_TARGET_LIB_SPEC