File tree Expand file tree Collapse file tree 4 files changed +31
-3
lines changed
src/__support/OSUtil/darwin Expand file tree Collapse file tree 4 files changed +31
-3
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,7 @@ if(LLVM_LIBC_FULL_BUILD)
111111 libc.src.setjmp.setjmp
112112 libc.src.setjmp.siglongjmp
113113 libc.src.setjmp.sigsetjmp
114+ libc.src.stdlib._Exit
114115 )
115116endif()
116117
Original file line number Diff line number Diff line change @@ -4,13 +4,16 @@ endif()
44
55add_subdirectory (${LIBC_TARGET_ARCHITECTURE} )
66
7- add_header_library (
7+ add_object_library (
88 darwin_util
9+ SRCS
10+ exit.cpp
911 HDRS
1012 io.h
1113 syscall.h
1214 DEPENDS
13- .${LIBC_TARGET_ARCHITECTURE} .darwin_util
15+ .${LIBC_TARGET_ARCHITECTURE} .darwin_ ${LIBC_TARGET_ARCHITECTURE} _util
1416 libc.src.__support.common
1517 libc.src.__support.CPP.string_view
18+ libc.include .sys_syscall
1619)
Original file line number Diff line number Diff line change 11add_header_library(
2- darwin_util
2+ darwin_aarch64_util
33 HDRS
44 syscall.h
55 DEPENDS
Original file line number Diff line number Diff line change 1+ // ===------------ MacOS implementation of an exit function ------*- C++ -*-===//
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/__support/OSUtil/darwin/syscall.h" // syscall_impl
10+ #include " src/__support/common.h"
11+ #include " src/__support/macros/config.h"
12+ #include " sys/syscall.h" // For syscall numbers.
13+
14+ namespace LIBC_NAMESPACE_DECL {
15+ namespace internal {
16+
17+ __attribute__ ((noreturn)) void exit (int status) {
18+ for (;;) {
19+ LIBC_NAMESPACE::syscall_impl<long >(SYS_exit, status);
20+ }
21+ }
22+
23+ } // namespace internal
24+ } // namespace LIBC_NAMESPACE_DECL
You can’t perform that action at this time.
0 commit comments