Skip to content

Commit 87dd519

Browse files
committed
[libc++] Remove support for CloudABI, which has been abandoned
Based on https://github.com/NuxiNL/cloudlibc, it appears that the CloudABI project has been abandoned. This patch removes a bunch of CloudABI specific logic that had been added to support that platform. Note that some knobs like LIBCXX_ENABLE_STDIN and LIBCXX_ENABLE_STDOUT coud be useful in their own right, however those are currently broken. If we want to re-add such knobs in the future, we can do it like we've done it for localization & friends so that we can officially support that configuration. Differential Revision: https://reviews.llvm.org/D108637
1 parent 92c1fd1 commit 87dd519

File tree

35 files changed

+4
-273
lines changed

35 files changed

+4
-273
lines changed

libcxx/CMakeLists.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,7 @@ set(LIBCXX_GCC_TOOLCHAIN "" CACHE STRING "Use alternate GCC toolchain.")
263263
# Feature options -------------------------------------------------------------
264264
option(LIBCXX_ENABLE_EXCEPTIONS "Use exceptions." ON)
265265
option(LIBCXX_ENABLE_RTTI "Use run time type information." ON)
266-
option(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE "Build libc++ with support for the global filesystem namespace." ON)
267-
option(LIBCXX_ENABLE_STDIN "Build libc++ with support for stdin/std::cin." ON)
268-
option(LIBCXX_ENABLE_STDOUT "Build libc++ with support for stdout/std::cout." ON)
269266
option(LIBCXX_ENABLE_THREADS "Build libc++ with support for threads." ON)
270-
option(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS "Build libc++ with support for thread-unsafe C functions" ON)
271267
option(LIBCXX_ENABLE_MONOTONIC_CLOCK
272268
"Build libc++ with support for a monotonic clock.
273269
This option may only be set to OFF when LIBCXX_ENABLE_THREADS=OFF." ON)
@@ -868,12 +864,8 @@ config_define_if(LIBCXX_ABI_UNSTABLE _LIBCPP_ABI_UNSTABLE)
868864
config_define_if(LIBCXX_ABI_FORCE_ITANIUM _LIBCPP_ABI_FORCE_ITANIUM)
869865
config_define_if(LIBCXX_ABI_FORCE_MICROSOFT _LIBCPP_ABI_FORCE_MICROSOFT)
870866
config_define_if(LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT _LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT)
871-
config_define_if_not(LIBCXX_ENABLE_GLOBAL_FILESYSTEM_NAMESPACE _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE)
872-
config_define_if_not(LIBCXX_ENABLE_STDIN _LIBCPP_HAS_NO_STDIN)
873-
config_define_if_not(LIBCXX_ENABLE_STDOUT _LIBCPP_HAS_NO_STDOUT)
874867
config_define_if_not(LIBCXX_ENABLE_THREADS _LIBCPP_HAS_NO_THREADS)
875868
config_define_if_not(LIBCXX_ENABLE_MONOTONIC_CLOCK _LIBCPP_HAS_NO_MONOTONIC_CLOCK)
876-
config_define_if_not(LIBCXX_ENABLE_THREAD_UNSAFE_C_FUNCTIONS _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS)
877869
if (NOT LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION STREQUAL "default")
878870
config_define("${LIBCXX_TYPEINFO_COMPARISON_IMPLEMENTATION}" _LIBCPP_TYPEINFO_COMPARISON_IMPLEMENTATION)
879871
endif()

libcxx/docs/DesignDocs/CapturingConfigInfo.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,8 @@ configuration all together. An example "__config" header generated when
6565
#ifndef _LIBCPP_CONFIG_SITE
6666
#define _LIBCPP_CONFIG_SITE
6767
68-
/* #undef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE */
69-
/* #undef _LIBCPP_HAS_NO_STDIN */
70-
/* #undef _LIBCPP_HAS_NO_STDOUT */
7168
#define _LIBCPP_HAS_NO_THREADS
7269
/* #undef _LIBCPP_HAS_NO_MONOTONIC_CLOCK */
73-
/* #undef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS */
7470
7571
#endif
7672
// -*- C++ -*-

libcxx/include/__config

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@
318318
# endif
319319
#endif // __sun__
320320

321-
#if defined(__OpenBSD__) || defined(__CloudABI__)
321+
#if defined(__OpenBSD__)
322322
// Certain architectures provide arc4random(). Prefer using
323323
// arc4random() over /dev/{u,}random to make it possible to obtain
324324
// random data even when using sandboxing mechanisms such as chroots,
@@ -935,7 +935,7 @@ typedef unsigned int char32_t;
935935
#endif
936936

937937
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_LIBCPP_MSVCRT_LIKE) || \
938-
defined(__sun__) || defined(__NetBSD__) || defined(__CloudABI__)
938+
defined(__sun__) || defined(__NetBSD__)
939939
#define _LIBCPP_LOCALE__L_EXTENSIONS 1
940940
#endif
941941

