Martin Kinkelin
5 years ago
4 changed files with 22 additions and 236 deletions
@ -1,70 +0,0 @@ |
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|||
index a9cd81983..b7700a7d2 100644
|
|||
--- a/CMakeLists.txt
|
|||
+++ b/CMakeLists.txt
|
|||
@@ -562,6 +562,16 @@ add_custom_target(${LDMD_EXE} ALL DEPENDS ${LDMD_EXE_FULL})
|
|||
# Figure out how to link the main LDC executable, for which we need to take the |
|||
# LLVM flags into account. |
|||
set(LDC_LINKERFLAG_LIST ${SANITIZE_LDFLAGS} ${LLVM_LIBRARIES} ${LLVM_LDFLAGS}) |
|||
+if(MSVC)
|
|||
+ # Issue 1297 – set LDC's stack to 8 MiB like on Linux and Mac (default: 1 MiB).
|
|||
+ list(APPEND LDC_LINKERFLAG_LIST "/STACK:8388608")
|
|||
+ # VS 2017+: Use undocumented /NOOPTTLS MS linker switch to keep on emitting
|
|||
+ # a .tls section. Required for older host druntime versions, otherwise the
|
|||
+ # GC TLS ranges are garbage starting with VS 2017 Update 15.3.
|
|||
+ if(MSVC_VERSION GREATER 1900) # VS 2017+
|
|||
+ list(APPEND LDC_LINKERFLAG_LIST "/NOOPTTLS")
|
|||
+ endif()
|
|||
+endif()
|
|||
if(LDC_WITH_LLD) |
|||
# ELF, Mach-O, MinGW and WebAssembly formats supported since LLD 6.0.0, otherwise just Windows COFF |
|||
if(NOT (LDC_LLVM_VER LESS 600)) |
|||
@@ -615,9 +625,11 @@ if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR (${CMAKE_CXX_COMPILER_ID} MATCHES "Clan
|
|||
# we manually invoke the linker instead of using the D compiler to do so. |
|||
set(LDC_LINK_MANUALLY ON) |
|||
|
|||
- include(ExtractDMDSystemLinker)
|
|||
- message(STATUS "Host D compiler linker program: ${D_LINKER_COMMAND}")
|
|||
- message(STATUS "Host D compiler linker flags: ${D_LINKER_ARGS}")
|
|||
+ if(NOT DEFINED D_LINKER_ARGS)
|
|||
+ include(ExtractDMDSystemLinker)
|
|||
+ message(STATUS "Host D compiler linker program: ${D_LINKER_COMMAND}")
|
|||
+ message(STATUS "Host D compiler linker flags: ${D_LINKER_ARGS}")
|
|||
+ endif()
|
|||
list(APPEND LDC_LINKERFLAG_LIST ${D_LINKER_ARGS}) |
|||
|
|||
if(NOT "${CMAKE_EXE_LINKER_FLAGS}" STREQUAL "") |
|||
@@ -625,23 +637,11 @@ if(UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR (${CMAKE_CXX_COMPILER_ID} MATCHES "Clan
|
|||
list(APPEND LDC_LINKERFLAG_LIST ${flags}) |
|||
endif() |
|||
else() |
|||
- # Use D compiler for linking, trying to translate a few common linker flags.
|
|||
+ # use D compiler for linking
|
|||
set(LDC_TRANSLATED_LINKER_FLAGS "") |
|||
foreach(f ${LDC_LINKERFLAG_LIST}) |
|||
- string(REPLACE "-LIBPATH:" "/LIBPATH:" f ${f})
|
|||
list(APPEND LDC_TRANSLATED_LINKER_FLAGS "-L${f}") |
|||
endforeach() |
|||
-
|
|||
- if(MSVC)
|
|||
- # Issue 1297 – set LDC's stack to 8 MiB like on Linux and Mac (default: 1 MiB).
|
|||
- list(APPEND LDC_TRANSLATED_LINKER_FLAGS "-L/STACK:8388608")
|
|||
- # VS 2017+: Use undocumented /NOOPTTLS MS linker switch to keep on emitting
|
|||
- # a .tls section. Required for older host druntime versions, otherwise the
|
|||
- # GC TLS ranges are garbage starting with VS 2017 Update 15.3.
|
|||
- if(MSVC_VERSION GREATER 1900) # VS 2017+
|
|||
- list(APPEND LDC_TRANSLATED_LINKER_FLAGS "-L/NOOPTTLS")
|
|||
- endif()
|
|||
- endif()
|
|||
endif() |
|||
|
|||
# CONFIG generator expressions need to be repeated due to https://cmake.org/Bug/view.php?id=14353 |
|||
@@ -838,7 +838,7 @@ endif()
|
|||
# |
|||
# Auxiliary build and test utils. |
|||
# |
|||
-add_subdirectory(utils)
|
|||
+#add_subdirectory(utils)
|
|||
|
|||
# |
|||
# Auxiliary tools. |
@ -1,26 +0,0 @@ |
|||
diff --git a/src/core/runtime.d b/src/core/runtime.d
|
|||
index 03103daa..fd185816 100644
|
|||
--- a/src/core/runtime.d
|
|||
+++ b/runtime/druntime/src/core/runtime.d
|
|||
@@ -799,7 +799,8 @@ unittest
|
|||
} |
|||
|
|||
/// Default implementation for POSIX systems |
|||
-version (Posix) private class DefaultTraceInfo : Throwable.TraceInfo
|
|||
+version (CRuntime_Bionic) { /* no backtrace[_symbols] */ }
|
|||
+else version (Posix) private class DefaultTraceInfo : Throwable.TraceInfo
|
|||
{ |
|||
// backtrace |
|||
version (CRuntime_Glibc) |
|||
@@ -825,7 +826,10 @@ version (Posix) private class DefaultTraceInfo : Throwable.TraceInfo
|
|||
{ |
|||
version (LDC) |
|||
{ |
|||
- numframes = backtrace( callstack.ptr, MAXFRAMES );
|
|||
+ static if ( __traits( compiles, backtrace ) )
|
|||
+ numframes = backtrace( callstack.ptr, MAXFRAMES );
|
|||
+ else
|
|||
+ numframes = 0;
|
|||
} |
|||
else |
|||
{ |
@ -1,121 +0,0 @@ |
|||
#!/bin/bash |
|||
show_help () { |
|||
echo "usage: llvm-config <OPTION>... [<COMPONENT>...] |
|||
|
|||
Get various configuration information needed to compile programs which use |
|||
LLVM. Typically called from 'configure' scripts. Examples: |
|||
llvm-config --cxxflags |
|||
llvm-config --ldflags |
|||
llvm-config --libs engine bcreader scalaropts |
|||
|
|||
Options: |
|||
--version Print LLVM version. |
|||
--prefix Print the installation prefix. |
|||
--src-root Print the source root LLVM was built from. |
|||
--obj-root Print the object root used to build LLVM. |
|||
--bindir Directory containing LLVM executables. |
|||
--includedir Directory containing LLVM headers. |
|||
--libdir Directory containing LLVM libraries. |
|||
--cppflags C preprocessor flags for files that include LLVM headers. |
|||
--cflags C compiler flags for files that include LLVM headers. |
|||
--cxxflags C++ compiler flags for files that include LLVM headers. |
|||
--ldflags Print Linker flags. |
|||
--system-libs System Libraries needed to link against LLVM components. |
|||
--libs Libraries needed to link against LLVM components. |
|||
--libnames Bare library names for in-tree builds. |
|||
--libfiles Fully qualified library filenames for makefile depends. |
|||
--components List of all possible components. |
|||
--targets-built List of all targets currently built. |
|||
--host-target Target triple used to configure LLVM. |
|||
--build-mode Print build mode of LLVM tree (e.g. Debug or Release). |
|||
--assertion-mode Print assertion mode of LLVM tree (ON or OFF). |
|||
--build-system Print the build system used to build LLVM (always cmake). |
|||
--has-rtti Print whether or not LLVM was built with rtti (YES or NO). |
|||
--has-global-isel Print whether or not LLVM was built with global-isel support (YES or NO). |
|||
--shared-mode Print how the provided components can be collectively linked (\`shared\` or \`static\`). |
|||
--link-shared Link the components as shared libraries. |
|||
--link-static Link the component libraries statically. |
|||
Typical components: |
|||
all All LLVM libraries (default). |
|||
engine Either a native JIT or a bitcode interpreter." |
|||
} |
|||
|
|||
version=@LLVM_VERSION@ |
|||
prefix=@LLVM_INSTALL_DIR@ |
|||
has_rtti=NO |
|||
CPPFLAGS="-I@TERMUX_PKG_SRCDIR@/llvm/include -I${prefix}/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" |
|||
CFLAGS="${CPPFLAGS} ${CFLAGS} -fPIC -Werror=date-time -Wall -W -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic \ |
|||
-Wno-long-long -Wcovered-switch-default -Wdelete-non-virtual-dtor -Wstring-conversion \ |
|||
-ffunction-sections -fdata-sections -Os -DNDEBUG -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" |
|||
CXXFLAGS="${CFLAGS} -fvisibility-inlines-hidden -Wcast-qual -Wnon-virtual-dtor -std=c++11 -fno-exceptions" |
|||
if [ "$has_rtti" != "YES" ]; then CXXFLAGS="$CXXFLAGS -fno-rtti"; fi |
|||
LDFLAGS="-L${prefix}/lib" |
|||
LIBFILE="${prefix}/lib/libLLVM-$version.so" |
|||
|
|||
components="aarch64 aarch64asmparser aarch64asmprinter aarch64codegen aarch64desc aarch64disassembler \ |
|||
aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armasmprinter \ |
|||
armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter binaryformat bitreader bitwriter \ |
|||
codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfomsf debuginfopdb demangle \ |
|||
dlltooldriver engine executionengine fuzzmutate globalisel instcombine instrumentation \ |
|||
interpreter ipo irreader libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mirparser \ |
|||
native nativecodegen objcarcopts object objectyaml option optremarks orcjit passes profiledata runtimedyld \ |
|||
scalaropts selectiondag support symbolize tablegen target textapi transformutils vectorize \ |
|||
webassembly webassemblyasmparser webassemblyasmprinter webassemblycodegen webassemblydesc \ |
|||
webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86asmprinter x86codegen x86desc \ |
|||
x86disassembler x86info x86utils xray" |
|||
static_libs="-lLLVMSymbolize -lLLVMDebugInfoPDB -lLLVMDebugInfoDWARF -lLLVMCoverage -lLLVMDlltoolDriver \ |
|||
-lLLVMLineEditor -lLLVMOrcJIT -lLLVMMCA -lLLVMWindowsManifest -lLLVMTextAPI \ |
|||
-lLLVMFuzzMutate -lLLVMMCJIT -lLLVMCoroutines -lLLVMLTO -lLLVMPasses -lLLVMObjCARCOpts -lLLVMipo \ |
|||
-lLLVMInstrumentation -lLLVMVectorize -lLLVMLinker -lLLVMIRReader -lLLVMMIRParser -lLLVMAsmParser \ |
|||
-lLLVMTableGen -lLLVMXRay -lLLVMWebAssemblyDisassembler -lLLVMWebAssemblyCodeGen -lLLVMWebAssemblyDesc \ |
|||
-lLLVMWebAssemblyAsmPrinter -lLLVMWebAssemblyAsmParser -lLLVMWebAssemblyInfo -lLLVMX86Disassembler \ |
|||
-lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils \ |
|||
-lLLVMARMDisassembler -lLLVMARMCodeGen -lLLVMARMAsmParser -lLLVMARMDesc -lLLVMARMInfo -lLLVMARMAsmPrinter \ |
|||
-lLLVMARMUtils -lLLVMAArch64Disassembler -lLLVMMCDisassembler -lLLVMAArch64CodeGen -lLLVMGlobalISel \ |
|||
-lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMAArch64AsmParser -lLLVMAArch64Desc -lLLVMAArch64Info \ |
|||
-lLLVMAArch64AsmPrinter -lLLVMAArch64Utils -lLLVMObjectYAML -lLLVMLibDriver -lLLVMOption -lLLVMOptRemarks \ |
|||
-lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMCodeGen -lLLVMTarget -lLLVMScalarOpts \ |
|||
-lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis \ |
|||
-lLLVMProfileData -lLLVMObject -lLLVMMCParser -lLLVMMC -lLLVMDebugInfoCodeView -lLLVMDebugInfoMSF \ |
|||
-lLLVMBitReader -lLLVMCore -lLLVMBinaryFormat -lLLVMSupport -lLLVMDemangle" |
|||
shared_libs="-lLLVM-$version" |
|||
libs=$shared_libs |
|||
handle_args () { |
|||
if [ "${1:0:2}" != "--" ]; then return 0; fi |
|||
case "${1:2}" in |
|||
link-shared) libs=$shared_libs ;; |
|||
link-static) libs=$static_libs ;; |
|||
version) echo "$version";; |
|||
prefix) echo "$prefix";; |
|||
src-root) echo "@TERMUX_PKG_SRCDIR@";; |
|||
obj-root) echo "$prefix";; |
|||
bindir) echo "$prefix/bin";; |
|||
includedir) echo "$prefix/include";; |
|||
libdir) echo "$prefix/lib";; |
|||
cppflags) echo "$CPPFLAGS";; |
|||
cflags) echo "$CFLAGS";; |
|||
cxxflags) echo "$CXXFLAGS";; |
|||
ldflags) echo "$LDFLAGS";; |
|||
system-libs) echo "-lc -ldl -lz -lm";; |
|||
libs) echo "$static_libs";; |
|||
libnames) echo "libLLVM-$version.so";; |
|||
libfiles) echo "$LIBFILE";; |
|||
components) echo "$components";; |
|||
targets-built) echo "@LLVM_TARGETS@";; |
|||
host-target) echo "@LLVM_DEFAULT_TARGET_TRIPLE@";; |
|||
build-mode) echo "Release";; |
|||
assertion-mode) echo "OFF";; |
|||
build-system) echo "cmake";; |
|||
has-rtti) echo "$has_rtti";; |
|||
has-global-isel) echo "ON";; |
|||
shared-mode) echo "static";; |
|||
cmakedir) echo "$prefix/lib/cmake/llvm";; |
|||
*) echo "Unsupported llvm-config switch: ${1}" >&2; exit 1;; |
|||
esac |
|||
} |
|||
|
|||
if [ "$#" -eq 0 ]; then |
|||
show_help >&2 |
|||
else |
|||
for arg in $@; do handle_args $arg; done |
|||
fi |
Loading…
Reference in new issue