[llvm-branch-commits] [llvm] 56ac6db - [RuntimeDyld] Fix building on OpenBSD
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Feb 21 13:51:09 PST 2022
Author: Brad Smith
Date: 2022-02-21T13:48:49-08:00
New Revision: 56ac6dbc736904c3e812c575853e1e683aa0ed6a
URL: https://github.com/llvm/llvm-project/commit/56ac6dbc736904c3e812c575853e1e683aa0ed6a
DIFF: https://github.com/llvm/llvm-project/commit/56ac6dbc736904c3e812c575853e1e683aa0ed6a.diff
LOG: [RuntimeDyld] Fix building on OpenBSD
With https://reviews.llvm.org/D105466 the tree does not build on OpenBSD/amd64.
Moritz suggested only building this code on Linux.
Reviewed By: MoritzS
Differential Revision: https://reviews.llvm.org/D119991
(cherry picked from commit 7db1d4d8da4d4dfc5d0240825e8c4d536a12b19c)
Added:
Modified:
llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
Removed:
################################################################################
diff --git a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
index 21339a3f8f3d8..893d8a55c8950 100644
--- a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
+++ b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
@@ -286,7 +286,7 @@ class TrivialMemoryManager : public RTDyldMemoryManager {
uintptr_t SlabSize = 0;
uintptr_t CurrentSlabOffset = 0;
SectionIDMap *SecIDMap = nullptr;
-#if defined(__x86_64__) && defined(__ELF__)
+#if defined(__x86_64__) && defined(__ELF__) && defined(__linux__)
unsigned UsedTLSStorage = 0;
#endif
};
@@ -350,7 +350,7 @@ uint8_t *TrivialMemoryManager::allocateDataSection(uintptr_t Size,
// 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(__linux__)
extern "C" {
alignas(16) __attribute__((visibility("hidden"), tls_model("initial-exec"),
used)) thread_local char LLVMRTDyldTLSSpace[16];
@@ -361,7 +361,7 @@ TrivialMemoryManager::TLSSection
TrivialMemoryManager::allocateTLSSection(uintptr_t Size, unsigned Alignment,
unsigned SectionID,
StringRef SectionName) {
-#if defined(__x86_64__) && defined(__ELF__)
+#if defined(__x86_64__) && defined(__ELF__) && defined(__linux__)
if (Size + UsedTLSStorage > sizeof(LLVMRTDyldTLSSpace)) {
return {};
}
More information about the llvm-branch-commits
mailing list