]> gcc.gnu.org Git - gcc.git/commitdiff
aarch64: Don't add crtfastmath.o for -shared
authorRichard Biener <rguenther@suse.de>
Fri, 13 Jan 2023 07:47:59 +0000 (08:47 +0100)
committerRichard Biener <rguenther@suse.de>
Fri, 13 Jan 2023 11:14:17 +0000 (12:14 +0100)
Don't add crtfastmath.o for -shared to avoid altering the FP
environment when loading a shared library.

PR target/55522
* config/aarch64/aarch64-elf-raw.h (ENDFILE_SPEC): Don't add
crtfastmath.o for -shared.
* config/aarch64/aarch64-freebsd.h (GNU_USER_TARGET_MATHFILE_SPEC):
Likewise.
* config/aarch64/aarch64-linux.h (GNU_USER_TARGET_MATHFILE_SPEC):
Likewise.

gcc/config/aarch64/aarch64-elf-raw.h
gcc/config/aarch64/aarch64-freebsd.h
gcc/config/aarch64/aarch64-linux.h

index d4d820a9d54c3dd8dd52c4124278c47ada104236..fa5b4527ea022cb1102dce78873956265d0e5832 100644 (file)
@@ -25,7 +25,7 @@
 #define STARTFILE_SPEC " crti%O%s crtbegin%O%s crt0%O%s"
 #define ENDFILE_SPEC \
   " crtend%O%s crtn%O%s " \
-  "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
+  "%{Ofast|ffast-math|funsafe-math-optimizations:%{!shared:crtfastmath.o%s}}"
 
 #ifndef LINK_SPEC
 #define LINK_SPEC "%{h*}                       \
index 13beb3781b61afd82d767884f3c16ff8eead09cc..2cf9cf6f046d6e003d93120ec638c110063c029c 100644 (file)
@@ -50,7 +50,7 @@
 #define LINK_SPEC FBSD_TARGET_LINK_SPEC AARCH64_ERRATA_LINK_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 ENDFILE_SPEC
 #define ENDFILE_SPEC \
index 5e4553d79f5053f2da0eb381e0805f47aec964ae..61ed4067fc5bcbaff1a02e76a66378d12798e4ac 100644 (file)
@@ -50,7 +50,7 @@
 #define LINK_SPEC LINUX_TARGET_LINK_SPEC AARCH64_ERRATA_LINK_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 ENDFILE_SPEC
 #define ENDFILE_SPEC   \
This page took 0.068868 seconds and 5 git commands to generate.