[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
This commit is contained in:
parent
7eb3ce997a
commit
7db1d4d8da
|
@ -286,7 +286,7 @@ private:
|
||||||
uintptr_t SlabSize = 0;
|
uintptr_t SlabSize = 0;
|
||||||
uintptr_t CurrentSlabOffset = 0;
|
uintptr_t CurrentSlabOffset = 0;
|
||||||
SectionIDMap *SecIDMap = nullptr;
|
SectionIDMap *SecIDMap = nullptr;
|
||||||
#if defined(__x86_64__) && defined(__ELF__)
|
#if defined(__x86_64__) && defined(__ELF__) && defined(__linux__)
|
||||||
unsigned UsedTLSStorage = 0;
|
unsigned UsedTLSStorage = 0;
|
||||||
#endif
|
#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
|
// In case the execution needs TLS storage, we define a very small TLS memory
|
||||||
// area here that will be used in allocateTLSSection().
|
// area here that will be used in allocateTLSSection().
|
||||||
#if defined(__x86_64__) && defined(__ELF__)
|
#if defined(__x86_64__) && defined(__ELF__) && defined(__linux__)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
alignas(16) __attribute__((visibility("hidden"), tls_model("initial-exec"),
|
alignas(16) __attribute__((visibility("hidden"), tls_model("initial-exec"),
|
||||||
used)) thread_local char LLVMRTDyldTLSSpace[16];
|
used)) thread_local char LLVMRTDyldTLSSpace[16];
|
||||||
|
@ -361,7 +361,7 @@ TrivialMemoryManager::TLSSection
|
||||||
TrivialMemoryManager::allocateTLSSection(uintptr_t Size, unsigned Alignment,
|
TrivialMemoryManager::allocateTLSSection(uintptr_t Size, unsigned Alignment,
|
||||||
unsigned SectionID,
|
unsigned SectionID,
|
||||||
StringRef SectionName) {
|
StringRef SectionName) {
|
||||||
#if defined(__x86_64__) && defined(__ELF__)
|
#if defined(__x86_64__) && defined(__ELF__) && defined(__linux__)
|
||||||
if (Size + UsedTLSStorage > sizeof(LLVMRTDyldTLSSpace)) {
|
if (Size + UsedTLSStorage > sizeof(LLVMRTDyldTLSSpace)) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue