[PATCH] clang compatibility: fpu options

Volodymyr Turanskyy <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <DB3PR08MB8844430E9893289BA72C6539E01B2@DB3PR08MB8844.eurprd08.prod.outlook.com>
Hi,

Following up on the RFC [1], please find attached a patch that adds a check to avoid extra assembler directives that are not compatible with clang and are not needed by clang.

References

  1.  https://sourceware.org/pipermail/newlib/2025/021452.html

Sincerely,

Volodymyr Turanskyy | Principal Software Engineer | CE SW LLVM Team
newlib_fpu.diff (application/octet-stream, 542 B)
diff --git a/newlib/libc/machine/arm/setjmp.S b/newlib/libc/machine/arm/setjmp.S
index 0070f17cd..a53f7918e 100644
--- a/newlib/libc/machine/arm/setjmp.S
+++ b/newlib/libc/machine/arm/setjmp.S
@@ -78,10 +78,10 @@
     covers all the cases we need in this file for hardware
     floating-point and should be compatible with all required FPUs
     that we need to support.  */
-# if __ARM_FP
+# if __ARM_FP && !__clang__
 	.fpu vfpxd
 # endif
-# if __ARM_FEATURE_MVE
+# if __ARM_FEATURE_MVE && !__clang__
 	.arch_extension mve
 # endif
 #endif
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.