chiark / gitweb /
packages/ldc -> disabled-packages/ldc
[termux-packages] / disabled-packages / ldc / llvm-android_tls.patch.beforehostbuild
1 diff --git a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
2 index 9f1e06b..cc6fb08 100644
3 --- a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
4 +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
5 @@ -139,6 +139,7 @@
6      return SectionKind::getThreadData();
7  
8    if (Name == ".tbss" ||
9 +      Name == ".tcommon" ||
10        Name.startswith(".tbss.") ||
11        Name.startswith(".gnu.linkonce.tb.") ||
12        Name.startswith(".llvm.linkonce.tb."))
13 @@ -176,8 +176,8 @@ getELFSectionFlags(SectionKind K) {
14    if (K.isWriteable())
15      Flags |= ELF::SHF_WRITE;
16  
17 -  if (K.isThreadLocal())
18 -    Flags |= ELF::SHF_TLS;
19 +  //if (K.isThreadLocal())
20 +    //Flags |= ELF::SHF_TLS;
21  
22    if (K.isMergeableCString() || K.isMergeableConst())
23      Flags |= ELF::SHF_MERGE;
24 diff --git a/lib/MC/MCELFStreamer.cpp b/lib/MC/MCELFStreamer.cpp
25 index bdc4a84..14537be 100644
26 --- a/lib/MC/MCELFStreamer.cpp
27 +++ b/llvm/lib/MC/MCELFStreamer.cpp
28 @@ -397,7 +397,7 @@ void MCELFStreamer::fixSymbolsInTLSFixups(const MCExpr *expr) {
29        break;
30      }
31      getAssembler().registerSymbol(symRef.getSymbol());
32 -    cast<MCSymbolELF>(symRef.getSymbol()).setType(ELF::STT_TLS);
33 +    //cast<MCSymbolELF>(symRef.getSymbol()).setType(ELF::STT_TLS);
34      break;
35    }
36  
37 diff --git a/lib/MC/MCObjectFileInfo.cpp b/lib/MC/MCObjectFileInfo.cpp
38 index 8015ebb..0a2639f 100644
39 --- a/lib/MC/MCObjectFileInfo.cpp
40 +++ b/llvm/lib/MC/MCObjectFileInfo.cpp
41 @@ -448,10 +448,10 @@
42  
43    TLSDataSection =
44        Ctx->getELFSection(".tdata", ELF::SHT_PROGBITS,
45 -                         ELF::SHF_ALLOC | ELF::SHF_TLS | ELF::SHF_WRITE);
46 +                         ELF::SHF_ALLOC | /*ELF::SHF_TLS |*/ ELF::SHF_WRITE);
47  
48    TLSBSSSection = Ctx->getELFSection(
49 -      ".tbss", ELF::SHT_NOBITS, ELF::SHF_ALLOC | ELF::SHF_TLS | ELF::SHF_WRITE);
50 +      ".tbss", ELF::SHT_NOBITS, ELF::SHF_ALLOC | /*ELF::SHF_TLS |*/ ELF::SHF_WRITE);
51  
52    DataRelROSection = Ctx->getELFSection(".data.rel.ro", ELF::SHT_PROGBITS,
53                                          ELF::SHF_ALLOC | ELF::SHF_WRITE);
54 diff --git a/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp b/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
55 index a821a6b..d169ab1 100644
56 --- a/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
57 +++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
58 @@ -174,7 +174,7 @@ unsigned ARMELFObjectWriter::GetRelocTypeInner(const MCValue &Target,
59          Type = ELF::R_ARM_GOT_BREL;
60          break;
61        case MCSymbolRefExpr::VK_TLSGD:
62 -        Type = ELF::R_ARM_TLS_GD32;
63 +        Type = ELF::R_ARM_GOT_PREL;
64          break;
65        case MCSymbolRefExpr::VK_TPOFF:
66          Type = ELF::R_ARM_TLS_LE32;
67 diff --git a/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp b/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
68 index e8b0b4c..fcb9954 100644
69 --- a/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
70 +++ b/llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
71 @@ -211,7 +211,7 @@
72    case MCSymbolRefExpr::VK_TLSGD:
73      assert(Type == RT32_32);
74      assert(!IsPCRel);
75 -    return ELF::R_386_TLS_GD;
76 +    return ELF::R_386_GOT32;
77    case MCSymbolRefExpr::VK_GOTTPOFF:
78      assert(Type == RT32_32);
79      assert(!IsPCRel);