ldc: Enable the package, switch to lightly tweaked llvm from ldc repo, add more targets, update wiki link, and upgrade host D compiler to 2.075.1

This commit is contained in:
Joakim 2017-08-25 08:54:10 +00:00 committed by Fredrik Fornwall
parent aba64db72a
commit 4b8d96c72f
9 changed files with 8 additions and 87 deletions

View File

@ -1,79 +0,0 @@
diff --git a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 9f1e06b..cc6fb08 100644
--- a/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -139,6 +139,7 @@
return SectionKind::getThreadData();
if (Name == ".tbss" ||
+ Name == ".tcommon" ||
Name.startswith(".tbss.") ||
Name.startswith(".gnu.linkonce.tb.") ||
Name.startswith(".llvm.linkonce.tb."))
@@ -176,8 +176,8 @@ getELFSectionFlags(SectionKind K) {
if (K.isWriteable())
Flags |= ELF::SHF_WRITE;
- if (K.isThreadLocal())
- Flags |= ELF::SHF_TLS;
+ //if (K.isThreadLocal())
+ //Flags |= ELF::SHF_TLS;
if (K.isMergeableCString() || K.isMergeableConst())
Flags |= ELF::SHF_MERGE;
diff --git a/lib/MC/MCELFStreamer.cpp b/lib/MC/MCELFStreamer.cpp
index bdc4a84..14537be 100644
--- a/lib/MC/MCELFStreamer.cpp
+++ b/llvm/lib/MC/MCELFStreamer.cpp
@@ -397,7 +397,7 @@ void MCELFStreamer::fixSymbolsInTLSFixups(const MCExpr *expr) {
break;
}
getAssembler().registerSymbol(symRef.getSymbol());
- cast<MCSymbolELF>(symRef.getSymbol()).setType(ELF::STT_TLS);
+ //cast<MCSymbolELF>(symRef.getSymbol()).setType(ELF::STT_TLS);
break;
}
diff --git a/lib/MC/MCObjectFileInfo.cpp b/lib/MC/MCObjectFileInfo.cpp
index 8015ebb..0a2639f 100644
--- a/lib/MC/MCObjectFileInfo.cpp
+++ b/llvm/lib/MC/MCObjectFileInfo.cpp
@@ -448,10 +448,10 @@
TLSDataSection =
Ctx->getELFSection(".tdata", ELF::SHT_PROGBITS,
- ELF::SHF_ALLOC | ELF::SHF_TLS | ELF::SHF_WRITE);
+ ELF::SHF_ALLOC | /*ELF::SHF_TLS |*/ ELF::SHF_WRITE);
TLSBSSSection = Ctx->getELFSection(
- ".tbss", ELF::SHT_NOBITS, ELF::SHF_ALLOC | ELF::SHF_TLS | ELF::SHF_WRITE);
+ ".tbss", ELF::SHT_NOBITS, ELF::SHF_ALLOC | /*ELF::SHF_TLS |*/ ELF::SHF_WRITE);
DataRelROSection = Ctx->getELFSection(".data.rel.ro", ELF::SHT_PROGBITS,
ELF::SHF_ALLOC | ELF::SHF_WRITE);
diff --git a/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp b/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
index a821a6b..d169ab1 100644
--- a/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
+++ b/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp
@@ -174,7 +174,7 @@ unsigned ARMELFObjectWriter::GetRelocTypeInner(const MCValue &Target,
Type = ELF::R_ARM_GOT_BREL;
break;
case MCSymbolRefExpr::VK_TLSGD:
- Type = ELF::R_ARM_TLS_GD32;
+ Type = ELF::R_ARM_GOT_PREL;
break;
case MCSymbolRefExpr::VK_TPOFF:
Type = ELF::R_ARM_TLS_LE32;
diff --git a/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp b/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
index e8b0b4c..fcb9954 100644
--- a/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
+++ b/llvm/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
@@ -211,7 +211,7 @@
case MCSymbolRefExpr::VK_TLSGD:
assert(Type == RT32_32);
assert(!IsPCRel);
- return ELF::R_386_TLS_GD;
+ return ELF::R_386_GOT32;
case MCSymbolRefExpr::VK_GOTTPOFF:
assert(Type == RT32_32);
assert(!IsPCRel);

View File

@ -21,18 +21,18 @@ TERMUX_PKG_MAINTAINER="Joakim @joakim-noah"
termux_step_post_extract_package () {
local LLVM_SRC_VERSION=4.0.1
termux_download \
http://llvm.org/releases/${LLVM_SRC_VERSION}/llvm-${LLVM_SRC_VERSION}.src.tar.xz \
https://github.com/ldc-developers/llvm/releases/download/ldc-v${LLVM_SRC_VERSION}/llvm-${LLVM_SRC_VERSION}.src.tar.xz \
$TERMUX_PKG_CACHEDIR/llvm-${LLVM_SRC_VERSION}.src.tar.xz \
da783db1f82d516791179fe103c71706046561f7972b18f0049242dee6712b51
53dee2054a4da0a292fc55830119ae167812cc0eed5cc670223adc5a8731f71b
tar xf $TERMUX_PKG_CACHEDIR/llvm-${LLVM_SRC_VERSION}.src.tar.xz
mv llvm-${LLVM_SRC_VERSION}.src llvm
DMD_COMPILER_VERSION=2.074.1
DMD_COMPILER_VERSION=2.075.1
termux_download \
http://downloads.dlang.org/releases/2.x/${DMD_COMPILER_VERSION}/dmd.${DMD_COMPILER_VERSION}.linux.tar.xz \
$TERMUX_PKG_CACHEDIR/dmd.${DMD_COMPILER_VERSION}.linux.tar.xz \
e48783bd91d77bfdcd702bd268c5ac5d322975dd4b3ad68831babd74509d2ce9
6531c098020cf321b5e71c420a10db729566006b72e0af873b15b506a1583c57
sed "s#\@TERMUX_C_COMPILER\@#$TERMUX_STANDALONE_TOOLCHAIN/bin/$TERMUX_HOST_PLATFORM-clang#" \
$TERMUX_PKG_BUILDER_DIR/ldc-config-stdlib.patch.beforehostbuild.in > \
@ -74,7 +74,7 @@ termux_step_pre_configure () {
rm $TERMUX_PKG_BUILDER_DIR/ldc-llvm-config.patch
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DLLVM_DEFAULT_TARGET_TRIPLE=armv7a-linux-androideabi"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DLLVM_TARGET_ARCH=ARM -DLLVM_TARGETS_TO_BUILD=ARM"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" -DLLVM_TARGET_ARCH=ARM -DLLVM_TARGETS_TO_BUILD=AArch64;ARM;X86"
# CPPFLAGS adds the system llvm to the include path, which causes
# conflicts with the local patched llvm when compiling ldc

View File

@ -55,7 +55,7 @@ index a6a0b0b7..06d6c1c1 100644
endif()
- llvm_set(LIBRARY_DIRS libdir true)
- llvm_set_libs(LIBRARIES libs)
+ set(LLVM_LIBRARIES "-lLLVMTableGen;-lLLVMObjectYAML;-lLLVMOrcJIT;-lLLVMLineEditor;-lLLVMARMDisassembler;-lLLVMARMCodeGen;-lLLVMGlobalISel;-lLLVMSelectionDAG;-lLLVMAsmPrinter;-lLLVMARMAsmParser;-lLLVMARMDesc;-lLLVMMCDisassembler;-lLLVMARMInfo;-lLLVMARMAsmPrinter;-lLLVMMCJIT;-lLLVMLibDriver;-lLLVMOption;-lLLVMLTO;-lLLVMPasses;-lLLVMObjCARCOpts;-lLLVMMIRParser;-lLLVMSymbolize;-lLLVMDebugInfoPDB;-lLLVMDebugInfoCodeView;-lLLVMDebugInfoMSF;-lLLVMDebugInfoDWARF;-lgtest_main;-lgtest;-lLLVMCoroutines;-lLLVMipo;-lLLVMInstrumentation;-lLLVMVectorize;-lLLVMLinker;-lLLVMIRReader;-lLLVMAsmParser;-lLLVMInterpreter;-lLLVMExecutionEngine;-lLLVMRuntimeDyld;-lLLVMCodeGen;-lLLVMTarget;-lLLVMScalarOpts;-lLLVMInstCombine;-lLLVMTransformUtils;-lLLVMBitWriter;-lLLVMAnalysis;-lLLVMCoverage;-lLLVMProfileData;-lLLVMObject;-lLLVMMCParser;-lLLVMMC;-lLLVMBitReader;-lLLVMCore;-lLLVMSupport;-lLLVMDemangle")
+ set(LLVM_LIBRARIES "-lLLVMTableGen;-lLLVMLibDriver;-lLLVMOption;-lLLVMSymbolize;-lLLVMDebugInfoPDB;-lLLVMDebugInfoDWARF;-lLLVMAArch64Disassembler;-lLLVMAArch64CodeGen;-lLLVMAArch64AsmParser;-lLLVMAArch64Desc;-lLLVMAArch64Info;-lLLVMAArch64AsmPrinter;-lLLVMAArch64Utils;-lLLVMARMDisassembler;-lLLVMARMCodeGen;-lLLVMARMAsmParser;-lLLVMARMDesc;-lLLVMARMInfo;-lLLVMARMAsmPrinter;-lLLVMLineEditor;-lLLVMMIRParser;-lLLVMLTO;-lLLVMPasses;-lLLVMObjCARCOpts;-lLLVMOrcJIT;-lLLVMInterpreter;-lLLVMObjectYAML;-lLLVMX86Disassembler;-lLLVMX86AsmParser;-lLLVMX86CodeGen;-lLLVMGlobalISel;-lLLVMSelectionDAG;-lLLVMAsmPrinter;-lLLVMDebugInfoCodeView;-lLLVMDebugInfoMSF;-lLLVMCodeGen;-lLLVMX86Desc;-lLLVMMCDisassembler;-lLLVMX86Info;-lLLVMX86AsmPrinter;-lLLVMX86Utils;-lLLVMMCJIT;-lLLVMExecutionEngine;-lLLVMTarget;-lLLVMRuntimeDyld;-lgtest_main;-lgtest;-lLLVMCoroutines;-lLLVMipo;-lLLVMInstrumentation;-lLLVMVectorize;-lLLVMScalarOpts;-lLLVMLinker;-lLLVMIRReader;-lLLVMAsmParser;-lLLVMInstCombine;-lLLVMTransformUtils;-lLLVMBitWriter;-lLLVMAnalysis;-lLLVMCoverage;-lLLVMProfileData;-lLLVMObject;-lLLVMMCParser;-lLLVMMC;-lLLVMBitReader;-lLLVMCore;-lLLVMSupport;-lLLVMDemangle")
# LLVM bug: llvm-config --libs tablegen returns -lLLVM-3.8.0
# but code for it is not in shared library
if("${LLVM_FIND_COMPONENTS}" MATCHES "tablegen")
@ -64,7 +64,7 @@ index a6a0b0b7..06d6c1c1 100644
endif()
endif()
- llvm_set(TARGETS_TO_BUILD targets-built)
+ set(LLVM_TARGETS_TO_BUILD "ARM")
+ set(LLVM_TARGETS_TO_BUILD "AArch64 ARM X86")
string(REGEX MATCHALL "${pattern}[^ ]+" LLVM_TARGETS_TO_BUILD ${LLVM_TARGETS_TO_BUILD})
endif()

View File

@ -18,7 +18,7 @@ index 00000000..cd578cb7
+You can find instructions on building Android apps at the
+D wiki:
+
+http://wiki.dlang.org/Build_LDC_for_Android
+http://wiki.dlang.org/Build_D_for_Android
+
+For further information, including how to report bugs,
+please refer to the LDC wiki: http://wiki.dlang.org/LDC.