Remove last few bits for Native Client support#148983
Conversation
|
@llvm/pr-subscribers-libc @llvm/pr-subscribers-libcxx Author: Brad Smith (brad0) ChangesFull diff: https://github.com/llvm/llvm-project/pull/148983.diff 6 Files Affected:
diff --git a/libc/src/__support/macros/properties/architectures.h b/libc/src/__support/macros/properties/architectures.h
index c88956ff41148..ecc93196be286 100644
--- a/libc/src/__support/macros/properties/architectures.h
+++ b/libc/src/__support/macros/properties/architectures.h
@@ -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
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 1d547eac30952..cdd65585293d5 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -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
@@ -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
diff --git a/libcxx/include/limits b/libcxx/include/limits
index 1205e6a0c2781..e8581cf9c321d 100644
--- a/libcxx/include/limits
+++ b/libcxx/include/limits
@@ -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;
diff --git a/libcxx/src/random.cpp b/libcxx/src/random.cpp
index 5c6644811bfee..79815aadc7323 100644
--- a/libcxx/src/random.cpp
+++ b/libcxx/src/random.cpp
@@ -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
@@ -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) {
diff --git a/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp b/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp
index a9b1e44602bd2..66e149bf58d1b 100644
--- a/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp
@@ -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;
diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp
index 101079f09e1d2..f7d44d02c8a7c 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -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))
|
|
@llvm/pr-subscribers-llvm-binary-utilities Author: Brad Smith (brad0) ChangesFull diff: https://github.com/llvm/llvm-project/pull/148983.diff 6 Files Affected:
diff --git a/libc/src/__support/macros/properties/architectures.h b/libc/src/__support/macros/properties/architectures.h
index c88956ff41148..ecc93196be286 100644
--- a/libc/src/__support/macros/properties/architectures.h
+++ b/libc/src/__support/macros/properties/architectures.h
@@ -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
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 1d547eac30952..cdd65585293d5 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -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
@@ -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
diff --git a/libcxx/include/limits b/libcxx/include/limits
index 1205e6a0c2781..e8581cf9c321d 100644
--- a/libcxx/include/limits
+++ b/libcxx/include/limits
@@ -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;
diff --git a/libcxx/src/random.cpp b/libcxx/src/random.cpp
index 5c6644811bfee..79815aadc7323 100644
--- a/libcxx/src/random.cpp
+++ b/libcxx/src/random.cpp
@@ -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
@@ -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) {
diff --git a/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp b/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp
index a9b1e44602bd2..66e149bf58d1b 100644
--- a/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp
+++ b/libcxx/test/std/language.support/support.limits/limits/numeric.limits.members/traps.pass.cpp
@@ -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;
diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp
index 101079f09e1d2..f7d44d02c8a7c 100644
--- a/llvm/tools/llvm-readobj/ELFDumper.cpp
+++ b/llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -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))
|
|
cc @ldionne |
ldionne
left a comment
There was a problem hiding this comment.
Thanks a lot for the cleanup!
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/162/builds/27131 Here is the relevant piece of the build log for the reference |
|
@ldionne I didn't remove the bits from the __cxx03 headers. I saw elsewhere that they're frozen and should not be touched. How will they eventually be cleaned up? |
No description provided.