[libc-commits] [libc] [libc] Fix Darwin aarch64 fenv and sigsetjmp build support (PR #192079)

Kacper Fiedorowicz via libc-commits libc-commits at lists.llvm.org
Thu Sep 3 16:55:45 PDT 2026


================
@@ -27,7 +27,11 @@ namespace LIBC_NAMESPACE_DECL {
 #ifdef LIBC_COMPILER_IS_GCC
 [[gnu::nothrow]]
 #endif
-void longjmp(jmp_buf buf, int val);
+void longjmp(jmp_buf buf, int val)
+#if defined(LIBC_COPT_PUBLIC_PACKAGING) && defined(__APPLE__)
+    asm("_longjmp")
+#endif
----------------
fenze wrote:

`LLVM_LIBC_ADD_FUNCTION_C_ALIAS(longjmp, _longjmp)` is not equivalent here. In a Mach-O public-
packaging build, the C function longjmp is emitted as the _longjmp symbol. The
asm("_longjmp") annotation binds the namespaced internal declaration used by siglongjmp to
that existing symbol. Adding a C alias named _longjmp would instead emit the distinct Mach-O
symbol __longjmp and would not satisfy the internal reference. I kept the annotation and
added a comment clarifying this (the same applies to setjmp).


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


More information about the libc-commits mailing list