]> git.ipfire.org Git - people/ms/gcc.git/commitdiff
solaris2: Don't add crtfastmath.o for -shared
authorRichard Biener <rguenther@suse.de>
Fri, 13 Jan 2023 07:56:28 +0000 (08:56 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 16 Jan 2023 13:30:55 +0000 (14:30 +0100)
Don't add crtfastmath.o for -shared to avoid altering the FP
environment when loading a shared library.

PR target/55522
* config/sol2.h (ENDFILE_SPEC): Don't add crtfastmath.o for -shared.

gcc/config/sol2.h

index 05dbaffa8eaeda3f22b6430454f60d24def1daa8..616f9b91212dea9b2c39257a5cb14c51a552f74d 100644 (file)
@@ -295,7 +295,7 @@ along with GCC; see the file COPYING3.  If not see
 
 #undef  ENDFILE_SPEC
 #define ENDFILE_SPEC \
-  "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} \
+  "%{Ofast|ffast-math|funsafe-math-optimizations:%{!shared:crtfastmath.o%s}} \
    %(endfile_arch) %(endfile_vtv) %(endfile_crtend) crtn.o%s"
 
 #undef LINK_ARCH32_SPEC_BASE