Skip to content

Commit 056a167

Browse files
authored
[libc] Add proxy header for the stack_t type (llvm#107559)
added proxy header for the stack_t type and modified the corresponding CMakeLists.txt files
1 parent d6d6070 commit 056a167

File tree

5 files changed

+35
-2
lines changed

5 files changed

+35
-2
lines changed

libc/hdr/types/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,3 +181,12 @@ add_proxy_header_library(
181181
libc.include.signal
182182
)
183183

184+
add_proxy_header_library(
185+
stack_t
186+
HDRS
187+
stack_t.h
188+
FULL_BUILD_DEPENDS
189+
libc.include.llvm-libc-types.stack_t
190+
libc.include.signal
191+
)
192+

libc/hdr/types/stack_t.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//===-- Definition of stack_t.h -------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https:llvm.or/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//
8+
//===----------------------------------------------------------------------===//
9+
10+
#ifndef LLVM_LIBC_HDR_STACK_T_H
11+
#define LLVM_LIBC_HDR_STACK_T_H
12+
13+
#ifdef LIBC_FULL_BUILD
14+
15+
#include "include/llvm-libc-types/stack_t.h"
16+
17+
#else // overlay mode
18+
19+
#include <signal.h>
20+
21+
#endif // LLVM_LIBC_FULL_BUILD
22+
23+
#endif // LLVM_LIBC_HDR_TYPES_STACK_T_H

libc/src/signal/linux/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ add_entrypoint_object(
7777
libc.include.sys_syscall
7878
libc.src.__support.OSUtil.osutil
7979
libc.src.errno.errno
80+
libc.hdr.types.stack_t
8081
)
8182

8283
add_entrypoint_object(

libc/src/signal/linux/sigaltstack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "src/signal/sigaltstack.h"
10+
#include "hdr/types/stack_t.h"
1011
#include "src/__support/macros/config.h"
1112
#include "src/errno/libc_errno.h"
1213
#include "src/signal/linux/signal_utils.h"
1314

1415
#include "src/__support/common.h"
1516

16-
#include <signal.h>
1717
#include <sys/syscall.h>
1818

1919
namespace LIBC_NAMESPACE_DECL {

libc/src/signal/sigaltstack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#ifndef LLVM_LIBC_SRC_SIGNAL_SIGALTSTACK_H
1010
#define LLVM_LIBC_SRC_SIGNAL_SIGALTSTACK_H
1111

12+
#include "hdr/types/stack_t.h"
1213
#include "src/__support/macros/config.h"
13-
#include <signal.h>
1414

1515
namespace LIBC_NAMESPACE_DECL {
1616

0 commit comments

Comments
 (0)