@@ -1139,7 +1139,6 @@ extern "C" _LIBCPP_FUNC_VIS void __sanitizer_annotate_contiguous_container(
11391139
defined(__linux__) || \
11401140
defined(__GNU__) || \
11411141
defined(__APPLE__) || \
1142-
defined(__CloudABI__) || \
11431142
defined(__sun__) || \
11441143
defined(__MVS__) || \
11451144
defined(_AIX) || \
@@ -1213,40 +1212,19 @@ extern "C" _LIBCPP_FUNC_VIS void __sanitizer_annotate_contiguous_container(
12131212
# define _LIBCPP_HAS_TRIVIAL_CONDVAR_DESTRUCTION
12141213
#endif
12151214

1216-
// Systems that use capability-based security (FreeBSD with Capsicum,
1217-
// Nuxi CloudABI) may only provide local filesystem access (using *at()).
1218-
// Functions like open(), rename(), unlink() and stat() should not be
1219-
// used, as they attempt to access the global filesystem namespace.
1220-
#ifdef __CloudABI__
1221-
#define _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
1222-
#endif
1223-
1224-
// CloudABI is intended for running networked services. Processes do not
1225-
// have standard input and output channels.
1226-
#ifdef __CloudABI__
1227-
#define _LIBCPP_HAS_NO_STDIN
1228-
#define _LIBCPP_HAS_NO_STDOUT
1229-
#endif
1230-
12311215
// Some systems do not provide gets() in their C library, for security reasons.
12321216
#if defined(_LIBCPP_MSVCRT) || \
12331217
(defined(__FreeBSD_version) && __FreeBSD_version >= 1300043) || \
12341218
defined(__OpenBSD__)
12351219
# define _LIBCPP_C_HAS_NO_GETS
12361220
#endif
12371221

1238-
#if defined(__BIONIC__) || defined(__CloudABI__) || defined(__NuttX__) || \
1222+
#if defined(__BIONIC__) || defined(__NuttX__) || \
12391223
defined(__Fuchsia__) || defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC) || \
12401224
defined(__MVS__) || defined(__OpenBSD__)
12411225
#define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
12421226
#endif
12431227

1244-
// Thread-unsafe functions such as strtok() and localtime()
1245-
// are not available.
1246-
#ifdef __CloudABI__
1247-
#define _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
1248-
#endif
1249-
12501228
#if __has_feature(cxx_atomic) || __has_extension(c_atomic) || __has_keyword(_Atomic)
12511229
# define _LIBCPP_HAS_C_ATOMIC_IMP
12521230
#elif defined(_LIBCPP_COMPILER_GCC)

libcxx/include/__config_site.in

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,8 @@
1414
#cmakedefine _LIBCPP_ABI_FORCE_ITANIUM
1515
#cmakedefine _LIBCPP_ABI_FORCE_MICROSOFT
1616
#cmakedefine _LIBCPP_HIDE_FROM_ABI_PER_TU_BY_DEFAULT
17-
#cmakedefine _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
18-
#cmakedefine _LIBCPP_HAS_NO_STDIN
19-
#cmakedefine _LIBCPP_HAS_NO_STDOUT
2017
#cmakedefine _LIBCPP_HAS_NO_THREADS
2118
#cmakedefine _LIBCPP_HAS_NO_MONOTONIC_CLOCK
22-
#cmakedefine _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
2319
#cmakedefine _LIBCPP_HAS_MUSL_LIBC
2420
#cmakedefine _LIBCPP_HAS_THREAD_API_PTHREAD
2521
#cmakedefine _LIBCPP_HAS_THREAD_API_EXTERNAL

libcxx/include/clocale

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ lconv* localeconv();
4444
_LIBCPP_BEGIN_NAMESPACE_STD
4545

4646
using ::lconv _LIBCPP_USING_IF_EXISTS;
47-
#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
4847
using ::setlocale _LIBCPP_USING_IF_EXISTS;
49-
#endif
5048
using ::localeconv _LIBCPP_USING_IF_EXISTS;
5149

5250
_LIBCPP_END_NAMESPACE_STD

libcxx/include/cstdio

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,30 +145,24 @@ using ::feof _LIBCPP_USING_IF_EXISTS;
145145
using ::ferror _LIBCPP_USING_IF_EXISTS;
146146
using ::perror _LIBCPP_USING_IF_EXISTS;
147147

148-
#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE
149148
using ::fopen _LIBCPP_USING_IF_EXISTS;
150149
using ::freopen _LIBCPP_USING_IF_EXISTS;
151150
using ::remove _LIBCPP_USING_IF_EXISTS;
152151
using ::rename _LIBCPP_USING_IF_EXISTS;
153152
using ::tmpfile _LIBCPP_USING_IF_EXISTS;
154153
using ::tmpnam _LIBCPP_USING_IF_EXISTS;
155-
#endif
156154

157-
#ifndef _LIBCPP_HAS_NO_STDIN
158155
using ::getchar _LIBCPP_USING_IF_EXISTS;
159156
#if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_C_HAS_NO_GETS)
160157
using ::gets _LIBCPP_USING_IF_EXISTS;
161158
#endif
162159
using ::scanf _LIBCPP_USING_IF_EXISTS;
163160
using ::vscanf _LIBCPP_USING_IF_EXISTS;
164-
#endif
165161

166-
#ifndef _LIBCPP_HAS_NO_STDOUT
167162
using ::printf _LIBCPP_USING_IF_EXISTS;
168163
using ::putchar _LIBCPP_USING_IF_EXISTS;
169164
using ::puts _LIBCPP_USING_IF_EXISTS;
170165
using ::vprintf _LIBCPP_USING_IF_EXISTS;
171-
#endif
172166

173167
_LIBCPP_END_NAMESPACE_STD
174168

libcxx/include/cstring

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ using ::strpbrk _LIBCPP_USING_IF_EXISTS;
8484
using ::strrchr _LIBCPP_USING_IF_EXISTS;
8585
using ::strspn _LIBCPP_USING_IF_EXISTS;
8686
using ::strstr _LIBCPP_USING_IF_EXISTS;
87-
#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
8887
using ::strtok _LIBCPP_USING_IF_EXISTS;
89-
#endif
9088
using ::memset _LIBCPP_USING_IF_EXISTS;
9189
using ::strerror _LIBCPP_USING_IF_EXISTS;
9290
using ::strlen _LIBCPP_USING_IF_EXISTS;

libcxx/include/ctime

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,10 @@ using ::clock _LIBCPP_USING_IF_EXISTS;
7979
using ::difftime _LIBCPP_USING_IF_EXISTS;
8080
using ::mktime _LIBCPP_USING_IF_EXISTS;
8181
using ::time _LIBCPP_USING_IF_EXISTS;
82-
#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS
8382
using ::asctime _LIBCPP_USING_IF_EXISTS;
8483
using ::ctime _LIBCPP_USING_IF_EXISTS;
8584
using ::gmtime _LIBCPP_USING_IF_EXISTS;
8685
using ::localtime _LIBCPP_USING_IF_EXISTS;
87-
#endif
8886
using ::strftime _LIBCPP_USING_IF_EXISTS;
8987
#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET) && !defined(_LIBCPP_HAS_TIMESPEC_GET_NOT_ACTUALLY_PROVIDED)
9088
using ::timespec_get _LIBCPP_USING_IF_EXISTS;

libcxx/include/cwchar

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,13 @@ using ::wcrtomb _LIBCPP_USING_IF_EXISTS;
175175
using ::mbsrtowcs _LIBCPP_USING_IF_EXISTS;
176176
using ::wcsrtombs _LIBCPP_USING_IF_EXISTS;
177177

178-
#ifndef _LIBCPP_HAS_NO_STDIN
179178
using ::getwchar _LIBCPP_USING_IF_EXISTS;
180179
using ::vwscanf _LIBCPP_USING_IF_EXISTS;
181180
using ::wscanf _LIBCPP_USING_IF_EXISTS;
182-
#endif
183181

184-
#ifndef _LIBCPP_HAS_NO_STDOUT
185182
using ::putwchar _LIBCPP_USING_IF_EXISTS;
186183
using ::vwprintf _LIBCPP_USING_IF_EXISTS;
187184
using ::wprintf _LIBCPP_USING_IF_EXISTS;
188-
#endif
189185

190186
_LIBCPP_END_NAMESPACE_STD
191187

0 commit comments

Comments
 (0)