Skip to content

Remove last few bits for Native Client support #148983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libc/src/__support/macros/properties/architectures.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#define LIBC_TARGET_ARCH_IS_GPU
#endif

#if defined(__pnacl__) || defined(__CLR_VER) || defined(LIBC_TARGET_ARCH_IS_GPU)
#if defined(__CLR_VER) || defined(LIBC_TARGET_ARCH_IS_GPU)
#define LIBC_TARGET_ARCH_IS_VM
#endif

Expand Down
9 changes: 0 additions & 9 deletions libcxx/include/__config
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,6 @@ _LIBCPP_HARDENING_MODE_DEBUG
// When this option is used, the token passed to `std::random_device`'s
// constructor *must* be "/dev/urandom" -- anything else is an error.
//
// _LIBCPP_USING_NACL_RANDOM
// NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access,
// including accesses to the special files under `/dev`. This implementation
// uses the NaCL syscall `nacl_secure_random_init()` to get entropy.
// When this option is used, the token passed to `std::random_device`'s
// constructor *must* be "/dev/urandom" -- anything else is an error.
//
// _LIBCPP_USING_WIN32_RANDOM
// Use rand_s(), for use on Windows.
// When this option is used, the token passed to `std::random_device`'s
Expand All @@ -283,8 +276,6 @@ _LIBCPP_HARDENING_MODE_DEBUG
# define _LIBCPP_USING_GETENTROPY
# elif defined(__Fuchsia__)
# define _LIBCPP_USING_FUCHSIA_CPRNG
# elif defined(__native_client__)
# define _LIBCPP_USING_NACL_RANDOM
# elif defined(_LIBCPP_WIN32API)
# define _LIBCPP_USING_WIN32_RANDOM
# else
Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/limits
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ protected:
static _LIBCPP_CONSTEXPR const bool is_bounded = true;
static _LIBCPP_CONSTEXPR const bool is_modulo = !std::is_signed<_Tp>::value;

# if defined(__i386__) || defined(__x86_64__) || defined(__pnacl__) || defined(__wasm__)
# if defined(__i386__) || defined(__x86_64__) || defined(__wasm__)
static _LIBCPP_CONSTEXPR const bool traps = true;
# else
static _LIBCPP_CONSTEXPR const bool traps = false;
Expand Down
26 changes: 0 additions & 26 deletions libcxx/src/random.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
# include <linux/random.h>
# include <sys/ioctl.h>
# endif
#elif defined(_LIBCPP_USING_NACL_RANDOM)
# include <nacl/nacl_random.h>
#elif defined(_LIBCPP_USING_FUCHSIA_CPRNG)
# include <zircon/syscalls.h>
#endif
Expand Down Expand Up @@ -93,30 +91,6 @@ unsigned random_device::operator()() {
return r;
}

#elif defined(_LIBCPP_USING_NACL_RANDOM)

random_device::random_device(const string& __token) {
if (__token != "/dev/urandom")
std::__throw_system_error(ENOENT, ("random device not supported " + __token).c_str());
int error = nacl_secure_random_init();
if (error)
std::__throw_system_error(error, ("random device failed to open " + __token).c_str());
}

random_device::~random_device() {}

unsigned random_device::operator()() {
unsigned r;
size_t n = sizeof(r);
size_t bytes_written;
int error = nacl_secure_random(&r, n, &bytes_written);
if (error != 0)
std::__throw_system_error(error, "random_device failed getting bytes");
else if (bytes_written != n)
std::__throw_runtime_error("random_device failed to obtain enough bytes");
return r;
}

#elif defined(_LIBCPP_USING_WIN32_RANDOM)

random_device::random_device(const string& __token) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@

#include "test_macros.h"

#if defined(__i386__) || defined(__x86_64__) || defined(__pnacl__) || \
defined(__wasm__)
#if defined(__i386__) || defined(__x86_64__) || defined(__wasm__)
static const bool integral_types_trap = true;
#else
static const bool integral_types_trap = false;
Expand Down
2 changes: 1 addition & 1 deletion llvm/tools/llvm-readobj/ELFDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5510,7 +5510,7 @@ template <typename ELFT> static GNUAbiTag getGNUAbiTag(ArrayRef<uint8_t> Desc) {
return {"", "", /*IsValid=*/false};

static const char *OSNames[] = {
"Linux", "Hurd", "Solaris", "FreeBSD", "NetBSD", "Syllable", "NaCl",
"Linux", "Hurd", "Solaris", "FreeBSD", "NetBSD", "Syllable",
};
StringRef OSName = "Unknown";
if (Words[0] < std::size(OSNames))
Expand Down
Loading