git: bae9fd0b3346 - main - Only use -fp-exception-behavior=maytrap on x86, for now

Dimitry Andric dim at FreeBSD.org
Sat Apr 10 14:04:16 UTC 2021


The branch main has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=bae9fd0b33462e9506c3ac3400089c6dbc4aee8f

commit bae9fd0b33462e9506c3ac3400089c6dbc4aee8f
Author:     Dimitry Andric <dim at FreeBSD.org>
AuthorDate: 2021-04-10 14:02:49 +0000
Commit:     Dimitry Andric <dim at FreeBSD.org>
CommitDate: 2021-04-10 14:02:58 +0000

    Only use -fp-exception-behavior=maytrap on x86, for now
    
    After 3b00222f156d, it turns out that clang only supports strict
    floating point semantics for SystemZ and x86 at the moment, while for
    other architectures it is still experimental.
    
    Therefore, only use -fp-exception-behavior=maytrap on x86 for now,
    otherwise this option results in "error: overriding currently
    unsupported use of floating point exceptions on this target
    [-Werror,-Wunsupported-floating-point-opt]" on other architectures.
    
    Fixes:          3b00222f156d
    PR:             254911
    MFC after:      1 week
---
 lib/msun/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/msun/Makefile b/lib/msun/Makefile
index 959dbd113ec1..0a486bb5a086 100644
--- a/lib/msun/Makefile
+++ b/lib/msun/Makefile
@@ -35,7 +35,8 @@ CFLAGS+=	-I${.CURDIR}/ld128
 CFLAGS+=	-I${.CURDIR}/${ARCH_SUBDIR}
 
 .include <bsd.compiler.mk>
-.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 100000
+.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 100000 && \
+    (${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386")
 # When using clang with x86_64 CPUs that support AVX, some floating point
 # transformations may raise exceptions that would not have been raised by the
 # original code. To avoid this, use the -fp-exception-behavior=maytrap flag,


More information about the dev-commits-src-all mailing list