diff --git a/.github/actions/1-setup/action.yml b/.github/actions/1-setup/action.yml index c83400a3182..74bca5f8952 100644 --- a/.github/actions/1-setup/action.yml +++ b/.github/actions/1-setup/action.yml @@ -23,7 +23,7 @@ runs: packages=( \ git-core cmake g++ \ - libcurl4 libxml2-dev libzstd-dev \ + libcurl4 libzstd-dev \ curl gdb p7zip-full tzdata unzip zip python3-pip \ ) if [[ $arch == x86_64 ]]; then @@ -37,30 +37,30 @@ runs: # Make sure to link libzstd statically sudo rm /usr/lib/$arch-linux-gnu/libzstd.so - - name: 'Linux: Install clang 19 from apt.llvm.org' + - name: 'Linux: Install clang 20 from apt.llvm.org' if: runner.os == 'Linux' shell: bash run: | set -eux cd .. curl -fL --retry 3 --max-time 30 -O https://apt.llvm.org/llvm.sh - sudo bash llvm.sh 19 + sudo bash llvm.sh 20 for tool in clang clang++ ld.lld; do - sudo ln -sf $tool-19 /usr/bin/$tool + sudo ln -sf $tool-20 /usr/bin/$tool $tool --version done - - name: 'macOS arm64: Install Homebrew clang 19' # see mimalloc comment in ../3-build-native/action.yml + - name: 'macOS arm64: Install Homebrew clang 20' # see mimalloc comment in ../3-build-native/action.yml if: runner.os == 'macOS' && inputs.arch == 'arm64' shell: bash - run: brew install llvm@19 - - name: 'Windows: Install clang v19.1.3 from GitHub' + run: brew install llvm@20 + - name: 'Windows: Install clang v20.1.3 from GitHub' if: runner.os == 'Windows' shell: bash run: | set -eux cd .. curl -fL --retry 3 --max-time 300 -o clang.exe \ - https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.3/LLVM-19.1.3-win64.exe + https://github.com/llvm/llvm-project/releases/download/llvmorg-20.1.3/LLVM-20.1.3-win64.exe ./clang.exe //S # double-slash for bash rm clang.exe # C:\Program Files\LLVM\bin should already be in PATH diff --git a/.github/actions/3-build-cross/android-llvm-config.in b/.github/actions/3-build-cross/android-llvm-config.in index c67f3b2a6f7..8ac719b4b9f 100644 --- a/.github/actions/3-build-cross/android-llvm-config.in +++ b/.github/actions/3-build-cross/android-llvm-config.in @@ -45,36 +45,36 @@ prefix=@LLVM_INSTALL_DIR@ has_rtti=NO CPPFLAGS="-I${prefix}/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" CFLAGS="${CPPFLAGS} ${CFLAGS}" -CXXFLAGS="${CFLAGS} -std=c++17 -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables" +CXXFLAGS="${CFLAGS} -std=c++17 -fno-exceptions -funwind-tables" if [ "$has_rtti" != "YES" ]; then CXXFLAGS="$CXXFLAGS -fno-rtti"; fi LDFLAGS="-L${prefix}/lib" LIBFILE="${prefix}/lib/libLLVM-$version.so" components="aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils \ aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils \ -asmparser asmprinter binaryformat bitreader bitstreamreader bitwriter cfguard codegen codegendata codegentypes core coroutines coverage \ +asmparser asmprinter binaryformat bitreader bitstreamreader bitwriter cfguard cgdata codegen codegentypes core coroutines coverage \ debuginfobtf debuginfocodeview debuginfodwarf debuginfogsym debuginfologicalview debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker dwarflinkerclassic dwarflinkerparallel dwp \ -engine executionengine extensions filecheck frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hipstdpar instcombine \ +engine executionengine extensions filecheck frontendatomic frontenddriver frontendhlsl frontendoffloading frontendopenacc frontendopenmp fuzzercli fuzzmutate globalisel hipstdpar instcombine \ instrumentation interfacestub interpreter ipo irprinter irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler \ mcjit mcparser mirparser native nativecodegen objcarcopts objcopy object objectyaml option orcdebugging orcjit orcshared orctargetprocess \ -passes profiledata remarks runtimedyld sandboxir scalaropts selectiondag spirv spirvanalysis spirvcodegen spirvdesc spirvinfo support symbolize tablegen target targetparser textapi \ +passes profiledata remarks runtimedyld sandboxir scalaropts selectiondag spirv spirvanalysis spirvcodegen spirvdesc spirvinfo support symbolize tablegen target targetparser telemetry textapi \ textapibinaryreader transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler \ webassemblyinfo webassemblyutils windowsdriver windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info \ x86targetmca xray" -static_libs="-lLLVMWindowsManifest -lLLVMXRay -lLLVMLibDriver -lLLVMDlltoolDriver -lLLVMTextAPIBinaryReader -lLLVMCoverage -lLLVMLineEditor \ --lLLVMSandboxIR -lLLVMSPIRVCodeGen -lLLVMSPIRVDesc -lLLVMSPIRVInfo -lLLVMSPIRVAnalysis \ --lLLVMX86TargetMCA -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMWebAssemblyDisassembler \ +static_libs="-lLLVMWindowsManifest -lLLVMXRay -lLLVMLibDriver -lLLVMDlltoolDriver -lLLVMTelemetry -lLLVMTextAPIBinaryReader -lLLVMCoverage -lLLVMLineEditor \ +-lLLVMX86TargetMCA -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info \ +-lLLVMSPIRVCodeGen -lLLVMSPIRVDesc -lLLVMSPIRVInfo -lLLVMSPIRVAnalysis -lLLVMWebAssemblyDisassembler \ -lLLVMWebAssemblyAsmParser -lLLVMWebAssemblyCodeGen -lLLVMWebAssemblyUtils -lLLVMWebAssemblyDesc -lLLVMWebAssemblyInfo -lLLVMARMDisassembler \ -lLLVMARMAsmParser -lLLVMARMCodeGen -lLLVMARMDesc -lLLVMARMUtils -lLLVMARMInfo -lLLVMAArch64Disassembler \ -lLLVMAArch64AsmParser -lLLVMAArch64CodeGen -lLLVMAArch64Desc -lLLVMAArch64Utils -lLLVMAArch64Info -lLLVMOrcDebugging -lLLVMOrcJIT \ -lLLVMWindowsDriver -lLLVMMCJIT -lLLVMJITLink -lLLVMInterpreter -lLLVMExecutionEngine -lLLVMRuntimeDyld -lLLVMOrcTargetProcess -lLLVMOrcShared \ -lLLVMDWP -lLLVMDebugInfoLogicalView -lLLVMDebugInfoGSYM -lLLVMOption -lLLVMObjectYAML -lLLVMObjCopy -lLLVMMCA \ -lLLVMMCDisassembler -lLLVMLTO -lLLVMPasses -lLLVMHipStdPar -lLLVMCFGuard -lLLVMCoroutines -lLLVMipo \ --lLLVMVectorize -lLLVMLinker -lLLVMInstrumentation -lLLVMFrontendOpenMP -lLLVMFrontendOffloading -lLLVMFrontendOpenACC -lLLVMFrontendHLSL -lLLVMFrontendDriver -lLLVMExtensions \ --lLLVMDWARFLinkerParallel -lLLVMDWARFLinkerClassic -lLLVMDWARFLinker -lLLVMCodeGenData -lLLVMGlobalISel -lLLVMMIRParser -lLLVMAsmPrinter -lLLVMSelectionDAG \ --lLLVMCodeGen -lLLVMTarget -lLLVMObjCARCOpts -lLLVMCodeGenTypes -lLLVMIRPrinter -lLLVMInterfaceStub -lLLVMFileCheck -lLLVMFuzzMutate \ +-lLLVMVectorize -lLLVMSandboxIR -lLLVMLinker -lLLVMInstrumentation -lLLVMFrontendOpenMP -lLLVMFrontendOffloading -lLLVMFrontendOpenACC -lLLVMFrontendHLSL -lLLVMFrontendDriver -lLLVMFrontendAtomic -lLLVMExtensions \ +-lLLVMDWARFLinkerParallel -lLLVMDWARFLinkerClassic -lLLVMDWARFLinker -lLLVMGlobalISel -lLLVMMIRParser -lLLVMAsmPrinter -lLLVMSelectionDAG \ +-lLLVMCodeGen -lLLVMTarget -lLLVMObjCARCOpts -lLLVMCodeGenTypes -lLLVMCGData -lLLVMIRPrinter -lLLVMInterfaceStub -lLLVMFileCheck -lLLVMFuzzMutate \ -lLLVMScalarOpts -lLLVMInstCombine -lLLVMAggressiveInstCombine -lLLVMTransformUtils -lLLVMBitWriter -lLLVMAnalysis \ --lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC -lLLVMDebugInfoCodeView \ +-lLLVMProfileData -lLLVMSymbolize -lLLVMDebugInfoBTF -lLLVMDebugInfoPDB -lLLVMDebugInfoMSF -lLLVMDebugInfoCodeView -lLLVMDebugInfoDWARF -lLLVMObject -lLLVMTextAPI -lLLVMMCParser -lLLVMIRReader -lLLVMAsmParser -lLLVMMC \ -lLLVMBitReader -lLLVMFuzzerCLI -lLLVMCore -lLLVMRemarks -lLLVMBitstreamReader -lLLVMBinaryFormat -lLLVMTargetParser -lLLVMTableGen -lLLVMSupport \ -lLLVMDemangle" shared_libs="-lLLVM-$version" diff --git a/.github/actions/6-integration-test/action.yml b/.github/actions/6-integration-test/action.yml index 4ab0bd226fe..d8099850aa3 100644 --- a/.github/actions/6-integration-test/action.yml +++ b/.github/actions/6-integration-test/action.yml @@ -45,8 +45,9 @@ runs: run: | set -eux cd .. - if type -P apk &>/dev/null; then - exit 0 # Alpine: disabled dynamic-compile support + if ! ls installed/lib/*ldc-jit-rt* &>/dev/null; then + echo "ldc-jit-rt library not found, skipping test" + exit 0 fi if [[ '${{ runner.os }}' == Windows ]]; then # add ldc-jit.dll dir to PATH diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5b7838e875e..c7c4c7f34fc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ concurrency: cancel-in-progress: true env: - LLVM_VERSION: 19.1.7 + LLVM_VERSION: 20.1.5 jobs: build-native: @@ -85,8 +85,8 @@ jobs: os: macos-14 arch: arm64 extra_cmake_flags: >- - -DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm@19/bin/clang - -DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm@19/bin/clang++ + -DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm@20/bin/clang + -DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm@20/bin/clang++ -DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto -L-exported_symbol '-L__*' -L-w" -DEXTRA_CXXFLAGS=-flto=full with_pgo: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 343a3e45fac..6ce453f0592 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,15 @@ #### Big news - Frontend, druntime and Phobos are at version [2.111.0+](https://dlang.org/changelog/2.111.0.html). (#4877, #4910, #4918) +- Support for [LLVM 20](https://releases.llvm.org/20.1.0/docs/ReleaseNotes.html). The prebuilt packages use v20.1.5. (#4843, #4911, #4935) + - The dynamic-compile (JIT) feature has regressed with LLVM 20. Use LLVM 18 or 19 for that feature. - Keep frame pointers by default with `-O` for some targets, notably AArch64 (except Windows), x86_64 (except Windows and glibc Linux), Windows x86, and Android. This fixes druntime backtraces with optimized code (incl. prebuilt druntime/Phobos). (#4889) - The prebuilt (non-musl) Linux packages are now generated on Ubuntu 22.04; the minimum glibc version has accordingly been raised from v2.31 to v2.35. (#4893) - ldc2.conf: Arrays can now be appended to via the `~=` operator. (#4848, #4856) - New `--installWithSuffix` command-line option for the `ldc-build-runtime` tool, to simplify copying the libraries to an existing LDC installation. (#4870) #### Platform support +- Supports LLVM 15 - 20. #### Bug fixes diff --git a/CMakeLists.txt b/CMakeLists.txt index 934700f58e2..0e1baaf392c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -457,6 +457,9 @@ option(LDC_DYNAMIC_COMPILE_USE_CUSTOM_PASSES "Use custom LDC passes in jit" ON) if(LDC_DYNAMIC_COMPILE STREQUAL "AUTO") if(LDC_LLVM_VER LESS 1800) set(LDC_DYNAMIC_COMPILE OFF) + # FIXME: dynamic-compile regressions with LLVM 20 + elseif(LDC_LLVM_VER LESS 2000) + set(LDC_DYNAMIC_COMPILE ON) else() set(LDC_DYNAMIC_COMPILE ON) endif()