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
101101 libc.src.stdlib.free
102102)
103103
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+
104115set(TARGET_LIBM_ENTRYPOINTS
105116 # complex.h entrypoints
106117 libc.src.complex.creal
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ set(TARGET_PUBLIC_HEADERS
77 libc.include.inttypes
88 libc.include.limits
99 libc.include.math
10+ libc.include.setjmp
1011 libc.include.stdlib
1112 libc.include.string
1213 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
17if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR} /${LIBC_TARGET_OS} )
28 add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /${LIBC_TARGET_OS} )
39 add_object_library(
@@ -8,10 +14,6 @@ if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBC_TARGET_OS})
814 )
915endif ()
1016
11- if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR} /${LIBC_TARGET_ARCHITECTURE} )
12- add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR} /${LIBC_TARGET_ARCHITECTURE} )
13- endif ()
14-
1517add_entrypoint_object(
1618 setjmp
1719 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)
6262add_subdirectory (fenv)
6363add_subdirectory (math)
6464add_subdirectory (search)
65+ add_subdirectory (setjmp)
6566add_subdirectory (stdbit)
6667add_subdirectory (stdfix)
6768add_subdirectory (stdio)
@@ -92,7 +93,6 @@ add_subdirectory(assert)
9293add_subdirectory (compiler)
9394add_subdirectory (dirent)
9495add_subdirectory (locale)
95- add_subdirectory (setjmp)
9696add_subdirectory (signal)
9797add_subdirectory (spawn)
9898
You can’t perform that action at this time.
0 commit comments