[clang] Disable FTZ/DAZ when compiling shared libraries by default. (PR #80475)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 2 11:05:36 PST 2024


================
@@ -1569,6 +1569,40 @@
 // RUN:        --gcc-toolchain="" \
 // RUN:        --sysroot=%S/Inputs/basic_linux_tree 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-NOCRTFASTMATH %s
+// Don't link crtfastmath.o with -shared
+// RUN: %clang --target=x86_64-unknown-linux -no-pie -### %s -ffast-math -shared \
+// RUN:        --gcc-toolchain="" \
----------------
MaskRay wrote:

You can drop `--gcc-toolchain=""`. Setting CMake `GCC_INSTALL_PREFIX` leads to a warning and the option will be removed.

-no-pie/-pie/-shared are mutual exclusive. The interaction is tested by other tests. For the purpose of fastmath, remove -no-pie when -shared is used.

https://github.com/llvm/llvm-project/pull/80475


More information about the cfe-commits mailing list