[libc-commits] [libc] [libc] Fix issue with sigjmp_buf.h not being found (PR #150439)
via libc-commits
libc-commits at lists.llvm.org
Thu Jul 24 08:33:06 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: William Huynh (saturn691)
<details>
<summary>Changes</summary>
When trying to use <setjmp.h>, it will try to include llvm-libc-types/sigjmp_buf.h due to the way that headergen works. This commit creates a dummy file, as the real implementation is found in llvm-libc-types/jmp_buf.h.
---
Full diff: https://github.com/llvm/llvm-project/pull/150439.diff
3 Files Affected:
- (modified) libc/include/CMakeLists.txt (+1)
- (modified) libc/include/llvm-libc-types/CMakeLists.txt (+1)
- (added) libc/include/llvm-libc-types/sigjmp_buf.h (+15)
``````````diff
diff --git a/libc/include/CMakeLists.txt b/libc/include/CMakeLists.txt
index fafc1377926c5..120f3850b5cee 100644
--- a/libc/include/CMakeLists.txt
+++ b/libc/include/CMakeLists.txt
@@ -215,6 +215,7 @@ add_header_macro(
DEPENDS
.llvm_libc_common_h
.llvm-libc-types.jmp_buf
+ .llvm-libc-types.sigjmp_buf
)
add_header_macro(
diff --git a/libc/include/llvm-libc-types/CMakeLists.txt b/libc/include/llvm-libc-types/CMakeLists.txt
index b24c97301668a..c5c493ff7f5c5 100644
--- a/libc/include/llvm-libc-types/CMakeLists.txt
+++ b/libc/include/llvm-libc-types/CMakeLists.txt
@@ -83,6 +83,7 @@ add_header(siginfo_t HDR siginfo_t.h DEPENDS .union_sigval .pid_t .uid_t .clock_
add_header(sig_atomic_t HDR sig_atomic_t.h)
add_header(sigset_t HDR sigset_t.h DEPENDS libc.include.llvm-libc-macros.signal_macros)
add_header(jmp_buf HDR jmp_buf.h DEPENDS .sigset_t)
+add_header(sigjmp_buf HDR sigjmp_buf.h)
add_header(struct_sigaction HDR struct_sigaction.h DEPENDS .sigset_t .siginfo_t)
add_header(struct_timespec HDR struct_timespec.h DEPENDS .time_t)
add_header(
diff --git a/libc/include/llvm-libc-types/sigjmp_buf.h b/libc/include/llvm-libc-types/sigjmp_buf.h
new file mode 100644
index 0000000000000..d60df60064373
--- /dev/null
+++ b/libc/include/llvm-libc-types/sigjmp_buf.h
@@ -0,0 +1,15 @@
+//===-- Definition of type sigjmp_buf -------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_TYPES_SIGJMP_BUF_H
+#define LLVM_LIBC_TYPES_SIGJMP_BUF_H
+
+// Intentionally left blank. sigjmp_buf is defined in jmp_buf.h, but due to the
+// way headergen works, this file is required.
+
+#endif // LLVM_LIBC_TYPES_SIGJMP_BUF_H
``````````
</details>
https://github.com/llvm/llvm-project/pull/150439
More information about the libc-commits
mailing list