Skip to content

Commit 7db1d4d

Browse files
committed
[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
1 parent 7eb3ce9 commit 7db1d4d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ class TrivialMemoryManager : public RTDyldMemoryManager {
286286
uintptr_t SlabSize = 0;
287287
uintptr_t CurrentSlabOffset = 0;
288288
SectionIDMap *SecIDMap = nullptr;
289-
#if defined(__x86_64__) && defined(__ELF__)
289+
#if defined(__x86_64__) && defined(__ELF__) && defined(__linux__)
290290
unsigned UsedTLSStorage = 0;
291291
#endif
292292
};
@@ -350,7 +350,7 @@ uint8_t *TrivialMemoryManager::allocateDataSection(uintptr_t Size,
350350

351351
// In case the execution needs TLS storage, we define a very small TLS memory
352352
// area here that will be used in allocateTLSSection().
353-
#if defined(__x86_64__) && defined(__ELF__)
353+
#if defined(__x86_64__) && defined(__ELF__) && defined(__linux__)
354354
extern "C" {
355355
alignas(16) __attribute__((visibility("hidden"), tls_model("initial-exec"),
356356
used)) thread_local char LLVMRTDyldTLSSpace[16];
@@ -361,7 +361,7 @@ TrivialMemoryManager::TLSSection
361361
TrivialMemoryManager::allocateTLSSection(uintptr_t Size, unsigned Alignment,
362362
unsigned SectionID,
363363
StringRef SectionName) {
364-
#if defined(__x86_64__) && defined(__ELF__)
364+
#if defined(__x86_64__) && defined(__ELF__) && defined(__linux__)
365365
if (Size + UsedTLSStorage > sizeof(LLVMRTDyldTLSSpace)) {
366366
return {};
367367
}

0 commit comments

Comments
 (0)