[PATCH] D119989: [clangd] Fix building SerializationTests unit test on OpenBSD
Brad Smith via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 16 16:05:55 PST 2022
brad created this revision.
brad added reviewers: sammccall, kadircet.
brad added a project: clang.
Herald added subscribers: usaxena95, arphaman, krytarowski.
brad requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay, ilya-biryukov.
Herald added projects: LLVM, clang-tools-extra.
This fixes building the unit tests on OpenBSD. OpenBSD does not support RLIMIT_AS.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D119989
Files:
clang-tools-extra/clangd/unittests/SerializationTests.cpp
llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
Index: llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
===================================================================
--- llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
+++ llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
@@ -286,7 +286,7 @@
uintptr_t SlabSize = 0;
uintptr_t CurrentSlabOffset = 0;
SectionIDMap *SecIDMap = nullptr;
-#if defined(__x86_64__) && defined(__ELF__)
+#if defined(__x86_64__) && defined(__ELF__) && !defined(__OpenBSD__)
unsigned UsedTLSStorage = 0;
#endif
};
@@ -350,7 +350,7 @@
// In case the execution needs TLS storage, we define a very small TLS memory
// area here that will be used in allocateTLSSection().
-#if defined(__x86_64__) && defined(__ELF__)
+#if defined(__x86_64__) && defined(__ELF__) && !defined(__OpenBSD__)
extern "C" {
alignas(16) __attribute__((visibility("hidden"), tls_model("initial-exec"),
used)) thread_local char LLVMRTDyldTLSSpace[16];
@@ -361,7 +361,7 @@
TrivialMemoryManager::allocateTLSSection(uintptr_t Size, unsigned Alignment,
unsigned SectionID,
StringRef SectionName) {
-#if defined(__x86_64__) && defined(__ELF__)
+#if defined(__x86_64__) && defined(__ELF__) && !defined(__OpenBSD__)
if (Size + UsedTLSStorage > sizeof(LLVMRTDyldTLSSpace)) {
return {};
}
Index: clang-tools-extra/clangd/unittests/SerializationTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/SerializationTests.cpp
+++ clang-tools-extra/clangd/unittests/SerializationTests.cpp
@@ -310,7 +310,7 @@
// rlimit is part of POSIX.
// Sanitizers use a lot of address space, so we can't apply strict limits.
-#if LLVM_ON_UNIX && !LLVM_ADDRESS_SANITIZER_BUILD && \
+#if LLVM_ON_UNIX && defined(RLIMIT_AS) && !LLVM_ADDRESS_SANITIZER_BUILD && \
!LLVM_MEMORY_SANITIZER_BUILD
class ScopedMemoryLimit {
struct rlimit OriginalLimit;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119989.409444.patch
Type: text/x-patch
Size: 1985 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220217/8ee5712a/attachment.bin>
More information about the cfe-commits
mailing list