[libc-commits] [libc] 056a167 - [libc] Add proxy header for the stack_t type (#107559)

via libc-commits libc-commits at lists.llvm.org
Sat Sep 7 07:01:38 PDT 2024


Author: wldfngrs
Date: 2024-09-07T10:01:33-04:00
New Revision: 056a1676cbe43ce22b65a500a2dc9916fd575563

URL: https://github.com/llvm/llvm-project/commit/056a1676cbe43ce22b65a500a2dc9916fd575563
DIFF: https://github.com/llvm/llvm-project/commit/056a1676cbe43ce22b65a500a2dc9916fd575563.diff

LOG: [libc] Add proxy header for the stack_t type (#107559)

added proxy header for the stack_t type and modified the corresponding
CMakeLists.txt files

Added: 
    libc/hdr/types/stack_t.h

Modified: 
    libc/hdr/types/CMakeLists.txt
    libc/src/signal/linux/CMakeLists.txt
    libc/src/signal/linux/sigaltstack.cpp
    libc/src/signal/sigaltstack.h

Removed: 
    


################################################################################
diff  --git a/libc/hdr/types/CMakeLists.txt b/libc/hdr/types/CMakeLists.txt
index 3f4d70140082cf..8789e0c7870263 100644
--- a/libc/hdr/types/CMakeLists.txt
+++ b/libc/hdr/types/CMakeLists.txt
@@ -181,3 +181,12 @@ add_proxy_header_library(
     libc.include.signal
 )
 
+add_proxy_header_library(
+  stack_t
+  HDRS
+    stack_t.h
+  FULL_BUILD_DEPENDS
+    libc.include.llvm-libc-types.stack_t
+    libc.include.signal
+)
+

diff  --git a/libc/hdr/types/stack_t.h b/libc/hdr/types/stack_t.h
new file mode 100644
index 00000000000000..8c7c37a5d814ee
--- /dev/null
+++ b/libc/hdr/types/stack_t.h
@@ -0,0 +1,23 @@
+//===-- Definition of stack_t.h -------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https:llvm.or/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_LIBC_HDR_STACK_T_H
+#define LLVM_LIBC_HDR_STACK_T_H
+
+#ifdef LIBC_FULL_BUILD
+
+#include "include/llvm-libc-types/stack_t.h"
+
+#else // overlay mode
+
+#include <signal.h>
+
+#endif // LLVM_LIBC_FULL_BUILD
+
+#endif // LLVM_LIBC_HDR_TYPES_STACK_T_H

diff  --git a/libc/src/signal/linux/CMakeLists.txt b/libc/src/signal/linux/CMakeLists.txt
index 103175bb139bab..e314242dc376fb 100644
--- a/libc/src/signal/linux/CMakeLists.txt
+++ b/libc/src/signal/linux/CMakeLists.txt
@@ -77,6 +77,7 @@ add_entrypoint_object(
     libc.include.sys_syscall
     libc.src.__support.OSUtil.osutil
     libc.src.errno.errno
+    libc.hdr.types.stack_t
 )
 
 add_entrypoint_object(

diff  --git a/libc/src/signal/linux/sigaltstack.cpp b/libc/src/signal/linux/sigaltstack.cpp
index 2e142a473fea71..c19394cd179122 100644
--- a/libc/src/signal/linux/sigaltstack.cpp
+++ b/libc/src/signal/linux/sigaltstack.cpp
@@ -7,13 +7,13 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/signal/sigaltstack.h"
+#include "hdr/types/stack_t.h"
 #include "src/__support/macros/config.h"
 #include "src/errno/libc_errno.h"
 #include "src/signal/linux/signal_utils.h"
 
 #include "src/__support/common.h"
 
-#include <signal.h>
 #include <sys/syscall.h>
 
 namespace LIBC_NAMESPACE_DECL {

diff  --git a/libc/src/signal/sigaltstack.h b/libc/src/signal/sigaltstack.h
index fc6ec356e5ef86..7a82c0ee997118 100644
--- a/libc/src/signal/sigaltstack.h
+++ b/libc/src/signal/sigaltstack.h
@@ -9,8 +9,8 @@
 #ifndef LLVM_LIBC_SRC_SIGNAL_SIGALTSTACK_H
 #define LLVM_LIBC_SRC_SIGNAL_SIGALTSTACK_H
 
+#include "hdr/types/stack_t.h"
 #include "src/__support/macros/config.h"
-#include <signal.h>
 
 namespace LIBC_NAMESPACE_DECL {
 


        


More information about the libc-commits mailing list