Skip to content

Commit 5f00129

Browse files
authored
Remove last few bits for Native Client support (#148983)
1 parent ff5f3ae commit 5f00129

File tree

6 files changed

+4
-40
lines changed

6 files changed

+4
-40
lines changed

libc/src/__support/macros/properties/architectures.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#define LIBC_TARGET_ARCH_IS_GPU
2222
#endif
2323

24-
#if defined(__pnacl__) || defined(__CLR_VER) || defined(LIBC_TARGET_ARCH_IS_GPU)
24+
#if defined(__CLR_VER) || defined(LIBC_TARGET_ARCH_IS_GPU)
2525
#define LIBC_TARGET_ARCH_IS_VM
2626
#endif
2727

libcxx/include/__config

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -265,13 +265,6 @@ _LIBCPP_HARDENING_MODE_DEBUG
265265
// When this option is used, the token passed to `std::random_device`'s
266266
// constructor *must* be "/dev/urandom" -- anything else is an error.
267267
//
268-
// _LIBCPP_USING_NACL_RANDOM
269-
// NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access,
270-
// including accesses to the special files under `/dev`. This implementation
271-
// uses the NaCL syscall `nacl_secure_random_init()` to get entropy.
272-
// When this option is used, the token passed to `std::random_device`'s
273-
// constructor *must* be "/dev/urandom" -- anything else is an error.
274-
//
275268
// _LIBCPP_USING_WIN32_RANDOM
276269
// Use rand_s(), for use on Windows.
277270
// When this option is used, the token passed to `std::random_device`'s
@@ -283,8 +276,6 @@ _LIBCPP_HARDENING_MODE_DEBUG
283276
# define _LIBCPP_USING_GETENTROPY
284277
# elif defined(__Fuchsia__)
285278
# define _LIBCPP_USING_FUCHSIA_CPRNG
286-
# elif defined(__native_client__)
287-
# define _LIBCPP_USING_NACL_RANDOM
288279
# elif defined(_LIBCPP_WIN32API)
289280
# define _LIBCPP_USING_WIN32_RANDOM
290281
# else

libcxx/include/limits

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ protected:
219219
static _LIBCPP_CONSTEXPR const bool is_bounded = true;
220220
static _LIBCPP_CONSTEXPR const bool is_modulo = !std::is_signed<_Tp>::value;
221221

222-
# if defined(__i386__) || defined(__x86_64__) || defined(__pnacl__) || defined(__wasm__)
222+
# if defined(__i386__) || defined(__x86_64__) || defined(__wasm__)
223223
static _LIBCPP_CONSTEXPR const bool traps = true;
224224
# else
225225
static _LIBCPP_CONSTEXPR const bool traps = false;

libcxx/src/random.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
# include <linux/random.h>
3232
# include <sys/ioctl.h>
3333
# endif
34-
#elif defined(_LIBCPP_USING_NACL_RANDOM)
35-
# include <nacl/nacl_random.h>
3634
#elif defined(_LIBCPP_USING_FUCHSIA_CPRNG)
3735
# include <zircon/syscalls.h>
3836
#endif
@@ -93,30 +91,6 @@ unsigned random_device::operator()() {
9391
return r;
9492
}
9593

96-
#elif defined(_LIBCPP_USING_NACL_RANDOM)
97-
98-
random_device::random_device(const string& __token) {
99-
if (__token != "/dev/urandom")
100-
std::__throw_system_error(ENOENT, ("random device not supported " + __token).c_str());
101-
int error = nacl_secure_random_init();
102-
if (error)
103-
std::__throw_system_error(error, ("random device failed to open " + __token).c_str());
104-
}
105-
106-
random_device::~random_device() {}
107-
108-
unsigned random_device::operator()() {
109-
unsigned r;
110-
size_t n = sizeof(r);
111-
size_t bytes_written;
112-
int error = nacl_secure_random(&r, n, &bytes_written);
113-
if (error != 0)
114-
std::__throw_system_error(error, "random_device failed getting bytes");
115-
else if (bytes_written != n)
116-
std::__throw_runtime_error("random_device failed to obtain enough bytes");
117-
return r;
118-
}
119-
12094
#elif defined(_LIBCPP_USING_WIN32_RANDOM)
12195

12296
random_device::random_device(const string& __token) {

libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414

1515
#include "test_macros.h"
1616

17-
#if defined(__i386__) || defined(__x86_64__) || defined(__pnacl__) || \
18-
defined(__wasm__)
17+
#if defined(__i386__) || defined(__x86_64__) || defined(__wasm__)
1918
static const bool integral_types_trap = true;
2019
#else
2120
static const bool integral_types_trap = false;

llvm/tools/llvm-readobj/ELFDumper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5511,7 +5511,7 @@ template <typename ELFT> static GNUAbiTag getGNUAbiTag(ArrayRef<uint8_t> Desc) {
55115511
return {"", "", /*IsValid=*/false};
55125512

55135513
static const char *OSNames[] = {
5514-
"Linux", "Hurd", "Solaris", "FreeBSD", "NetBSD", "Syllable", "NaCl",
5514+
"Linux", "Hurd", "Solaris", "FreeBSD", "NetBSD", "Syllable",
55155515
};
55165516
StringRef OSName = "Unknown";
55175517
if (Words[0] < std::size(OSNames))

0 commit comments

Comments
 (0)