File tree Expand file tree Collapse file tree 7 files changed +60
-5
lines changed Expand file tree Collapse file tree 7 files changed +60
-5
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "setjmp" : {
3
+ "LIBC_CONF_SETJMP_AARCH64_RESTORE_PLATFORM_REGISTER" : {
4
+ "value" : false ,
5
+ "doc" : " Avoid setjmp saving the value of x18, and longjmp restoring it. The Apple AArch64 ABI specifies that this register is reserved and should not be used"
6
+ }
7
+ }
8
+ }
Original file line number Diff line number Diff line change @@ -101,6 +101,17 @@ set(TARGET_LIBC_ENTRYPOINTS
101
101
libc.src.stdlib.free
102
102
)
103
103
104
+ if(LLVM_LIBC_FULL_BUILD)
105
+ list(APPEND TARGET_LIBC_ENTRYPOINTS
106
+ # setjmp.h entrypoints
107
+ libc.src.setjmp.longjmp
108
+ libc.src.setjmp.setjmp
109
+ libc.src.setjmp.siglongjmp
110
+ libc.src.setjmp.sigsetjmp
111
+ )
112
+ endif()
113
+
114
+
104
115
set(TARGET_LIBM_ENTRYPOINTS
105
116
# complex.h entrypoints
106
117
libc.src.complex.creal
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ set(TARGET_PUBLIC_HEADERS
7
7
libc.include.inttypes
8
8
libc.include.limits
9
9
libc.include.math
10
+ libc.include.setjmp
10
11
libc.include.stdlib
11
12
libc.include.string
12
13
libc.include.strings
Original file line number Diff line number Diff line change
1
+ # Process architecture-specific subdirectory FIRST to avoid missing targets.
2
+ if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR} /${LIBC_TARGET_ARCHITECTURE} )
3
+ add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /${LIBC_TARGET_ARCHITECTURE} )
4
+ endif ()
5
+
6
+ # Then process OS-specific subdirectory
1
7
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR} /${LIBC_TARGET_OS} )
2
8
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /${LIBC_TARGET_OS} )
3
9
add_object_library (
@@ -8,10 +14,6 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_OS})
8
14
)
9
15
endif ()
10
16
11
- if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR} /${LIBC_TARGET_ARCHITECTURE} )
12
- add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /${LIBC_TARGET_ARCHITECTURE} )
13
- endif ()
14
-
15
17
add_entrypoint_object (
16
18
setjmp
17
19
ALIAS
Original file line number Diff line number Diff line change
1
+ add_object_library (
2
+ sigsetjmp_epilogue
3
+ HDRS
4
+ ../sigsetjmp_epilogue.h
5
+ SRCS
6
+ sigsetjmp_epilogue.cpp
7
+ DEPENDS
8
+ libc.src.__support.common
9
+ libc.src.__support.OSUtil.osutil
10
+ libc.hdr.types.jmp_buf
11
+ libc.hdr.types.sigset_t
12
+ )
Original file line number Diff line number Diff line change
1
+ // ===-- Implementation of sigsetjmp_epilogue ------------------------------===//
2
+ //
3
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
+ // See https://llvm.org/LICENSE.txt for license information.
5
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
+ //
7
+ // ===----------------------------------------------------------------------===//
8
+
9
+ #include " src/setjmp/sigsetjmp_epilogue.h"
10
+ #include " src/__support/OSUtil/syscall.h"
11
+ #include " src/__support/common.h"
12
+ #include " src/signal/sigprocmask.h"
13
+
14
+ namespace LIBC_NAMESPACE_DECL {
15
+ [[gnu::returns_twice]] int sigsetjmp_epilogue (jmp_buf buffer, int retval) {
16
+ syscall_impl<long >(sigprocmask, SIG_SETMASK,
17
+ /* set= */ retval ? &buffer->sigmask : nullptr ,
18
+ /* old_set= */ retval ? nullptr : &buffer->sigmask );
19
+ return retval;
20
+ }
21
+ } // namespace LIBC_NAMESPACE_DECL
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ add_subdirectory(errno)
62
62
add_subdirectory (fenv )
63
63
add_subdirectory (math )
64
64
add_subdirectory (search )
65
+ add_subdirectory (setjmp )
65
66
add_subdirectory (stdbit )
66
67
add_subdirectory (stdfix )
67
68
add_subdirectory (stdio )
@@ -92,7 +93,6 @@ add_subdirectory(assert)
92
93
add_subdirectory (compiler )
93
94
add_subdirectory (dirent )
94
95
add_subdirectory (locale )
95
- add_subdirectory (setjmp )
96
96
add_subdirectory (signal )
97
97
add_subdirectory (spawn )
98
98
You can’t perform that action at this time.
0 commit comments