[compiler-rt] [llvm] [mlir] [compiler-rt] Don't provide `__arm_sme_state` for baremetal targets (PR #191434)
Benjamin Maxwell via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 13 08:29:35 PDT 2026
================
@@ -1,19 +1,19 @@
-// For baremetal platforms, we don't really initialise '__aarch64_cpu_features',
-// with exception of FEAT_SME that we can get from '__aarch64_sme_accessible'.
+#include <stdint.h>
-#if defined(COMPILER_RT_SHARED_LIB)
-__attribute__((weak))
-#endif
-extern _Bool
-__aarch64_sme_accessible(void);
+// The libc/runtime for baremetal targets should provide an implementation of
+// __arm_sme_state. LLVM's compiler-rt does not provide this function for
+// baremetal as checking CPU features is implementation defined.
+//
+// See:
+// https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#811__arm_sme_state
+extern struct {
+ uint64_t x0;
+ uint64_t x1;
+} __arm_sme_state(void);
----------------
MacDue wrote:
I still have a the same concern, as for applications with SME, that will mean the successfully build (so long as they don't directly reference `__arm_sme_state` – which is entirely possible). However, some ABI routines (such as `__arm_sme_save/restore`) will not function correctly, which could lead to unexpected results at runtime.
https://github.com/llvm/llvm-project/pull/191434
More information about the llvm-commits
mailing list