[libc-commits] [libc] [libc] Fix issue with sigjmp_buf.h not being found (PR #150439)

William Huynh via libc-commits libc-commits at lists.llvm.org
Thu Jul 24 08:33:14 PDT 2025


https://github.com/saturn691 updated https://github.com/llvm/llvm-project/pull/150439

>From 0aadd571cb21ffb1d43390b9fa2b2b9aed4c5555 Mon Sep 17 00:00:00 2001
From: William Huynh <William.Huynh at arm.com>
Date: Thu, 24 Jul 2025 16:29:11 +0100
Subject: [PATCH] [libc] Fix issue with sigjmp_buf.h not being found

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.
---
 libc/include/CMakeLists.txt                 |  1 +
 libc/include/llvm-libc-types/CMakeLists.txt |  1 +
 libc/include/llvm-libc-types/sigjmp_buf.h   | 15 +++++++++++++++
 3 files changed, 17 insertions(+)
 create mode 100644 libc/include/llvm-libc-types/sigjmp_buf.h

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



More information about the libc-commits mailing list