diff --git a/debian/README.source b/debian/README.source index a5b685cc..fbd46fa2 100644 --- a/debian/README.source +++ b/debian/README.source @@ -4,6 +4,13 @@ as possible from upstream. However, because of the objectives of Debian, besides paths, some changes are made. +The Debian packaging is also used by apt.llvm.org. + +From 12.0.1-10 & 13.0.0-9, the build system use the runtimes build system. +This is now the upstream preferred way to build llvm. +It means that some projects like libc++ or compiler-rt are built once clang +is built. + = File names = * To make sure that most of the llvm-toolchain packages are co-installable, diff --git a/debian/changelog b/debian/changelog index 44727db4..b5a4bc0c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -llvm-toolchain-snapshot (1:14~++20211022081626+13755436bb3d-1~exp2) UNRELEASED; urgency=medium +llvm-toolchain-snapshot (1:14~++20211113102219+b5ff187b7b51-1~exp1) experimental; urgency=medium * Remove the triple patch. it is causing the library search path to fail. Add a test in debian/qualify-clang.sh to verify we don't regress @@ -16,18 +16,43 @@ llvm-toolchain-snapshot (1:14~++20211022081626+13755436bb3d-1~exp2) UNRELEASED; as llvm-spir is too old on these version. See bug #52200 * Adjust the sphinx build as the makefile have been removed - * Install llvm-tli-checker in llvm-X.Y - * Add new symbols to libomp + * If lua is available on the system at built time, a lua lldb binding + was created. It was leading to some build failures depending + on the package installed on the build system. + Force the deactivation of the lua build when lldb is built. + * libomp: add new symbols - GOMP_5.0.1 - GOMP_alloc - GOMP_free - __kmpc_aligned_alloc + - __kmpc_atomic_bool_1_cas + - __kmpc_atomic_bool_1_cas_cpt + - __kmpc_atomic_bool_2_cas + - __kmpc_atomic_bool_2_cas_cpt + - __kmpc_atomic_bool_4_cas + - __kmpc_atomic_bool_4_cas_cpt + - __kmpc_atomic_bool_8_cas + - __kmpc_atomic_bool_8_cas_cpt - __kmpc_atomic_float10_max + - __kmpc_atomic_float10_max_cpt - __kmpc_atomic_float10_min + - __kmpc_atomic_float10_min_cpt + - __kmpc_atomic_val_1_cas + - __kmpc_atomic_val_1_cas_cpt + - __kmpc_atomic_val_2_cas + - __kmpc_atomic_val_2_cas_cpt + - __kmpc_atomic_val_4_cas + - __kmpc_atomic_val_4_cas_cpt + - __kmpc_atomic_val_8_cas + - __kmpc_atomic_val_8_cas_cpt - omp_aligned_alloc - omp_aligned_calloc + * Install llvm-tli-checker in llvm-X.Y - -- Sylvestre Ledru Tue, 09 Nov 2021 11:36:13 +0100 + [ Erik Maciejewski ] + * Merge migration to 2stage runtimes build 13 => 14 + + -- Sylvestre Ledru Sat, 13 Nov 2021 10:26:41 +0100 llvm-toolchain-snapshot (1:14~++20210926041028+6063e6b499c7-1~exp1) experimental; urgency=medium @@ -162,6 +187,69 @@ llvm-toolchain-snapshot (1:14~++20210715093511+afc760ef3527-1~exp2) unstable; ur -- Sylvestre Ledru Fri, 06 Aug 2021 08:40:58 +0200 +llvm-toolchain-13 (1:13.0.0-10) unstable; urgency=medium + + * Add back -DLLVM_VERSION_SUFFIX=. Useless for 13 but necessary for snapshot + Otherwise, it adds "git" to the libs + + -- Sylvestre Ledru Thu, 11 Nov 2021 22:45:25 +0100 + +llvm-toolchain-13 (1:13.0.0-9) unstable; urgency=medium + + * Upload to unstable (all green on exp) + * Fix an autopkgtest test (Closes: #997902) + + -- Sylvestre Ledru Mon, 08 Nov 2021 14:09:25 +0100 + +llvm-toolchain-13 (1:13.0.0-9~exp2) experimental; urgency=medium + + * patch compiler-rt build to add option to disable scudo standalone allocator + as it is not always supported by all debian baseline arch profiles + * add COMPILER_RT_BUILD_SCUDO_STANDALONE=OFF to armel build in debian/rules + since the baseline armv5t arch profile is not supported + + -- Erik Maciejewski Fri, 05 Nov 2021 16:38:43 -0700 + +llvm-toolchain-13 (1:13.0.0-9~exp1) experimental; urgency=medium + + * Merge migration to 2stage runtimes build 12 => 13 + * Adjust openmp runtime quilt patches from branch 12 for changes in upstream + (llvmorg-13.0.0) sources + + -- Erik Maciejewski Wed, 03 Nov 2021 20:03:56 -0700 + +llvm-toolchain-13 (1:13.0.0-8) unstable; urgency=medium + + * Disable lldb on mipsel and mips64el as it isn't supported + See https://reviews.llvm.org/D102872 + (Closes: #997011) + + -- Sylvestre Ledru Sat, 23 Oct 2021 10:33:56 +0200 + +llvm-toolchain-13 (1:13.0.0-7) unstable; urgency=medium + + * Remove omp-device-info from LLVMExports.cmake (Closes: #996551) + For real this time + * Fix the link issue (hopefully on all archs) (Closes: #995827) + customs LDFLAGS were not passed to the stage2 + * Trim trailing whitespace. + * Update watch file format version to 4. + * Update to compat 11. + oldstable has 12 + bionic has 11 + + -- Sylvestre Ledru Wed, 20 Oct 2021 07:36:28 +0200 + +llvm-toolchain-13 (1:13.0.0-6) unstable; urgency=medium + + * Remove omp-device-info from LLVMExports.cmake (Closes: #996551) + * Fix a atomic issue. Thanks to YunQiang Su for the patch + Partial fix for #995827 + * Bring back the llvm manpages (Closes: #995684) + Were generated at the wrong place + + -- Sylvestre Ledru Fri, 15 Oct 2021 10:45:30 +0200 + llvm-toolchain-13 (1:13.0.0-5) unstable; urgency=medium * Restrict the dependency on libunwind-13-dev from Package: libc++-13-dev @@ -359,8 +447,129 @@ llvm-toolchain-snapshot (1:13~++20210129063721+010b176cdefb-1~exp1) experimental -- Sylvestre Ledru Sat, 30 Jan 2021 17:31:15 +0100 -llvm-toolchain-12 (1:12.0.1-10) UNRELEASED; urgency=medium +llvm-toolchain-12 (1:12.0.1-16) unstable; urgency=medium + [ Erik Maciejewski ] + * use make variables populated by /usr/share/dpkg/buildflags.mk and remove + _EXTRA suffix from STAGE_1_ and STAGE_2_ flag vars to improve clarity and + readability for the multi-stage setup in debian/rules + * remove some redundant cmake options (options with the same value as their + default) from, and move PYTHON_EXECUTABLE cmake option to, the cmake + configure command in debian/rules + * re-disable fixfilepath in dpkg-buildflags in favor of using the more llvm + aware implementation provided by the llvm-project by setting + LLVM_USE_RELATIVE_PATHS_IN_FILES=ON in both stages of the toolchain + build in debian/rules + + [ Sylvestre Ledru ] + * autopkgtest/integration-test-suite-test: restrict to arm64/amd64 for now + + -- Sylvestre Ledru Thu, 28 Oct 2021 16:45:49 +0200 + +llvm-toolchain-12 (1:12.0.1-15) unstable; urgency=medium + + * Disable lldb on mipsel and mips64el as it isn't supported + See https://reviews.llvm.org/D102872 + (Closes: #997011) + + [ Erik Maciejewski ] + * disable compiler-rt builtins for unsupported arch s390x in debian/rules + * set arm toolchain arch profiles explicitly to debian baselines in + debian/rules as the target host triples alone are ambiguous and compiler + defaults and debian baselines may not align + * add arch specific config for powerpc to debian/rules and set host target + triple and compiler-rt config to force correct arch profile for builtins + * set LIBCXX_USE_COMPILER_RT to OFF in debian/rules to disable builtins when + libunwind is not enabled since the unwind implementation with gnu builtins + will then be required + + -- Sylvestre Ledru Sat, 23 Oct 2021 10:33:56 +0200 + +llvm-toolchain-12 (1:12.0.1-14) unstable; urgency=medium + + * fix build flag inconsistencies (potentially causing build failures) by + utilizing dpkg-buildflags for defaults where appropriate and making sure all + flags intended for a given stage are also applied to the stage's builtins + and runtimes builds + * re-enable fixfilepath for use with dpkg-buildflags in debian/rules as it has + been supported since clang-10 + * establish a consistent STAGE_[stage]_ prefix naming scheme for stage + variables and replace STAGE1_AND_STAGE2_ prefix with STAGE_ALL_ prefix for + better future-proofing in debian/rules + * modify stage dir var names to use new prefix scheme in debian/rules + * add explicit s390x build options to debian/rules, set + LLVM_HOST_TRIPLE=s390x-linux-gnu and COMPILER_RT_DEFAULT_TARGET_ONLY=ON + so that builtins are only built for the explicit host arch (Closes: #996802) + + -- Erik Maciejewski Fri, 22 Oct 2021 03:12:48 -0700 + +llvm-toolchain-12 (1:12.0.1-13) unstable; urgency=medium + + * update rules to incorporate relevant arch specific configs from snapshot + * patch llvm runtimes cmake build to add a check and only set up and build + compiler-rt builtins if they have not been disabled in a runtimes build + * patch compiler-rt builtins cmake build to fix default arch detection for + armhf by adding the same target triple handling used for compiler-rt libs + * remove legacy var for use when libcxx was a standalone build + + -- Erik Maciejewski Wed, 20 Oct 2021 09:04:42 -0700 + +llvm-toolchain-12 (1:12.0.1-12) unstable; urgency=medium + + * re-disable building builtins on armel as they still fail (Closes: #996828) + * add patch to libcxxabi cmake build for adding builtins to lib flags fixing + an issue where builtins were not being linked into libcxxabi when + LIBCXXABI_USE_COMPILER_RT=ON (Closes: #996796) + + -- Erik Maciejewski Tue, 19 Oct 2021 01:28:50 -0700 + +llvm-toolchain-12 (1:12.0.1-11) unstable; urgency=medium + + * add missing LIBUNWIND_USE_COMPILER_RT to CLANG_BOOTSTRAP_PASSTHROUGH to link + correct compiler-rt lib in stage2 + * consolidate two conditionals for libatomic that were essentially the same, + but the one removed could conflict with BOOTSTRAP_SHARED_LINK_FLAGS + elsewhere in the rules file + * attempt to fix arm builtins by adding COMPILER_RT_DEFAULT_TARGET_ONLY=ON to + armel and armhf toolchain build options to prevent related arches that might + not be supported on the build host from being included in the build (like + armv6m soft-float on the armhf build host) + * reorganize flags and cmake options around stages for the toolchain build + * set baseline arch to armv5t, remove older 3.8 workaround for armel build + * update to debian host triple for the armhf build + + [ Jordan Justen ] + * d/rules: Add amdgcn-mesa-mesa3d to libclc build. + Closes: #993904, #995069 + + [ Sylvestre Ledru ] + * Bring back the llvm manpages (Closes: #995684) + Were generated at the wrong place + + -- Erik Maciejewski Sat, 16 Oct 2021 09:07:25 -0700 + +llvm-toolchain-12 (1:12.0.1-10) unstable; urgency=medium + + * evolve llvm build configuration in rules to leverage the two stage build + with runtimes support whereby the resulting stage2 (final) compiler is used + to build the stage2 (final) runtimes as part of a single monolithic build + * the stage2 runtimes build now includes compiler-rt, libcxx and libcxxabi as + well as libunwind and openmp where supported. Additionally, legacy + corresponding standalone build targets are removed from the rules file + * patch openmp build to include required runtimes as dependencies to build + targets so they are built first when included as part of a runtimes build + since openmp can depend on them + * patch libclc build to set rpath for prepare_builtins build utility to find + correct stage2 libs at runtime when executed as part of a build + * patch libcxx build so that if libatomic is found, only link it if libgcc is + the rtlib + * patch compiler-rt build to suppress xray and testing warns when not enabled + * patch llvm linker detection to account for vendor being prepended to lld + version string + * remove several existing patches incorporating workarounds no longer required + by the modified build configuration + + [ Sylvestre Ledru ] * If parallel is not set in DEB_BUILD_OPTIONS, use nproc * Add source-is-missing llvm/test/* / lldb/test/* / lld/test/* to the source override @@ -369,7 +578,7 @@ llvm-toolchain-12 (1:12.0.1-10) UNRELEASED; urgency=medium [ John Paul Adrian Glaubitz ] * Disable libunwind on sparc, sparc64 and x32 - -- Sylvestre Ledru Sat, 02 Oct 2021 10:50:27 +0200 + -- Erik Maciejewski Wed, 06 Oct 2021 01:25:08 -0700 llvm-toolchain-12 (1:12.0.1-9) unstable; urgency=medium @@ -583,7 +792,7 @@ llvm-toolchain-12 (1:12.0.0~++rc4-1) unstable; urgency=medium llvm-toolchain-12 (1:12.0.0~++rc3-4) unstable; urgency=medium - * dont' fail fsanitize=thread on i386, not supported + * Don't fail fsanitize=thread on i386, not supported * Don't hard fail on z3 failures with "set -e" at the begin, if z3 support is not available we do fail and exit testsuite without checking the log * Don't force gcc-11 anymore on riscv64, gcc-10 has the fixes now diff --git a/debian/compat b/debian/compat index ec635144..b4de3947 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -9 +11 diff --git a/debian/control b/debian/control index 0001ac11..b467138f 100644 --- a/debian/control +++ b/debian/control @@ -4,8 +4,9 @@ Priority: optional Rules-Requires-Root: no Maintainer: LLVM Packaging Team Uploaders: Sylvestre Ledru , Gianfranco Costamagna -Build-Depends: debhelper (>= 9.0), cmake, ninja-build, +Build-Depends: debhelper (>= 11.0), cmake, ninja-build, chrpath, texinfo, sharutils, + libelf-dev, libffi-dev, lsb-release, patchutils, diffstat, xz-utils, python3-dev, libedit-dev, libncurses5-dev, swig, python3-six, python3-sphinx (>= 1.3.6), @@ -13,7 +14,7 @@ Build-Depends: debhelper (>= 9.0), cmake, ninja-build, libxml2-dev, libjsoncpp-dev, pkg-config, lcov, procps, help2man, zlib1g-dev, - g++-multilib [amd64 i386 kfreebsd-amd64 mips mips64 mips64el mipsel powerpc ppc64 s390 s390x sparc sparc64 x32], + g++-multilib [amd64 i386 kfreebsd-amd64 mips64 mips64el mipsel powerpc ppc64 s390 s390x sparc sparc64 x32], libjs-mathjax, python3-recommonmark, doxygen, gfortran, ocaml-nox [amd64 arm64 armhf ppc64el riscv64 s390x], @@ -453,7 +454,7 @@ Description: Modular compiler and toolchain technologies, examples # ------------- lld ------------- Package: lld-14 -Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 s390x sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32 riscv64 +Architecture: amd64 arm64 armel armhf i386 mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 s390x sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32 riscv64 # ia64 hurd powerpc have been removed Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm14 (= ${binary:Version}) Pre-Depends: ${misc:Pre-Depends} @@ -463,7 +464,7 @@ Description: LLVM-based linker Project. Package: liblld-14 -Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 s390x sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32 riscv64 +Architecture: amd64 arm64 armel armhf i386 mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 s390x sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32 riscv64 # ia64 hurd powerpc have been removed Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm14 (= ${binary:Version}) Pre-Depends: ${misc:Pre-Depends} @@ -477,7 +478,7 @@ Description: LLVM-based linker, library Package: liblld-14-dev Section: libdevel -Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 s390x sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32 riscv64 +Architecture: amd64 arm64 armel armhf i386 mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 s390x sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32 riscv64 # ia64 hurd powerpc have been removed Depends: ${shlibs:Depends}, ${misc:Depends}, lld-14 (= ${binary:Version}), liblld-14 (= ${binary:Version}) @@ -493,8 +494,8 @@ Description: LLVM-based linker, header files # ------------- lldb ------------- Package: lldb-14 -Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 s390x sparc hppa m68k sh4 x32 -# ia64 hurd powerpc powerpcspe ppc64 alpha riscv64 s390x sparc64 have been removed +Architecture: amd64 arm64 armel armhf i386 ppc64el kfreebsd-amd64 kfreebsd-i386 s390 s390x sparc hppa m68k sh4 x32 +# ia64 hurd powerpc powerpcspe ppc64 alpha riscv64 s390x sparc64 mipsel mips64el have been removed Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm14 (= ${binary:Version}), llvm-14-dev, python3-lldb-14 Pre-Depends: ${misc:Pre-Depends} @@ -504,8 +505,8 @@ Description: Next generation, high-performance debugger Project, such as the Clang expression parser and LLVM disassembler. Package: liblldb-14 -Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 s390x sparc hppa m68k sh4 x32 -# ia64 hurd powerpc powerpcspe ppc64 alpha riscv64 s390x sparc64 have been removed +Architecture: amd64 arm64 armel armhf i386 ppc64el kfreebsd-amd64 kfreebsd-i386 s390 s390x sparc hppa m68k sh4 x32 +# ia64 hurd powerpc powerpcspe ppc64 alpha riscv64 s390x sparc64 mipsel mips64el have been removed Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm14 (= ${binary:Version}) Pre-Depends: ${misc:Pre-Depends} Section: libs @@ -518,8 +519,8 @@ Description: Next generation, high-performance debugger, library Package: python3-lldb-14 Section: python -Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 s390x sparc hppa m68k sh4 x32 -# ia64 hurd powerpc powerpcspe ppc64 alpha riscv64 s390x sparc64 have been removed +Architecture: amd64 arm64 armel armhf i386 ppc64el kfreebsd-amd64 kfreebsd-i386 s390 s390x sparc hppa m68k sh4 x32 +# ia64 hurd powerpc powerpcspe ppc64 alpha riscv64 s390x sparc64 mipsel mips64el have been removed Depends: ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends}, liblldb-14 (= ${binary:Version}), python3-six Conflicts: python3-lldb-x.y Replaces: python3-lldb-x.y @@ -534,8 +535,8 @@ Description: Next generation, high-performance debugger, python3 lib Package: liblldb-14-dev Section: libdevel -Architecture: amd64 arm64 armel armhf i386 mips mipsel mips64el ppc64el kfreebsd-amd64 kfreebsd-i386 s390 s390x sparc hppa m68k sh4 x32 -# ia64 hurd powerpc powerpcspe ppc64 alpha riscv64 s390x sparc64 have been removed +Architecture: amd64 arm64 armel armhf i386 ppc64el kfreebsd-amd64 kfreebsd-i386 s390 s390x sparc hppa m68k sh4 x32 +# ia64 hurd powerpc powerpcspe ppc64 alpha riscv64 s390x sparc64 mipsel mips64el have been removed Depends: ${shlibs:Depends}, ${misc:Depends}, lldb-14 (= ${binary:Version}) Pre-Depends: ${misc:Pre-Depends} Description: Next generation, high-performance debugger, header files diff --git a/debian/libomp5-X.Y.symbols.in b/debian/libomp5-X.Y.symbols.in index 469148d6..09b22a3f 100644 --- a/debian/libomp5-X.Y.symbols.in +++ b/debian/libomp5-X.Y.symbols.in @@ -4,10 +4,10 @@ libomp.so.5 libomp5-@LLVM_VERSION@ #MINVER# GOMP_3.0@GOMP_3.0 0.20131209 GOMP_4.0@GOMP_4.0 0.20131209 GOMP_4.5@GOMP_4.5 7 - GOMP_5.0.1@GOMP_5.0.1 1:14~++20211111115529+b72727a75a64-1~exp1~20211111120111.101 + GOMP_5.0.1@GOMP_5.0.1 14 GOMP_5.0@GOMP_5.0 11 - GOMP_alloc@GOMP_5.0.1 1:14~++20211111115529+b72727a75a64-1~exp1~20211111120111.101 - GOMP_alloc@VERSION 1:14~++20211111115529+b72727a75a64-1~exp1~20211111120111.101 + GOMP_alloc@GOMP_5.0.1 14 + GOMP_alloc@VERSION 14 GOMP_atomic_end@GOMP_1.0 0.20131209 GOMP_atomic_end@VERSION 0.20130412 GOMP_atomic_start@GOMP_1.0 0.20131209 @@ -36,8 +36,8 @@ libomp.so.5 libomp5-@LLVM_VERSION@ #MINVER# GOMP_doacross_ull_wait@VERSION 7 GOMP_doacross_wait@GOMP_4.5 7 GOMP_doacross_wait@VERSION 7 - GOMP_free@GOMP_5.0.1 1:14~++20211111115529+b72727a75a64-1~exp1~20211111120111.101 - GOMP_free@VERSION 1:14~++20211111115529+b72727a75a64-1~exp1~20211111120111.101 + GOMP_free@GOMP_5.0.1 14 + GOMP_free@VERSION 14 GOMP_loop_doacross_dynamic_start@GOMP_4.5 7 GOMP_loop_doacross_dynamic_start@VERSION 7 GOMP_loop_doacross_guided_start@GOMP_4.5 7 @@ -292,7 +292,7 @@ libomp.so.5 libomp5-@LLVM_VERSION@ #MINVER# __kmp_thread_pool@VERSION 0.20130412 __kmp_wait_4@VERSION 9 __kmp_wait_64@VERSION 0.20140926 - __kmpc_aligned_alloc@VERSION 1:14~++20211111115529+b72727a75a64-1~exp1~20211111120111.101 + __kmpc_aligned_alloc@VERSION 14 __kmpc_alloc@VERSION 8 __kmpc_atomic_10@VERSION 0.20130412 __kmpc_atomic_16@VERSION 0.20130412 @@ -302,6 +302,14 @@ libomp.so.5 libomp5-@LLVM_VERSION@ #MINVER# __kmpc_atomic_32@VERSION 0.20130412 __kmpc_atomic_4@VERSION 0.20130412 __kmpc_atomic_8@VERSION 0.20130412 + __kmpc_atomic_bool_1_cas@VERSION 14 + __kmpc_atomic_bool_1_cas_cpt@VERSION 14 + __kmpc_atomic_bool_2_cas@VERSION 14 + __kmpc_atomic_bool_2_cas_cpt@VERSION 14 + __kmpc_atomic_bool_4_cas@VERSION 14 + __kmpc_atomic_bool_4_cas_cpt@VERSION 14 + __kmpc_atomic_bool_8_cas@VERSION 14 + __kmpc_atomic_bool_8_cas_cpt@VERSION 14 __kmpc_atomic_cmplx10_add@VERSION 0.20130412 (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf !riscv64)__kmpc_atomic_cmplx10_add_cpt@VERSION 0.20130412 __kmpc_atomic_cmplx10_div@VERSION 0.20130412 @@ -679,8 +687,10 @@ libomp.so.5 libomp5-@LLVM_VERSION@ #MINVER# #MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !armel !armhf)__kmpc_atomic_float10_div_fp@VERSION 0.20130412 (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf !riscv64)__kmpc_atomic_float10_div_rev@VERSION 0.20130412 #MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_div_rev_fp@VERSION 4.0 - __kmpc_atomic_float10_max@VERSION 1:14~++20211111115529+b72727a75a64-1~exp1~20211111120111.101 - __kmpc_atomic_float10_min@VERSION 1:14~++20211111115529+b72727a75a64-1~exp1~20211111120111.101 + __kmpc_atomic_float10_max@VERSION 14 + __kmpc_atomic_float10_max_cpt@VERSION 14 + __kmpc_atomic_float10_min@VERSION 14 + __kmpc_atomic_float10_min_cpt@VERSION 14 __kmpc_atomic_float10_mul@VERSION 0.20130412 (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf !riscv64)__kmpc_atomic_float10_mul_cpt@VERSION 0.20130412 #MISSING: 7# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf)__kmpc_atomic_float10_mul_cpt_fp@VERSION 4.0 @@ -782,6 +792,14 @@ libomp.so.5 libomp5-@LLVM_VERSION@ #MINVER# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf !riscv64)__kmpc_atomic_float8_swp@VERSION 0.20130412 (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf !riscv64)__kmpc_atomic_float8_wr@VERSION 0.20130412 (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !arm64 !armel !armhf !riscv64)__kmpc_atomic_start@VERSION 0.20130412 + __kmpc_atomic_val_1_cas@VERSION 14 + __kmpc_atomic_val_1_cas_cpt@VERSION 14 + __kmpc_atomic_val_2_cas@VERSION 14 + __kmpc_atomic_val_2_cas_cpt@VERSION 14 + __kmpc_atomic_val_4_cas@VERSION 14 + __kmpc_atomic_val_4_cas_cpt@VERSION 14 + __kmpc_atomic_val_8_cas@VERSION 14 + __kmpc_atomic_val_8_cas_cpt@VERSION 14 __kmpc_barrier@VERSION 0.20130412 __kmpc_barrier_master@VERSION 0.20130412 __kmpc_barrier_master_nowait@VERSION 0.20130412 @@ -997,9 +1015,9 @@ libomp.so.5 libomp5-@LLVM_VERSION@ #MINVER# kmpc_set_stacksize@VERSION 0.20130412 kmpc_set_stacksize_s@VERSION 0.20130412 kmpc_unset_affinity_mask_proc@VERSION 0.20130412 -#MISSING: 1:14~++20211111115529+b72727a75a64-1~exp1~20211111120111.101# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf)libomp_start_tool@VERSION 1:14~++20210924100737+f3f25ffc04c0 - omp_aligned_alloc@VERSION 1:14~++20211111115529+b72727a75a64-1~exp1~20211111120111.101 - omp_aligned_calloc@VERSION 1:14~++20211111115529+b72727a75a64-1~exp1~20211111120111.101 +#MISSING: 14# (arch=!mips !mipsel !ppc64 !ppc64el !mips64 !mips64el !armel !armhf)libomp_start_tool@VERSION 1:14~++20210924100737+f3f25ffc04c0 + omp_aligned_alloc@VERSION 14 + omp_aligned_calloc@VERSION 14 omp_alloc@VERSION 8 omp_calloc@VERSION 12 omp_capture_affinity@OMP_5.0 13 diff --git a/debian/llvm-X.Y.manpages.in b/debian/llvm-X.Y.manpages.in index 35702d06..e2483708 100644 --- a/debian/llvm-X.Y.manpages.in +++ b/debian/llvm-X.Y.manpages.in @@ -1,4 +1,4 @@ -docs/_build/man/* +llvm/docs/_build/man/* debian/man/llvm-dwarfdump-@LLVM_VERSION@.1 debian/man/llvm-mc-@LLVM_VERSION@.1 debian/man/llvm-objdump-@LLVM_VERSION@.1 diff --git a/debian/patches/compilerrt-build-scudo-standalone-option.diff b/debian/patches/compilerrt-build-scudo-standalone-option.diff new file mode 100644 index 00000000..8f9059ed --- /dev/null +++ b/debian/patches/compilerrt-build-scudo-standalone-option.diff @@ -0,0 +1,19 @@ +add option to disable compiler-rt scudo standalone allocator as it is +not always supported by all arch profiles such as arm5vt of ARM32 arch +Index: llvm-toolchain-13_13.0.0/compiler-rt/CMakeLists.txt +=================================================================== +--- llvm-toolchain-13_13.0.0.orig/compiler-rt/CMakeLists.txt ++++ llvm-toolchain-13_13.0.0/compiler-rt/CMakeLists.txt +@@ -250,6 +250,12 @@ option(COMPILER_RT_USE_BUILTINS_LIBRARY + + include(config-ix) + ++option(COMPILER_RT_BUILD_SCUDO_STANDALONE ++ "override whether or not to build scudo standalone" ON) ++if(NOT COMPILER_RT_BUILD_SCUDO_STANDALONE) ++ set(COMPILER_RT_HAS_SCUDO_STANDALONE FALSE) ++endif() ++ + #================================ + # Setup Compiler Flags + #================================ diff --git a/debian/patches/compilerrt-builtins-arch-fix-armhf.diff b/debian/patches/compilerrt-builtins-arch-fix-armhf.diff new file mode 100644 index 00000000..d762b29c --- /dev/null +++ b/debian/patches/compilerrt-builtins-arch-fix-armhf.diff @@ -0,0 +1,18 @@ +fix builtins armhf default arch detection by adding the same armhf triple +handling use for compiler-rt +Index: llvm-toolchain-12_12.0.1/compiler-rt/lib/builtins/CMakeLists.txt +=================================================================== +--- llvm-toolchain-12_12.0.1.orig/compiler-rt/lib/builtins/CMakeLists.txt ++++ llvm-toolchain-12_12.0.1/compiler-rt/lib/builtins/CMakeLists.txt +@@ -16,6 +16,11 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURR + + load_llvm_config() + construct_compiler_rt_default_triple() ++ if ("${COMPILER_RT_DEFAULT_TARGET_TRIPLE}" MATCHES ".*hf$") ++ if (${COMPILER_RT_DEFAULT_TARGET_ARCH} MATCHES "^arm") ++ set(COMPILER_RT_DEFAULT_TARGET_ARCH "armhf") ++ endif() ++ endif() + + if(APPLE) + include(CompilerRTDarwinUtils) diff --git a/debian/patches/compilerrt-fix-warn-xray-testing.diff b/debian/patches/compilerrt-fix-warn-xray-testing.diff new file mode 100644 index 00000000..38babc96 --- /dev/null +++ b/debian/patches/compilerrt-fix-warn-xray-testing.diff @@ -0,0 +1,33 @@ +suppress warnings for xray and testing when not enabled +Index: llvm-toolchain-12_12.0.1/compiler-rt/cmake/Modules/CompilerRTUtils.cmake +=================================================================== +--- llvm-toolchain-12_12.0.1.orig/compiler-rt/cmake/Modules/CompilerRTUtils.cmake ++++ llvm-toolchain-12_12.0.1/compiler-rt/cmake/Modules/CompilerRTUtils.cmake +@@ -242,15 +242,15 @@ macro(load_llvm_config) + + # Detect if we have the LLVMXRay and TestingSupport library installed and + # available from llvm-config. ++ set(COMPILER_RT_HAS_LLVMXRAY FALSE) + execute_process( + COMMAND ${LLVM_CONFIG_PATH} "--ldflags" "--libs" "xray" + RESULT_VARIABLE HAD_ERROR + OUTPUT_VARIABLE CONFIG_OUTPUT + ERROR_QUIET) +- if (HAD_ERROR) ++ if (HAD_ERROR AND COMPILER_RT_BUILD_XRAY) + message(WARNING "llvm-config finding xray failed with status ${HAD_ERROR}") +- set(COMPILER_RT_HAS_LLVMXRAY FALSE) +- else() ++ elseif(COMPILER_RT_BUILD_XRAY) + string(REGEX REPLACE "[ \t]*[\r\n]+[ \t]*" ";" CONFIG_OUTPUT ${CONFIG_OUTPUT}) + list(GET CONFIG_OUTPUT 0 LDFLAGS) + list(GET CONFIG_OUTPUT 1 LIBLIST) +@@ -267,7 +267,7 @@ macro(load_llvm_config) + RESULT_VARIABLE HAD_ERROR + OUTPUT_VARIABLE CONFIG_OUTPUT + ERROR_QUIET) +- if (HAD_ERROR) ++ if (HAD_ERROR AND COMPILER_RT_INCLUDE_TESTS) + message(WARNING "llvm-config finding testingsupport failed with status ${HAD_ERROR}") + elseif(COMPILER_RT_INCLUDE_TESTS) + string(REGEX REPLACE "[ \t]*[\r\n]+[ \t]*" ";" CONFIG_OUTPUT ${CONFIG_OUTPUT}) diff --git a/debian/patches/fix-llvm-config-obj-src-root.patch b/debian/patches/fix-llvm-config-obj-src-root.patch deleted file mode 100644 index 2981e9b7..00000000 --- a/debian/patches/fix-llvm-config-obj-src-root.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- - tools/llvm-config/llvm-config.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -Index: llvm-toolchain-snapshot_11~++20200326111000+4673699a470/llvm/tools/llvm-config/llvm-config.cpp -=================================================================== ---- llvm-toolchain-snapshot_11~++20200326111000+4673699a470.orig/llvm/tools/llvm-config/llvm-config.cpp -+++ llvm-toolchain-snapshot_11~++20200326111000+4673699a470/llvm/tools/llvm-config/llvm-config.cpp -@@ -561,9 +561,9 @@ int main(int argc, char **argv) { - } else if (Arg == "--shared-mode") { - PrintSharedMode = true; - } else if (Arg == "--obj-root") { -- OS << ActivePrefix << '\n'; -+ OS << ActivePrefix << "/build/" << '\n'; - } else if (Arg == "--src-root") { -- OS << LLVM_SRC_ROOT << '\n'; -+ OS << ActivePrefix << "/build/" << '\n'; - } else if (Arg == "--ignore-libllvm") { - LinkDyLib = false; - LinkMode = BuiltSharedLibs ? LinkModeShared : LinkModeAuto; diff --git a/debian/patches/libclc-fix-prepare_builtins-rpath.diff b/debian/patches/libclc-fix-prepare_builtins-rpath.diff new file mode 100644 index 00000000..c1f87571 --- /dev/null +++ b/debian/patches/libclc-fix-prepare_builtins-rpath.diff @@ -0,0 +1,16 @@ +set rpath for prepare_builtins build utility to find correct stage2 +libs at runtime when executed as part of a build +Index: llvm-toolchain-12_12.0.1/libclc/CMakeLists.txt +=================================================================== +--- llvm-toolchain-12_12.0.1.orig/libclc/CMakeLists.txt ++++ llvm-toolchain-12_12.0.1/libclc/CMakeLists.txt +@@ -139,6 +139,9 @@ target_compile_options( prepare_builtins + target_compile_definitions( prepare_builtins PRIVATE ${LLVM_VERSION_DEFINE} ) + target_link_libraries( prepare_builtins PRIVATE ${LLVM_LIBS} ) + target_link_libraries( prepare_builtins PRIVATE ${LLVM_SYSTEM_LIBS} ) ++set_target_properties( prepare_builtins ++ PROPERTIES INSTALL_RPATH "${LLVM_LIBDIR}" ++ BUILD_WITH_INSTALL_RPATH "ON") + + # Setup arch devices + set( r600--_devices cedar cypress barts cayman ) diff --git a/debian/patches/libcxx-libatomic-only-with-gcc-rtlib.diff b/debian/patches/libcxx-libatomic-only-with-gcc-rtlib.diff new file mode 100644 index 00000000..41662966 --- /dev/null +++ b/debian/patches/libcxx-libatomic-only-with-gcc-rtlib.diff @@ -0,0 +1,24 @@ +if libatomic is found only link it if libgcc is the rtlib +Index: llvm-toolchain-12_12.0.1/libcxx/CMakeLists.txt +=================================================================== +--- llvm-toolchain-12_12.0.1.orig/libcxx/CMakeLists.txt ++++ llvm-toolchain-12_12.0.1/libcxx/CMakeLists.txt +@@ -756,12 +756,14 @@ function(cxx_link_system_libraries targe + endif() + elseif (LIBCXX_HAS_GCC_LIB) + target_link_libraries(${target} PRIVATE gcc) ++ if (LIBCXX_HAS_ATOMIC_LIB) ++ target_link_libraries(${target} PRIVATE atomic) ++ endif() + elseif (LIBCXX_HAS_GCC_S_LIB) + target_link_libraries(${target} PRIVATE gcc_s) +- endif() +- +- if (LIBCXX_HAS_ATOMIC_LIB) +- target_link_libraries(${target} PRIVATE atomic) ++ if (LIBCXX_HAS_ATOMIC_LIB) ++ target_link_libraries(${target} PRIVATE atomic) ++ endif() + endif() + + if (MINGW) diff --git a/debian/patches/libcxxabi-fix-link-builtins.diff b/debian/patches/libcxxabi-fix-link-builtins.diff new file mode 100644 index 00000000..7a71c4f1 --- /dev/null +++ b/debian/patches/libcxxabi-fix-link-builtins.diff @@ -0,0 +1,16 @@ +if LIBCXXABI_USE_COMPILER_RT=ON, add builtins to libcxxabi library +flags, otherwise add libgcc following how libunwind does the same +Index: llvm-toolchain-12_12.0.1/libcxxabi/src/CMakeLists.txt +=================================================================== +--- llvm-toolchain-12_12.0.1.orig/libcxxabi/src/CMakeLists.txt ++++ llvm-toolchain-12_12.0.1/libcxxabi/src/CMakeLists.txt +@@ -104,7 +104,9 @@ if (ANDROID AND ANDROID_PLATFORM_LEVEL L + list(APPEND LIBCXXABI_LIBRARIES android_support) + endif() + +-if (NOT LIBCXXABI_USE_COMPILER_RT) ++if (LIBCXXABI_USE_COMPILER_RT) ++ add_library_flags("${LIBCXXABI_BUILTINS_LIBRARY}") ++else() + add_library_flags_if(LIBCXXABI_HAS_GCC_LIB gcc) + endif () diff --git a/debian/patches/lld-use-link-atomic-i386.diff b/debian/patches/lld-use-link-atomic-i386.diff deleted file mode 100644 index 89a2222d..00000000 --- a/debian/patches/lld-use-link-atomic-i386.diff +++ /dev/null @@ -1,32 +0,0 @@ -Index: llvm-toolchain-snapshot_14~++20210805101753+11565320fd55/lld/tools/lld/CMakeLists.txt -=================================================================== ---- llvm-toolchain-snapshot_14~++20210805101753+11565320fd55.orig/lld/tools/lld/CMakeLists.txt -+++ llvm-toolchain-snapshot_14~++20210805101753+11565320fd55/lld/tools/lld/CMakeLists.txt -@@ -1,10 +1,18 @@ -+set(LLD_ATOMIC_LIB "") -+ - set(LLVM_LINK_COMPONENTS - Support - ) - -+if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i386" OR -+ CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i686" OR -+ CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64" -+ ) -+ list(APPEND LLD_ATOMIC_LIB "atomic") -+endif() -+ - add_lld_tool(lld - lld.cpp -- - SUPPORT_PLUGINS - ) - export_executable_symbols_for_plugins(lld) -@@ -18,6 +26,7 @@ target_link_libraries(lld - lldMachO - lldMinGW - lldWasm -+ ${LLD_ATOMIC_LIB} - ) - - install(TARGETS lld diff --git a/debian/patches/llvm-fix-lld-linker-check.diff b/debian/patches/llvm-fix-lld-linker-check.diff new file mode 100644 index 00000000..bad28992 --- /dev/null +++ b/debian/patches/llvm-fix-lld-linker-check.diff @@ -0,0 +1,15 @@ +remove regex anchor in lld linker detection to account for vendor, if +specified, being prepended to lld version string +Index: llvm-toolchain-12_12.0.1/llvm/cmake/modules/AddLLVM.cmake +=================================================================== +--- llvm-toolchain-12_12.0.1.orig/llvm/cmake/modules/AddLLVM.cmake ++++ llvm-toolchain-12_12.0.1/llvm/cmake/modules/AddLLVM.cmake +@@ -196,7 +196,7 @@ if (NOT DEFINED LLVM_LINKER_DETECTED) + set(LLVM_LINKER_DETECTED YES CACHE INTERNAL "") + set(LLVM_LINKER_IS_GOLD YES CACHE INTERNAL "") + message(STATUS "Linker detection: GNU Gold") +- elseif("${stdout}" MATCHES "^LLD") ++ elseif("${stdout}" MATCHES "LLD") + set(LLVM_LINKER_DETECTED YES CACHE INTERNAL "") + set(LLVM_LINKER_IS_LLD YES CACHE INTERNAL "") + message(STATUS "Linker detection: LLD") diff --git a/debian/patches/llvm-runtimes-builtins-build-check.diff b/debian/patches/llvm-runtimes-builtins-build-check.diff new file mode 100644 index 00000000..b4f7eab9 --- /dev/null +++ b/debian/patches/llvm-runtimes-builtins-build-check.diff @@ -0,0 +1,20 @@ +add a check and only set up and build compiler-rt builtins if they have +not been disabled +Index: llvm-toolchain-12_12.0.1/llvm/runtimes/CMakeLists.txt +=================================================================== +--- llvm-toolchain-12_12.0.1.orig/llvm/runtimes/CMakeLists.txt ++++ llvm-toolchain-12_12.0.1/llvm/runtimes/CMakeLists.txt +@@ -131,7 +131,12 @@ endfunction() + # is required because the other runtimes need the builtin libraries present + # before the just-built compiler can pass the configuration tests. + get_compiler_rt_path(compiler_rt_path) +-if(compiler_rt_path) ++# check if builtins have been disabled ++set(RUNTIMES_BUILD_BUILTINS ON) ++if(DEFINED COMPILER_RT_BUILD_BUILTINS) ++ set(RUNTIMES_BUILD_BUILTINS ${COMPILER_RT_BUILD_BUILTINS}) ++endif() ++if(compiler_rt_path AND RUNTIMES_BUILD_BUILTINS) + if(NOT LLVM_BUILTIN_TARGETS) + builtin_default_target(${compiler_rt_path} + DEPENDS clang-resource-headers) diff --git a/debian/patches/openmp-fix-runtimes-build.diff b/debian/patches/openmp-fix-runtimes-build.diff new file mode 100644 index 00000000..dbfc5b9f --- /dev/null +++ b/debian/patches/openmp-fix-runtimes-build.diff @@ -0,0 +1,146 @@ +include required runtimes as dependencies to openmp targets to make sure +they are built first when included as part of a runtimes build since openmp +can depend on them +Index: llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/llvm/runtimes/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51.orig/llvm/runtimes/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/llvm/runtimes/CMakeLists.txt +@@ -236,6 +236,7 @@ function(runtime_default_target) + -DLLVM_ENABLE_PROJECTS_USED=${LLVM_ENABLE_PROJECTS_USED} + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default} + -DLLVM_BUILD_TOOLS=${LLVM_BUILD_TOOLS} ++ -DCMAKE_SYSTEM_PROCESSOR=${CMAKE_SYSTEM_PROCESSOR} + -DCMAKE_C_COMPILER_WORKS=ON + -DCMAKE_CXX_COMPILER_WORKS=ON + -DCMAKE_ASM_COMPILER_WORKS=ON +@@ -454,7 +455,7 @@ if(runtimes) + # build directory cannot find the C++ headers in certain configurations. + # I need to build a mechanism for runtime projects to provide CMake code + # that executes at LLVM configuration time to handle this case. +- add_dependencies(clang-bootstrap-deps runtimes-configure) ++ #add_dependencies(clang-bootstrap-deps runtimes-configure) + # We need to add the runtimes as a dependency because compiler-rt can be + # built as part of runtimes and we need the profile runtime for PGO + add_dependencies(clang-bootstrap-deps runtimes) +Index: llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51.orig/openmp/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/CMakeLists.txt +@@ -67,6 +67,28 @@ option(OPENMP_ENABLE_LIBOMPTARGET_PROFIL + ${ENABLE_LIBOMPTARGET}) + option(OPENMP_ENABLE_LIBOMP_PROFILING "Enable time profiling for libomp." OFF) + ++option(OPENMP_USE_LLVM_UNWINDER "Build and use the LLVM unwinder" OFF) ++ ++option(LIBOMP_ENABLE_RTTI "Enabling RTTI forces libomp to be a c++ lib" ${LLVM_ENABLE_RTTI}) ++ ++macro(add_runtimes_build_depends_if_needed target) ++ if(RUNTIMES_BUILD) ++ # required for rtti and libomp/libomptarget profiling if enabled ++ add_dependencies(${target} cxx-headers cxxabi_static cxx_static cxxabi_shared cxx_shared) ++ if(OPENMP_USE_LLVM_UNWINDER AND (NOT target STREQUAL "omp" AND NOT LIBOMP_ENABLE_RTTI)) ++ add_dependencies(${target} unwind_static unwind_shared) ++ get_target_property(target_link_flags ${target} LINK_FLAGS) ++ set(runtimes_link_flags "-lunwind") ++ if(target_link_flags) ++ set(runtimes_link_flags "${target_link_flags} -lunwind") ++ endif() ++ set_target_properties(${target} ++ PROPERTIES ++ LINK_FLAGS "${runtimes_link_flags}") ++ endif() ++ endif() ++endmacro() ++ + # Build host runtime library, after LIBOMPTARGET variables are set since they are needed + # to enable time profiling support in the OpenMP runtime. + add_subdirectory(runtime) +Index: llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/libomptarget/plugins/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51.orig/openmp/libomptarget/plugins/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/libomptarget/plugins/CMakeLists.txt +@@ -36,6 +36,8 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "${tma + add_library("omptarget.rtl.${tmachine_libname}" SHARED + ${CMAKE_CURRENT_SOURCE_DIR}/../generic-elf-64bit/src/rtl.cpp) + ++ add_runtimes_build_depends_if_needed("omptarget.rtl.${tmachine_libname}") ++ + # Install plugin under the lib destination folder. + install(TARGETS "omptarget.rtl.${tmachine_libname}" + LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}") +Index: llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/libomptarget/plugins/cuda/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51.orig/openmp/libomptarget/plugins/cuda/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/libomptarget/plugins/cuda/CMakeLists.txt +@@ -47,6 +47,8 @@ else() + set (LIBOMPTARGET_DEP_LIBRARIES ${CMAKE_DL_LIBS}) + endif() + ++add_runtimes_build_depends_if_needed(omptarget.rtl.cuda) ++ + # Install plugin under the lib destination folder. + install(TARGETS omptarget.rtl.cuda LIBRARY DESTINATION "${OPENMP_INSTALL_LIBDIR}") + +Index: llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/libomptarget/src/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51.orig/openmp/libomptarget/src/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/libomptarget/src/CMakeLists.txt +@@ -39,6 +39,8 @@ target_link_libraries(omptarget PRIVATE + ${CMAKE_DL_LIBS} + "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/exports") + ++add_runtimes_build_depends_if_needed(omptarget) ++ + # Install libomptarget under the lib destination folder. + install(TARGETS omptarget LIBRARY COMPONENT omptarget + DESTINATION "${OPENMP_INSTALL_LIBDIR}") +Index: llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/runtime/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51.orig/openmp/runtime/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/runtime/CMakeLists.txt +@@ -287,6 +287,10 @@ if(LIBOMP_STATS) + set(LIBOMP_USE_STDCPPLIB TRUE) + endif() + ++if(LIBOMP_ENABLE_RTTI) ++ set(LIBOMP_USE_STDCPPLIB TRUE) ++endif() ++ + # Shared library can be switched to a static library + set(LIBOMP_ENABLE_SHARED TRUE CACHE BOOL + "Shared library instead of static library?") +Index: llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/runtime/src/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51.orig/openmp/runtime/src/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/runtime/src/CMakeLists.txt +@@ -136,6 +136,7 @@ endif() + if(NOT ${LIBOMP_USE_STDCPPLIB}) + set(LIBOMP_LINKER_LANGUAGE C) + set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES) ++ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nostdlib++") + else() + set(LIBOMP_LINKER_LANGUAGE CXX) + endif() +@@ -186,6 +187,8 @@ else() + ) + endif() + ++add_runtimes_build_depends_if_needed(omp) ++ + # Get the library's location within the build tree for the unit tester + if(NOT WIN32) + get_target_property(LIBOMP_LIBRARY_DIR omp LIBRARY_OUTPUT_DIRECTORY) +Index: llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/tools/archer/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51.orig/openmp/tools/archer/CMakeLists.txt ++++ llvm-toolchain-snapshot_14~++20211113102219+b5ff187b7b51/openmp/tools/archer/CMakeLists.txt +@@ -14,6 +14,9 @@ if(LIBOMP_OMPT_SUPPORT) + add_library(archer SHARED ompt-tsan.cpp) + add_library(archer_static STATIC ompt-tsan.cpp) + ++ add_runtimes_build_depends_if_needed(archer) ++ add_runtimes_build_depends_if_needed(archer_static) ++ + install(TARGETS archer archer_static + LIBRARY DESTINATION ${OPENMP_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${OPENMP_INSTALL_LIBDIR}) diff --git a/debian/patches/series b/debian/patches/series index 769ecff3..a63df376 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -27,7 +27,6 @@ do-not-fail-on-unexpected-pass.diff disable-display-PASS-UNSUPPORTED-XFAIL.diff # llvm-config -fix-llvm-config-obj-src-root.patch 0001-llvm-cmake-resolve-symlinks-in-LLVMConfig.cmake.patch # Lib names @@ -125,9 +124,6 @@ risc/clang-riscv64-multiarch.diff D98574.patch D98575.patch -# Compiler-rt - workaround -workaround-bug-42994-use-linker.diff - # bug 939472 #try-to-unbreak-thinlto.diff #D67877-cmake-clang-example.patch @@ -137,10 +133,19 @@ x86-fuzzer.patch python3-shebang.patch print-lldb-path.patch libcxx-armhf-ftbfs.diff -lld-use-link-atomic-i386.diff lower-python-dep.diff scan-build-py-fix-default-bin.diff libclc-llvm-spirv.diff omp-riscv64.patch test-disable-lldb-i386.diff +unbreak-atomic-mips.diff +llvm-fix-lld-linker-check.diff +compilerrt-fix-warn-xray-testing.diff +openmp-fix-runtimes-build.diff +libclc-fix-prepare_builtins-rpath.diff +libcxx-libatomic-only-with-gcc-rtlib.diff +libcxxabi-fix-link-builtins.diff +llvm-runtimes-builtins-build-check.diff +compilerrt-builtins-arch-fix-armhf.diff +compilerrt-build-scudo-standalone-option.diff diff --git a/debian/patches/symbolizer-path.diff b/debian/patches/symbolizer-path.diff index 3eaaaf84..69caab13 100644 --- a/debian/patches/symbolizer-path.diff +++ b/debian/patches/symbolizer-path.diff @@ -1,7 +1,7 @@ -Index: llvm-toolchain-snapshot_11~++20200326111000+4673699a470/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp +Index: llvm-toolchain-12_12.0.1/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp =================================================================== ---- llvm-toolchain-snapshot_11~++20200326111000+4673699a470.orig/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp -+++ llvm-toolchain-snapshot_11~++20200326111000+4673699a470/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp +--- llvm-toolchain-12_12.0.1.orig/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp ++++ llvm-toolchain-12_12.0.1/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cpp @@ -25,6 +25,10 @@ #include "sanitizer_symbolizer_internal.h" #include "sanitizer_symbolizer_libbacktrace.h" @@ -13,7 +13,7 @@ Index: llvm-toolchain-snapshot_11~++20200326111000+4673699a470/compiler-rt/lib/s #include // for dlsym() #include -@@ -428,7 +432,7 @@ static SymbolizerTool *ChooseExternalSym +@@ -433,7 +437,7 @@ static SymbolizerTool *ChooseExternalSym return new(*allocator) AtosSymbolizer(found_path, allocator); } #endif // SANITIZER_MAC @@ -22,3 +22,15 @@ Index: llvm-toolchain-snapshot_11~++20200326111000+4673699a470/compiler-rt/lib/s VReport(2, "Using llvm-symbolizer found at: %s\n", found_path); return new(*allocator) LLVMSymbolizer(found_path, allocator); } +Index: llvm-toolchain-12_12.0.1/compiler-rt/lib/sanitizer_common/CMakeLists.txt +=================================================================== +--- llvm-toolchain-12_12.0.1.orig/compiler-rt/lib/sanitizer_common/CMakeLists.txt ++++ llvm-toolchain-12_12.0.1/compiler-rt/lib/sanitizer_common/CMakeLists.txt +@@ -195,6 +195,7 @@ set(SANITIZER_IMPL_HEADERS + ) + + include_directories(..) ++include_directories(${LLVM_INCLUDE_DIR}) + + set(SANITIZER_COMMON_DEFINITIONS + HAVE_RPC_XDR_H=${HAVE_RPC_XDR_H}) diff --git a/debian/patches/unbreak-atomic-mips.diff b/debian/patches/unbreak-atomic-mips.diff new file mode 100644 index 00000000..5a4fc884 --- /dev/null +++ b/debian/patches/unbreak-atomic-mips.diff @@ -0,0 +1,19 @@ +Index: llvm-toolchain-13-13.0.0/compiler-rt/lib/scudo/standalone/CMakeLists.txt +=================================================================== +--- llvm-toolchain-13-13.0.0.orig/compiler-rt/lib/scudo/standalone/CMakeLists.txt ++++ llvm-toolchain-13-13.0.0/compiler-rt/lib/scudo/standalone/CMakeLists.txt +@@ -137,6 +137,13 @@ append_list_if(COMPILER_RT_HAS_LIBPTHREA + + append_list_if(FUCHSIA zircon SCUDO_LINK_LIBS) + ++if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mips" OR ++ CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mips64" OR ++ CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mipsel" OR ++ CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "mips64el") ++ list(APPEND SCUDO_LINK_LIBS atomic) ++endif() ++ + if(COMPILER_RT_HAS_SCUDO_STANDALONE) + add_compiler_rt_object_libraries(RTScudoStandalone + ARCHS ${SCUDO_STANDALONE_SUPPORTED_ARCH} + diff --git a/debian/patches/workaround-bug-42994-use-linker.diff b/debian/patches/workaround-bug-42994-use-linker.diff deleted file mode 100644 index 2b12acb9..00000000 --- a/debian/patches/workaround-bug-42994-use-linker.diff +++ /dev/null @@ -1,34 +0,0 @@ -Index: llvm-toolchain-snapshot_14~++20210815095329+44d0a99a12ec/compiler-rt/lib/hwasan/CMakeLists.txt -=================================================================== ---- llvm-toolchain-snapshot_14~++20210815095329+44d0a99a12ec.orig/compiler-rt/lib/hwasan/CMakeLists.txt -+++ llvm-toolchain-snapshot_14~++20210815095329+44d0a99a12ec/compiler-rt/lib/hwasan/CMakeLists.txt -@@ -52,9 +52,9 @@ endif() - - set(HWASAN_RTL_CFLAGS ${SANITIZER_COMMON_CFLAGS}) - append_rtti_flag(OFF HWASAN_RTL_CFLAGS) --append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC HWASAN_RTL_CFLAGS) -+append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC -fuse-ld=gold HWASAN_RTL_CFLAGS) - # Prevent clang from generating libc calls. --append_list_if(COMPILER_RT_HAS_FFREESTANDING_FLAG -ffreestanding HWASAN_RTL_CFLAGS) -+append_list_if(COMPILER_RT_HAS_FFREESTANDING_FLAG -ffreestanding -fuse-ld=gold HWASAN_RTL_CFLAGS) - - # Too many existing bugs, needs cleanup. - append_list_if(COMPILER_RT_HAS_WNO_FORMAT -Wno-format HWASAN_RTL_CFLAGS) -@@ -69,7 +69,7 @@ if(ANDROID) - endif() - endif() - --set(HWASAN_DYNAMIC_CFLAGS ${HWASAN_RTL_CFLAGS}) -+set(HWASAN_DYNAMIC_CFLAGS ${HWASAN_RTL_CFLAGS} -fuse-ld=gold) - append_list_if(COMPILER_RT_HAS_FTLS_MODEL_INITIAL_EXEC - -ftls-model=initial-exec HWASAN_DYNAMIC_CFLAGS) - append_list_if(MSVC /DEBUG HWASAN_DYNAMIC_LINK_FLAGS) -@@ -163,7 +163,7 @@ function(add_hwasan_runtimes arch use_al - LIBS ${hwasan_runtime}-${arch} ${hwasan_runtime}_cxx-${arch} - EXTRA hwasan.syms.extra) - set(VERSION_SCRIPT_FLAG -- -Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/${hwasan_runtime}-dynamic-${arch}.vers) -+ -Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/${hwasan_runtime}-dynamic-${arch}.vers -fuse-ld=gold) - set_property(SOURCE - ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp - APPEND PROPERTY diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 9577d8d4..3197f7f3 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -44,6 +44,12 @@ if grep "File format not recognized" foo.log; then exit 1 fi +# Test #995684 +if test ! -f /usr/share/man/man1/llc-$VERSION.1.gz; then + echo "llvm manpage are missing (using llc as an example)" + exit 1 +fi + if test ! -f /usr/bin/scan-build-$VERSION; then echo "Install clang-tools-$VERSION" exit 1 @@ -1061,6 +1067,12 @@ if test ! -f /usr/lib/clc/amdgcn--amdhsa.bc; then exit -1; fi +if test ! -f /usr/lib/clc/polaris10-amdgcn-mesa-mesa3d.bc; then + # Make sure that #993904 and #995069 don't come back + echo "/usr/lib/clc/polaris10-amdgcn-mesa-mesa3d.bc doesn't exist" + exit 1 +fi + LLVM_CONFIG=llvm-config-$VERSION /usr/lib/llvm-$VERSION/share/libclc/check_external_calls.sh /usr/lib/clc/amdgcn--amdhsa.bc > /dev/null # libunwind @@ -1322,6 +1334,7 @@ if dpkg -l|grep -q clang-$VERSION-dbgsym; then if ! grep "main at driver.cpp" foo.log; then echo "Could not find the debug info" echo "Or the main() of clang isn't in driver.cpp anymore" + cat foo.log exit -1 fi else @@ -1471,8 +1484,9 @@ echo "Testing all other sanitizers ..." echo "int main() { return 1; }" > foo.c # fails to run on i386 with the following error: #clang: error: unsupported option '-fsanitize=efficiency-working-set' for target 'i686-pc-linux-gnu' -clang-$VERSION -fsanitize=efficiency-working-set -o foo foo.c || true -./foo &> /dev/null || true +# seems like esan was removed from clang: https://github.com/llvm/llvm-project/commit/885b790f89b6068ec4caad8eaa51aa8098327059 +#clang-$VERSION -fsanitize=efficiency-working-set -o foo foo.c || true +#./foo &> /dev/null || true cat > "$TEMPDIR/test.c" < diff --git a/debian/rules b/debian/rules index e7cc98c4..e1b799a9 100755 --- a/debian/rules +++ b/debian/rules @@ -1,7 +1,9 @@ #!/usr/bin/make -f -# polly, openmp & lldb aren't enabled for every platform -PROJECTS = clang;clang-tools-extra;libcxx;libcxxabi;compiler-rt;lld;cross-project-tests +# polly & lldb aren't enabled for every platform +PROJECTS = clang;clang-tools-extra;lld;cross-project-tests +# openmp & libunwind aren't enabled for every platform +RUNTIMES = compiler-rt;libcxx;libcxxabi TARGET_BUILD := build-llvm TARGET_BUILD_STAGE2 := $(TARGET_BUILD)/tools/clang/stage2-bins @@ -39,57 +41,71 @@ DH_VERSION := $(shell dpkg -s debhelper | grep '^Version' | awk '{print $$2}') include /usr/share/dpkg/architecture.mk -LDFLAGS_EXTRA = -CXXFLAGS_EXTRA = -CFLAGS_EXTRA = CONFIGURE_EXTRA = -CMAKE_EXTRA = -DPYTHON_EXECUTABLE=/usr/bin/python3 -CMAKE_LIBCXX_EXTRA = -BASE_PATH := $(CURDIR) -LIBCXX_EXCEPTIONS :=ON +# dpkg-buildflags support +# disable fixfilepath in favor of the llvm-project supplied flavor, disable lto +export DEB_BUILD_MAINT_OPTIONS = reproducible=-fixfilepath,-fixdebugpath optimize=-lto +# these are handled on a per stage / build basis +export DEB_CFLAGS_MAINT_STRIP = -g -O2 +export DEB_CXXFLAGS_MAINT_STRIP = -g -O2 + +include /usr/share/dpkg/buildflags.mk + +# We use a stage2 build. It means that a first clang is built using gcc, +# a second clang is built with the first +# And the various compoments are built using the second clang. +# See https://llvm.org/docs/AdvancedBuilds.html + +# collect additional flags for all stages all builds +CFLAGS_EXTRA = -Wno-unused-command-line-argument +CXXFLAGS_EXTRA = -Wno-unused-command-line-argument +LDFLAGS_EXTRA = -Wl,--build-id + +# collect all flags for stage 1 toolchain build only +STAGE_1_CFLAGS = $(CFLAGS) $(CFLAGS_EXTRA) $(CPPFLAGS) +STAGE_1_CXXFLAGS = $(CXXFLAGS) $(CXXFLAGS_EXTRA) $(CPPFLAGS) +STAGE_1_LDFLAGS = $(LDFLAGS) $(LDFLAGS_EXTRA) + +# collect all flags for stage 2 toolchain and stand-alone builds +STAGE_2_CFLAGS = $(CFLAGS) $(CFLAGS_EXTRA) $(CPPFLAGS) +STAGE_2_CXXFLAGS = $(CXXFLAGS) $(CXXFLAGS_EXTRA) $(CPPFLAGS) +STAGE_2_LDFLAGS = $(LDFLAGS) $(LDFLAGS_EXTRA) + +# collect additional cmake options for toolchain build configuration +STAGE_1_CMAKE_EXTRA = +STAGE_2_CMAKE_EXTRA = +STAGE_ALL_CMAKE_EXTRA = +# toolchain config-only var combining all stage 1 cmake options +CMAKE_EXTRA = $(STAGE_1_CMAKE_EXTRA) $(STAGE_ALL_CMAKE_EXTRA) +# toolchain config-only var prepending BOOTSTRAP_ to all stage 2 cmake options +BOOTSTRAP_CMAKE_EXTRA = $(foreach extra,$(STAGE_2_CMAKE_EXTRA) $(STAGE_ALL_CMAKE_EXTRA), $(subst -D,-DBOOTSTRAP_,$(extra))) + +BASE_PATH := $(CURDIR) +STAGE_1_BIN_DIR := $(BASE_PATH)/$(TARGET_BUILD)/bin +STAGE_1_LIB_DIR := $(BASE_PATH)/$(TARGET_BUILD)/lib +STAGE_2_BIN_DIR := $(BASE_PATH)/$(TARGET_BUILD_STAGE2)/bin +STAGE_2_LIB_DIR := $(BASE_PATH)/$(TARGET_BUILD_STAGE2)/lib + +# toggleable defaults +COMPILER_RT_USE_BUILTINS_LIBRARY := ON +LIBCXX_EXCEPTIONS := ON LIBCXX_USE_COMPILER_RT := ON -ifneq (,$(filter $(DEB_HOST_ARCH),s390x)) - LIBCXX_EXCEPTIONS := OFF -# See https://bugs.llvm.org/show_bug.cgi?id=52022 - LIBCXX_USE_COMPILER_RT := OFF -endif - -ifneq (,$(filter $(DEB_HOST_ARCH),armel x32)) -# See https://bugs.llvm.org/show_bug.cgi?id=52022 - LIBCXX_USE_COMPILER_RT := OFF -endif - -ifneq (,$(filter $(DEB_HOST_ARCH),i386 armel mips mipsel powerpc powerpcspe riscv64)) -CMAKE_EXTRA += -DLIBOMP_LIBFLAGS="-latomic" -DCMAKE_SHARED_LINKER_FLAGS="-latomic" -endif - ifneq (,$(filter $(DEB_HOST_ARCH),sparc sparc64)) -CMAKE_EXTRA += -DLLVM_PARALLEL_LINK_JOBS=4 +STAGE_1_CMAKE_EXTRA += -DLLVM_PARALLEL_LINK_JOBS=4 endif -ifneq (,$(filter $(DEB_HOST_ARCH),armel mipsel powerpc riscv64)) +ifneq (,$(filter $(DEB_HOST_ARCH),i386 armel mipsel powerpc powerpcspe riscv64)) # For some reason, in the stage2 build, when clang is used to compile -# itself. The atomic detection is failing on armel and riscv64. Forcing the inclusion everywhere. +# itself. The atomic detection is failing on armel and riscv64. Forcing the inclusion +# everywhere and in all stages LDFLAGS_EXTRA += -latomic endif -# Ensure fixfilepath feature is disabled. The fixfilepath feature -# sets a -ffile-prefix-map flag, which is only supported in clang-10. -# Disable also lto -export DEB_BUILD_MAINT_OPTIONS=reproducible=-fixfilepath optimize=-lto - -# Cxx flags for building libcxx and libcxxabi -LIBCXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) $(shell dpkg-buildflags --get CPPFLAGS) - -ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' g++-$(GCC_VERSION)) lt 8 ; echo $$?),0) -# Too old version of gcc. Force gcc 11 -# Should be triggered only on bionic -# https://reviews.llvm.org/D110338 -# Should be removed when we moved to RUNTIMES as we -# will use clang to build libc++ even stage1 (only from stage2 now) - GCC_VERSION := 11 +ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' g++-$(GCC_VERSION)) lt 4.9-20140411-1~ ; echo $$?),0) +# Too old version of gcc. Force 4.9 + GCC_VERSION := 4.9 endif Z3_FLAG = -DLLVM_ENABLE_Z3_SOLVER=OFF @@ -99,13 +115,14 @@ ifneq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes) Z3_FLAG = -DLLVM_ENABLE_Z3_SOLVER=ON endif endif +STAGE_2_CMAKE_EXTRA += $(Z3_FLAG) # Change the default CPU for s390x ZARCH=z196 ifeq ($(shell dpkg-vendor --derives-from Ubuntu && echo yes),yes) ZARCH=z13 endif -CMAKE_EXTRA += -DCLANG_SYSTEMZ_DEFAULT_ARCH=$(ZARCH) +STAGE_2_CMAKE_EXTRA += -DCLANG_SYSTEMZ_DEFAULT_ARCH=$(ZARCH) export CC=gcc-$(GCC_VERSION) export CXX=g++-$(GCC_VERSION) @@ -113,21 +130,33 @@ export CXX=g++-$(GCC_VERSION) opt_flags = -O2 -DNDEBUG -g1 ifneq (,$(findstring $(DEB_HOST_ARCH),armel)) - opt_flags += -marm - # 3.8 fails to build, disable the compiler_rt builtins - # See http://lists.llvm.org/pipermail/llvm-dev/2016-May/099761.html - CMAKE_EXTRA += -DCOMPILER_RT_BUILD_BUILTINS=OFF - # Check for ancient libstdc++ fails due to atomics usage - CMAKE_LIBCXX_EXTRA += -DLLVM_COMPILER_CHECKED=ON - # Prevent clang from getting a > v4t default - # See bug #868779 - CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=arm-linux-gnueabi + STAGE_ALL_CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=arm-linux-gnueabi + STAGE_ALL_CMAKE_EXTRA += -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON +# align arch profile with debian baseline +# https://wiki.debian.org/ArmEabiPort + CFLAGS_EXTRA += -march=armv5t + CXXFLAGS_EXTRA += -march=armv5t +# disable compiler-rt builtins (not supported for baseline armel arch: armv5t) +# See http://lists.llvm.org/pipermail/llvm-dev/2016-May/099761.html + STAGE_ALL_CMAKE_EXTRA += -DCOMPILER_RT_BUILD_BUILTINS=OFF + COMPILER_RT_USE_BUILTINS_LIBRARY := OFF + LIBCXX_USE_COMPILER_RT := OFF +# disable scudo standalone (not supported for baseline armel arch: armv5t) + STAGE_ALL_CMAKE_EXTRA += -DCOMPILER_RT_BUILD_SCUDO_STANDALONE=OFF endif - ifneq (,$(findstring $(DEB_HOST_ARCH),armhf)) -# avoid an issue with openmp on armhf - CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=armv7l-unknown-linux-gnueabihf + STAGE_ALL_CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=arm-linux-gnueabihf + STAGE_ALL_CMAKE_EXTRA += -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON +# align arch profile with debian baseline +# https://wiki.debian.org/ArmHardFloatPort#Minimum_CPU_.26_FPU + CFLAGS_EXTRA += -march=armv7-a -mfpu=vfpv3-d16 + CXXFLAGS_EXTRA += -march=armv7-a -mfpu=vfpv3-d16 +endif + +ifneq (,$(filter $(DEB_HOST_ARCH),i386)) +# Sometimes, i386 needs help with the triple + STAGE_ALL_CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=i386-linux-gnu endif ifneq (,$(filter $(DEB_HOST_ARCH),i386)) @@ -140,12 +169,27 @@ endif ifneq (,$(filter $(DEB_HOST_ARCH),mips64el)) # avoid an issue with search path on mips64el # https://bugs.llvm.org/show_bug.cgi?id=41204 - CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=mips64el-linux-gnuabi64 + STAGE_ALL_CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=mips64el-linux-gnuabi64 +endif + +ifneq (,$(filter $(DEB_HOST_ARCH),powerpc)) + STAGE_ALL_CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=powerpc-linux-gnu + STAGE_ALL_CMAKE_EXTRA += -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON +endif + +ifneq (,$(filter $(DEB_HOST_ARCH),s390x)) + STAGE_ALL_CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=s390x-linux-gnu + STAGE_ALL_CMAKE_EXTRA += -DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON + LIBCXX_EXCEPTIONS := OFF +# disable compiler-rt builtins (not supported for s390x) + STAGE_ALL_CMAKE_EXTRA += -DCOMPILER_RT_BUILD_BUILTINS=OFF + COMPILER_RT_USE_BUILTINS_LIBRARY := OFF + LIBCXX_USE_COMPILER_RT := OFF endif ifneq (,$(filter $(DEB_HOST_ARCH),x32)) - CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=x86_64-linux-gnux32 - CMAKE_EXTRA += -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-linux-gnux32 + STAGE_ALL_CMAKE_EXTRA += -DLLVM_HOST_TRIPLE=x86_64-linux-gnux32 + STAGE_ALL_CMAKE_EXTRA += -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-linux-gnux32 endif ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' g++-$(GCC_VERSION)) ge 4.8-20121128-1~ ; echo $$?),0) @@ -169,28 +213,16 @@ else endif endif -LIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl" +LIBCLC_TARGETS_TO_BUILD="amdgcn--;amdgcn--amdhsa;amdgcn-mesa-mesa3d;r600--;nvptx--;nvptx64--;nvptx--nvidiacl;nvptx64--nvidiacl" ifeq ($(LLVM_SPIRV_INSTALLED),yes) LIBCLC_TARGETS_TO_BUILD := $(LIBCLC_TARGETS_TO_BUILD)";spirv-mesa3d-;spirv64-mesa3d-" endif -# Disabled: -# Host compiler does not support '-fuse-ld=lld' -# USE_LLD_ARCHS := amd64 -# ifneq (,$(filter $(DEB_HOST_ARCH),$(USE_LLD_ARCHS))) -# CMAKE_EXTRA += -DLLVM_ENABLE_LLD=ON -# endif - BINUTILS_GOLD_ARCHS := amd64 arm64 armhf i386 ppc64 ppc64el x32 s390x hurd-i386 kfreebsd-amd64 kfreebsd-i386 ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' binutils) ge 2.23.1-1~exp3 ; echo $$?),0) ifneq (,$(filter $(DEB_HOST_ARCH),$(BINUTILS_GOLD_ARCHS))) -# -fused-ld=gold enables the gold linker (but is not supported by all archs / distro) - LDFLAGS_EXTRA += -fuse-ld=gold -#--no-keep-files-mapped --no-map-whole-files - CXXFLAGS_EXTRA += -fuse-ld=gold - CFLAGS_EXTRA += -fuse-ld=gold -#-Wl,--no-keep-files-mapped -Wl,--no-map-whole-files - CMAKE_EXTRA += -DLLVM_BINUTILS_INCDIR=/usr/include/ + STAGE_ALL_CMAKE_EXTRA += -DLLVM_USE_LINKER=gold + STAGE_ALL_CMAKE_EXTRA += -DLLVM_BINUTILS_INCDIR=/usr/include/ endif endif @@ -203,16 +235,9 @@ ifneq (,$(filter codecoverage,$(DEB_BUILD_OPTIONS))) LDFLAGS_EXTRA += -coverage -lgcov RUN_TEST=yes # OpenMP doesn't respect LDFLAGS - CMAKE_EXTRA+= -DLIBOMP_LDFLAGS="-coverage -lgcov" # don't pass LDFLAGS_EXTRA because it expects gcc arg + STAGE_2_CMAKE_EXTRA+= -DLIBOMP_LDFLAGS="-coverage -lgcov" # don't pass LDFLAGS_EXTRA because it expects gcc arg endif -# Enable for bootstrap -LDFLAGS_EXTRA += -fPIC -Wno-unused-command-line-argument -Wno-unknown-warning-option -Wl,--build-id -CXXFLAGS_EXTRA += -fPIC -Wno-unused-command-line-argument -Wno-unknown-warning-option -BOOTSTRAP_CXXFLAGS_EXTRA = $(CXXFLAGS_EXTRA) # Nothing for now. Keeping in case we need it -CFLAGS_EXTRA += -fPIC -Wno-unused-command-line-argument -Wno-unknown-warning-option -BOOTSTRAP_CFLAGS_EXTRA = $(CFLAGS_EXTRA) # Nothing for now. Keeping in case we need it - # Enable polly (or not) POLLY_ENABLE=yes ifneq (,$(filter $(DEB_HOST_ARCH), powerpc powerpcspe)) @@ -221,22 +246,28 @@ else PROJECTS+=;polly endif -# Enable openmp (or not) -OPENMP_ENABLE=yes -ifneq (,$(filter $(DEB_HOST_ARCH), m68k mips mipsel powerpc powerpcspe sparc64 s390x x32)) - OPENMP_ENABLE=no -else - PROJECTS+=;openmp -endif - # Enable libunwind (or not) LIBUNWIND_ENABLE=yes ifneq (,$(filter $(DEB_HOST_ARCH), s390x armel m68k mipsel hurd-i386 powerpc sparc sparc64 x32)) LIBUNWIND_ENABLE=no +# do not use compiler-rt builtins for libcxx (libcxxabi) when libunwind is +# disabled since the gnu implementation in libgcc_s will then be required + LIBCXX_USE_COMPILER_RT := OFF else - PROJECTS += ;libunwind - CMAKE_LIBCXX_EXTRA += -DLIBCXXABI_USE_LLVM_UNWINDER=ON \ - -DLIBUNWIND_USE_COMPILER_RT=ON + RUNTIMES += ;libunwind + STAGE_ALL_CMAKE_EXTRA += -DLIBCXXABI_USE_LLVM_UNWINDER=ON +endif + +# Enable openmp (or not) +OPENMP_ENABLE=yes +ifneq (,$(filter $(DEB_HOST_ARCH), m68k mipsel powerpc powerpcspe sparc64 s390x x32)) + OPENMP_ENABLE=no +else + RUNTIMES+=;openmp + STAGE_ALL_CMAKE_EXTRA += -DLIBOMP_LIBFLAGS="-lm" +ifeq ($(LIBUNWIND_ENABLE),yes) + STAGE_ALL_CMAKE_EXTRA += -DOPENMP_USE_LLVM_UNWINDER=ON +endif endif RUN_TEST=yes @@ -265,7 +296,7 @@ ifneq (,$(filter scan-build,$(DEB_BUILD_OPTIONS))) # no need to run tests in this case RUN_TEST=no CONFIGURE_EXTRA += --enable-assertions - CMAKE_EXTRA += -DLLVM_ENABLE_ASSERTIONS=ON + STAGE_ALL_CMAKE_EXTRA += -DLLVM_ENABLE_ASSERTIONS=ON endif ifneq (,$(filter coverity,$(DEB_BUILD_OPTIONS))) @@ -278,7 +309,7 @@ ifneq (,$(filter coverity,$(DEB_BUILD_OPTIONS))) PRE_PROCESS_CONF= COVERITY_ENABLE=1 CONFIGURE_EXTRA += --enable-assertions - CMAKE_EXTRA += -DLLVM_ENABLE_ASSERTIONS=ON + STAGE_ALL_CMAKE_EXTRA += -DLLVM_ENABLE_ASSERTIONS=ON # no need to run tests in this case RUN_TEST=no else @@ -286,15 +317,13 @@ else endif LLDB_ENABLE=yes -LLDB_DISABLE_ARCHS := hurd-i386 ia64 powerpc powerpcspe ppc64 riscv64 sparc64 +LLDB_DISABLE_ARCHS := hurd-i386 ia64 powerpc powerpcspe ppc64 riscv64 sparc64 mips64el mipsel # hurd has threading issues ifeq (,$(filter-out $(LLDB_DISABLE_ARCHS), $(DEB_HOST_ARCH))) # Disable LLDB for this arch. LLDB_ENABLE=no else -# See https://llvm.org/bugs/show_bug.cgi?id=28898 -# Enable it again as it seems it is fixed upstream https://bugs.llvm.org/show_bug.cgi?id=35291 -# CMAKE_EXTRA += -DLLDB_DISABLE_LIBEDIT=ON + STAGE_ALL_CMAKE_EXTRA += -DLLDB_ENABLE_LUA=OFF PROJECTS+=;lldb endif @@ -302,7 +331,7 @@ LLD_ENABLE=yes ifneq (,$(filter $(DEB_HOST_ARCH_OS),linux)) # only for linux - CMAKE_EXTRA += -DLLVM_USE_PERF=yes -DLLVM_ENABLE_LIBPFM=ON + STAGE_2_CMAKE_EXTRA += -DLLVM_USE_PERF=ON -DLLVM_ENABLE_LIBPFM=ON endif # Only enable it for archs supporting gold @@ -316,7 +345,7 @@ ifeq (,$(filter $(DEB_HOST_ARCH), armhf)) # * LLVM_ENABLE_LTO doesn't work with gcc >= 9 (option not accepted) # * BOOTSTRAP_LLVM_ENABLE_LTO is producing some large binary # See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=943623 -# CMAKE_EXTRA += -DBOOTSTRAP_LLVM_ENABLE_LTO="Thin" +# STAGE_2_CMAKE_EXTRA += -DLLVM_ENABLE_LTO="Thin" endif endif @@ -335,7 +364,7 @@ ifeq (,$(filter $(DEB_HOST_ARCH_OS),linux)) LIBFUZZER_ENABLE=no endif -ifneq (,$(filter $(DEB_HOST_ARCH), mips mipsel)) +ifneq (,$(filter $(DEB_HOST_ARCH), mipsel)) LIBOMP_ARCH = mips endif @@ -353,12 +382,15 @@ endif GENERATOR=Ninja +# enables cmake build targets like stage2-[target_name] +ENABLED_STAGE2_CMAKE_BUILD_TARGETS = check-all;check-llvm;check-clang;check-clang-tools;check-lld;check-libcxx;check-libcxxabi;check-sanitizer;llvm-config;test-suite + %: dh $@ $(DH_OPTIONS) # For some reasons, some spaces are added, removing them PROJECTS_LIST := $(shell echo "$(PROJECTS)"|sed -e "s| ||g") -#RUNTIMES_LIST := $(shell echo "$(RUNTIMES)"|sed -e "s| ||g") +RUNTIMES_LIST := $(shell echo "$(RUNTIMES)"|sed -e "s| ||g") preconfigure: @@ -375,7 +407,7 @@ preconfigure: @echo "DISTRO=$(DISTRO)" @echo "GCC_VERSION=$(GCC_VERSION)" @echo "PROJECTS=$(PROJECTS_LIST)" -# @echo "RUNTIMES=$(RUNTIMES_LIST)" + @echo "RUNTIMES=$(RUNTIMES_LIST)" @echo "LLVM_VERSION=$(LLVM_VERSION)" @echo "LLVM_VERSION_FULL=$(LLVM_VERSION_FULL)" @echo "LLVM_VERSION_SNAPSHOT=$(LLVM_VERSION_SNAPSHOT)" @@ -397,6 +429,15 @@ preconfigure: debian/llvm-$(LLVM_VERSION)-dev.install \ debian/llvm-$(LLVM_VERSION)-linker-tools.install + # workaround the breaks/replaces/conflicts introduced with the omp-device-info move + # we update the version to make it work with apt.llvm.org + # Yeah, this is ugly but I don't know how to do better + if test "$(LLVM_VERSION)" = "13"; then \ + if echo "$(LLVM_VERSION_SNAPSHOT)"|grep -q "++"; then \ + sed -i -e "s|(<< 1:13.0.0-4)|(<< 1:13.0.0~++20211013044936)|g" debian/control; \ + fi; \ + fi + # Conditionally enable *.spv files. Debian buster and Ubuntu 18.04 # don't have llvm-spirv to create the *.spv files. if test "$(LLVM_SPIRV_INSTALLED)" = "yes"; then \ @@ -436,63 +477,111 @@ override_dh_auto_configure: preconfigure --xml-option append_arg:"replace/llvm::AlignOf::Alignment/(llvm::AlignOf::Alignment)"; \ fi) +# Fails with No target "unwind_static" +# -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON \ +# -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY=OFF \ +# -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY=ON \ +#- to libc++ when libunwind is built +#- Matches what is done on brew: +#- https://bit.ly/3kDNpC9 + echo "Running tests: $(RUN_TEST)" echo "Using cmake: $(CMAKE_BIN)"; \ - CFLAGS="$(CFLAGS_EXTRA)" \ - CXXFLAGS="$(CXXFLAGS_EXTRA)" \ - LDFLAGS="$(LDFLAGS_EXTRA)" \ - LD_LIBRARY_PATH=$$LD_LIBRARY_PATH $(PRE_PROCESS_CONF) $(CMAKE_BIN) -S llvm/ -B $(TARGET_BUILD) \ + LD_LIBRARY_PATH=$$LD_LIBRARY_PATH \ + $(PRE_PROCESS_CONF) $(CMAKE_BIN) -S llvm/ -B $(TARGET_BUILD) \ -G $(GENERATOR) \ - -DLLVM_ENABLE_PROJECTS="$(PROJECTS_LIST)" \ - -DCMAKE_SUPPRESS_REGENERATION=ON \ - -DCMAKE_FIND_DEBUG_MODE=true \ -DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-$(LLVM_VERSION) \ - -DCMAKE_VERBOSE_MAKEFILE=ON \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$(opt_flags)" \ - -DLLVM_LINK_LLVM_DYLIB=ON \ - -DLLVM_INSTALL_UTILS=ON \ -DLLVM_VERSION_SUFFIX= \ - -DLLVM_ENABLE_SPHINX=ON \ - -DSPHINX_WARNINGS_AS_ERRORS=OFF \ - -DLLVM_ENABLE_RTTI=ON \ - -DLLVM_ENABLE_FFI=ON \ - -DLLVM_ENABLE_DUMP=ON \ - -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ - -DLIBCLANG_LIBRARY_VERSION=$(SONAME_EXT) \ - -DCLANG_LINK_CLANG_DYLIB=ON \ + -DCMAKE_SUPPRESS_REGENERATION=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_FLAGS="$(STAGE_1_CFLAGS)" \ + -DCMAKE_CXX_FLAGS="$(STAGE_1_CXXFLAGS)" \ + -DCMAKE_SHARED_LINKER_FLAGS="$(STAGE_1_LDFLAGS)" \ + -DCMAKE_MODULE_LINKER_FLAGS="$(STAGE_1_LDFLAGS)" \ + -DCMAKE_EXE_LINKER_FLAGS="$(STAGE_1_LDFLAGS)" \ + -DPACKAGE_VENDOR=$(VENDOR) \ -DENABLE_LINKER_BUILD_ID=ON \ - -DCOMPILER_RT_USE_LIBCXX=NO \ - $(CMAKE_EXTRA) \ - $(Z3_FLAG) \ - -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="AVR;M68k" \ + -DLLVM_TARGETS_TO_BUILD=Native \ + -DLLVM_ENABLE_PROJECTS="$(PROJECTS_LIST)" \ + -DLLVM_ENABLE_RUNTIMES="$(RUNTIMES_LIST)" \ + -DLLVM_ENABLE_PIC=ON \ + -DLLVM_ENABLE_RTTI=ON \ + -DLVVM_ENABLE_ZLIB=OFF \ + -DLLVM_BUILD_DOCS=OFF \ + -DLLVM_INCLUDE_GO_TESTS=OFF \ + -DLLVM_USE_RELATIVE_PATHS_IN_FILES=ON \ -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \ - -DCLANG_VENDOR=$(VENDOR) \ - -DCLANG_ENABLE_BOOTSTRAP=ON \ + -DCLANG_PLUGIN_SUPPORT=OFF \ -DCLANG_BUILD_EXAMPLES=OFF \ - -DLLVM_POLLY_LINK_INTO_TOOLS=ON \ + -DCLANG_DEFAULT_LINKER=ld \ + -DCLANG_DEFAULT_CXX_STDLIB=libstdc++ \ + -DCLANG_DEFAULT_RTLIB=libgcc \ + -DCOMPILER_RT_BUILD_XRAY=OFF \ + -DCOMPILER_RT_INCLUDE_TESTS=OFF \ + -DCOMPILER_RT_USE_LIBCXX=OFF \ + -DCOMPILER_RT_USE_BUILTINS_LIBRARY=$(COMPILER_RT_USE_BUILTINS_LIBRARY) \ + -DLIBUNWIND_USE_COMPILER_RT=ON \ + -DLIBUNWIND_INSTALL_LIBRARY=OFF \ + -DLIBCXXABI_ENABLE_EXCEPTIONS=$(LIBCXX_EXCEPTIONS) \ + -DLIBCXXABI_USE_COMPILER_RT=$(LIBCXX_USE_COMPILER_RT) \ + -DLIBCXXABI_INSTALL_LIBRARY=OFF \ -DLIBCXX_ENABLE_EXCEPTIONS=$(LIBCXX_EXCEPTIONS) \ -DLIBCXX_USE_COMPILER_RT=$(LIBCXX_USE_COMPILER_RT) \ -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \ -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \ -DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=OFF \ - -DLIBCXXABI_ENABLE_EXCEPTIONS=$(LIBCXX_EXCEPTIONS) \ - -DLIBCXXABI_USE_COMPILER_RT=$(LIBCXX_USE_COMPILER_RT) \ - -DBOOTSTRAP_CMAKE_CXX_FLAGS='$(BOOTSTRAP_CXXFLAGS_EXTRA)' \ - -DBOOTSTRAP_CMAKE_C_FLAGS='$(BOOTSTRAP_CFLAGS_EXTRA)' \ - -DCLANG_BOOTSTRAP_PASSTHROUGH="CMAKE_INSTALL_PREFIX;CMAKE_VERBOSE_MAKEFILE;CMAKE_FIND_DEBUG_MODE;CMAKE_BUILD_TYPE;CMAKE_CXX_FLAGS_RELWITHDEBINFO;LLVM_LINK_LLVM_DYLIB;LLVM_INSTALL_UTILS;LLVM_VERSION_SUFFIX;LLVM_ENABLE_SPHINX;SPHINX_WARNINGS_AS_ERRORS;LLVM_BUILD_LLVM_DYLIB;LLVM_ENABLE_RTTI;LLVM_ENABLE_FFI;LIBCLANG_LIBRARY_VERSION;ENABLE_LINKER_BUILD_ID;POLLY_BUNDLED_JSONCPP;LLVM_EXPERIMENTAL_TARGETS_TO_BUILD;LLVM_USE_PERF;LLVM_ENABLE_ASSERTIONS;LLVM_BINUTILS_INCDIR;LLVM_HOST_TRIPLE;LLVM_COMPILER_CHECKED;COMPILER_RT_BUILD_BUILTINS;LIBOMP_LIBFLAGS;CMAKE_SHARED_LINKER_FLAGS;PYTHON_EXECUTABLE;LLVM_ENABLE_Z3_SOLVER;LLVM_POLLY_LINK_INTO_TOOLS;CLANG_VENDOR;LIBUNWIND_USE_COMPILER_RT;LIBCXX_ENABLE_EXCEPTIONS;LIBCXX_USE_COMPILER_RT;LIBCXX_ENABLE_STATIC_ABI_LIBRARY;LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY;LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY;LIBCXXABI_ENABLE_EXCEPTIONS;LIBCXXABI_USE_COMPILER_RT"|| tail -100 build-llvm/CMakeFiles/CMakeError.log + -DLIBCXX_INSTALL_LIBRARY=OFF \ + -DOPENMP_ENABLE_LIBOMP_PROFILING=OFF \ + -DOPENMP_ENABLE_LIBOMPTARGET_PROFILING=OFF \ + -DLIBOMP_ENABLE_RTTI=OFF \ + -DLIBOMP_OMPT_SUPPORT=OFF \ + $(CMAKE_EXTRA) \ + -DBUILTINS_CMAKE_ARGS="-DCMAKE_C_FLAGS=$(STAGE_1_CFLAGS);-DCMAKE_CXX_FLAGS=$(STAGE_1_CXXFLAGS);-DCMAKE_EXE_LINKER_FLAGS=$(STAGE_1_LDFLAGS);-DCMAKE_SHARED_LINKER_FLAGS=$(STAGE_1_LDFLAGS);-DCMAKE_MODULE_LINKER_FLAGS=$(STAGE_1_LDFLAGS);-DCMAKE_SYSTEM_NAME=Linux;-DCMAKE_BUILD_TYPE=Release;-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF" \ + -DRUNTIMES_CMAKE_ARGS="-DCMAKE_C_FLAGS=$(STAGE_1_CFLAGS);-DCMAKE_CXX_FLAGS=$(STAGE_1_CXXFLAGS);-DCMAKE_EXE_LINKER_FLAGS=$(STAGE_1_LDFLAGS);-DCMAKE_SHARED_LINKER_FLAGS=$(STAGE_1_LDFLAGS);-DCMAKE_MODULE_LINKER_FLAGS=$(STAGE_1_LDFLAGS);-DCMAKE_SYSTEM_NAME=Linux;-DCMAKE_BUILD_TYPE=Release;-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF" \ + -DCLANG_ENABLE_BOOTSTRAP=ON \ + -DCLANG_BOOTSTRAP_TARGETS="$(ENABLED_STAGE2_CMAKE_BUILD_TARGETS)" \ + -DCLANG_BOOTSTRAP_PASSTHROUGH="CMAKE_INSTALL_PREFIX;CMAKE_SUPPRESS_REGENERATION;ENABLE_LINKER_BUILD_ID;LLVM_ENABLE_PIC;LLVM_ENABLE_RTTI;LLVM_INCLUDE_GO_TESTS;LLVM_USE_RELATIVE_PATHS_IN_FILES;CLANG_DEFAULT_LINKER;CLANG_DEFAULT_CXX_STDLIB;CLANG_DEFAULT_RTLIB;COMPILER_RT_USE_LIBCXX;COMPILER_RT_USE_BUILTINS_LIBRARY;COMPILER_RT_INCLUDE_TESTS;LIBUNWIND_USE_COMPILER_RT;LIBCXXABI_ENABLE_EXCEPTIONS;LIBCXXABI_USE_COMPILER_RT;LIBCXX_USE_COMPILER_RT;LIBCXX_ENABLE_EXCEPTIONS;LIBCXX_ENABLE_STATIC_ABI_LIBRARY;LIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY;LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY;LIBOMP_ENABLE_RTTI" \ + -DBOOTSTRAP_CMAKE_BUILD_TYPE=RelWithDebInfo \ + -DBOOTSTRAP_CMAKE_C_FLAGS_RELWITHDEBINFO="$(opt_flags)" \ + -DBOOTSTRAP_CMAKE_CXX_FLAGS_RELWITHDEBINFO="$(opt_flags)" \ + -DBOOTSTRAP_CMAKE_C_FLAGS="$(STAGE_2_CFLAGS)" \ + -DBOOTSTRAP_CMAKE_CXX_FLAGS="$(STAGE_2_CXXFLAGS)" \ + -DBOOTSTRAP_CMAKE_SHARED_LINKER_FLAGS="$(STAGE_2_LDFLAGS)" \ + -DBOOTSTRAP_CMAKE_MODULE_LINKER_FLAGS="$(STAGE_2_LDFLAGS)" \ + -DBOOTSTRAP_CMAKE_EXE_LINKER_FLAGS="$(STAGE_2_LDFLAGS)" \ + -DBOOTSTRAP_LLVM_ENABLE_FFI=ON \ + -DBOOTSTRAP_LLVM_ENABLE_DUMP=ON \ + -DBOOTSTRAP_LLVM_ENABLE_LIBPFM=ON \ + -DBOOTSTRAP_LLVM_ENABLE_SPHINX=ON \ + -DBOOTSTRAP_SPHINX_WARNINGS_AS_ERRORS=OFF \ + -DBOOTSTRAP_LLVM_USE_RELATIVE_PATHS_IN_FILES=ON \ + -DBOOTSTRAP_LLVM_INSTALL_UTILS=ON \ + -DBOOTSTRAP_LLVM_VERSION_SUFFIX= \ + -DBOOTSTRAP_LLVM_POLLY_LINK_INTO_TOOLS=ON \ + -DBOOTSTRAP_LLVM_EXPERIMENTAL_TARGETS_TO_BUILD="AVR;M68k" \ + -DBOOTSTRAP_LLVM_LINK_LLVM_DYLIB=ON \ + -DBOOTSTRAP_CLANG_LINK_CLANG_DYLIB=ON \ + -DBOOTSTRAP_LIBCLANG_LIBRARY_VERSION=$(SONAME_EXT) \ + -DBOOTSTRAP_LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY=ON \ + -DBOOTSTRAP_PYTHON_EXECUTABLE=/usr/bin/python3 \ + $(BOOTSTRAP_CMAKE_EXTRA) \ + -DBOOTSTRAP_BUILTINS_CMAKE_ARGS="-DCMAKE_C_FLAGS=$(STAGE_2_CFLAGS);-DCMAKE_CXX_FLAGS=$(STAGE_2_CXXFLAGS);-DCMAKE_EXE_LINKER_FLAGS=$(STAGE_2_LDFLAGS);-DCMAKE_SHARED_LINKER_FLAGS=$(STAGE_2_LDFLAGS);-DCMAKE_MODULE_LINKER_FLAGS=$(STAGE_2_LDFLAGS);-DCMAKE_SYSTEM_NAME=Linux;-DCMAKE_BUILD_TYPE=RelWithDebInfo;-DCMAKE_C_FLAGS_RELWITHDEBINFO=$(opt_flags);-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=$(opt_flags);-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF" \ + -DBOOTSTRAP_RUNTIMES_CMAKE_ARGS="-DCMAKE_C_FLAGS=$(STAGE_2_CFLAGS);-DCMAKE_CXX_FLAGS=$(STAGE_2_CXXFLAGS);-DCMAKE_EXE_LINKER_FLAGS=$(STAGE_2_LDFLAGS) -L$(STAGE_1_LIB_DIR);-DCMAKE_SHARED_LINKER_FLAGS=$(STAGE_2_LDFLAGS) -L$(STAGE_1_LIB_DIR);-DCMAKE_MODULE_LINKER_FLAGS=$(STAGE_2_LDFLAGS) -L$(STAGE_1_LIB_DIR);-DCMAKE_SYSTEM_NAME=Linux;-DCMAKE_BUILD_TYPE=RelWithDebInfo;-DCMAKE_C_FLAGS_RELWITHDEBINFO=$(opt_flags);-DCMAKE_CXX_FLAGS_RELWITHDEBINFO=$(opt_flags);-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF" + FOUND_VERSION=`grep LLVM_VERSION_STRING build-llvm/include/llvm/Config/llvm-config.h|cut -d\" -f2`; \ if ! echo "$(LLVM_VERSION_FULL)"|grep "$$FOUND_VERSION"; then \ - echo "mistmatch of version. Found: $$FOUND_VERSION / Expected: $(LLVM_VERSION_FULL)"; \ + echo "mismatch of version. Found: $$FOUND_VERSION / Expected: $(LLVM_VERSION_FULL)"; \ exit 1; \ fi - # ninja VERBOSE=-v debian-full-build: - $(PRE_PROCESS) ninja $(NJOBS) -C $(TARGET_BUILD) $(VERBOSE) stage2 + echo "Using cmake: $(CMAKE_BIN)" +# linker hack so stage2 can link against stage1 libs at runtime + LD_LIBRARY_PATH=$(STAGE_1_LIB_DIR):$$LD_LIBRARY_PATH \ + VERBOSE=1 $(PRE_PROCESS) $(CMAKE_BIN) --build $(TARGET_BUILD) $(NJOBS) --target stage2 # Check the stage 2 build worked if ! readelf --string-dump .comment $(TARGET_BUILD_STAGE2)/bin/clang 2>&1|grep -q "clang version"; then \ @@ -503,52 +592,38 @@ debian-full-build: echo "libclang-$(LLVM_VERSION).so.1 depends on libclang-cpp. Should not be the case"; \ exit 2; \ fi -# $(PRE_PROCESS) make $(NJOBS) -C $(TARGET_BUILD) $(VERBOSE) CFLAGS="$(CFLAGS_EXTRA)" CXXFLAGS="$(CXXFLAGS_EXTRA)" LDFLAGS="$(LDFLAGS_EXTRA)" REQUIRES_RTTI=1 DEBUGMAKE=1 runtimes - touch $@ debian-libfuzzer-build: ifeq (${LIBFUZZER_ENABLE},yes) cd $(TARGET_BUILD); \ - CFLAGS=`dpkg-buildflags --get CFLAGS`; \ - CFLAGS="$$CFLAGS `dpkg-buildflags --get CPPFLAGS`"; \ + CFLAGS="$(opt_flags) $(STAGE_2_CFLAGS)"; \ echo $$CFLAGS; \ - $(BASE_PATH)/$(TARGET_BUILD_STAGE2)/bin/clang++ -c $$CFLAGS -std=c++11 $(BASE_PATH)/compiler-rt/lib/fuzzer/*.cpp -IFuzzer; \ + $(STAGE_2_BIN_DIR)/clang++ -c $$CFLAGS -std=c++11 $(BASE_PATH)/compiler-rt/lib/fuzzer/*.cpp -IFuzzer; \ ar ruv libFuzzer.a Fuzzer*.o endif touch $@ -# Libc++ doesn't build with: -# Fails with $ -# No target "unwind_static" -# on 12. Will test with 13 -# -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON \ -# -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY=OFF \ -# -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY=ON \ -N -#- to libc++ when libunwind is built -#- Matches what is done on brew: -#- https://bit.ly/3kDNpC9 - debian-libclc-build: # Builds libclc - mkdir -p libclc/build - - CMAKE_BIN=cmake; \ - if test -f /tmp/cmake/bin/cmake; then \ - CMAKE_BIN=/tmp/cmake/bin/cmake; \ - fi; \ - echo "Using cmake: $$CMAKE_BIN"; \ + echo "Using cmake: $(CMAKE_BIN)" cd libclc/build && \ - $(PRE_PROCESS_CONF) $$CMAKE_BIN ../ \ + $(CMAKE_BIN) ../ \ -G $(GENERATOR) \ + -DCMAKE_C_COMPILER=$(STAGE_2_BIN_DIR)/clang \ + -DCMAKE_CXX_COMPILER=$(STAGE_2_BIN_DIR)/clang++ \ + -DCMAKE_C_FLAGS="$(opt_flags) $(STAGE_2_CFLAGS)" \ + -DCMAKE_CXX_FLAGS="$(opt_flags) $(STAGE_2_CXXFLAGS)" \ + -DCMAKE_SHARED_LINKER_FLAGS="$(STAGE_2_LDFLAGS) -L$(STAGE_2_LIB_DIR)" \ + -DCMAKE_MODULE_LINKER_FLAGS="$(STAGE_2_LDFLAGS) -L$(STAGE_2_LIB_DIR)" \ + -DCMAKE_EXE_LINKER_FLAGS="$(STAGE_2_LDFLAGS) -L$(STAGE_2_LIB_DIR)" \ -DCMAKE_INSTALL_PREFIX=/usr \ -DCMAKE_INSTALL_DATADIR=lib \ -DCMAKE_INSTALL_INCLUDEDIR=include \ - -DLLVM_CONFIG=$(CURDIR)/$(TARGET_BUILD_STAGE2)/bin/llvm-config \ + -DLLVM_CONFIG=$(STAGE_2_BIN_DIR)/llvm-config \ -DLIBCLC_TARGETS_TO_BUILD=$(LIBCLC_TARGETS_TO_BUILD); \ - ninja $(VERBOSE) + ninja $(NJOBS) $(VERBOSE) touch $@ override_dh_auto_build: debian-full-build debian-libfuzzer-build debian-libclc-build @@ -578,7 +653,7 @@ ifeq (${POLLY_ENABLE},yes) endif # Rename manpages - d=$(CURDIR)/docs/_build/man/; \ + d=$(CURDIR)/llvm/docs/_build/man/; \ if test -d $$d; then \ cd $$d; \ for f in *.1; do \ @@ -589,7 +664,7 @@ endif fi # the clang doc generation only generates clang manpage # When it will do more, we should move that in the loop above - cd $(CURDIR)/clang/docs/_build/man/; mv clang.1 clang-$(LLVM_VERSION).1 + cd $(CURDIR)/clang/docs/_build/man/ && mv clang.1 clang-$(LLVM_VERSION).1 # Remove the copy of jquery. See bug #701087 for d in $(TARGET_BUILD_STAGE2)/docs/html/_static/ $(TARGET_BUILD_STAGE2)/tools/clang/docs/html/_static/ $(TARGET_BUILD_STAGE2)/tools/clang/tools/extra/docs/html/_static/; do \ @@ -639,19 +714,16 @@ override_dh_auto_install: ln -s libclang-$(LLVM_VERSION).so.$(SONAME_CLANG) libclang.so.$(SONAME_EXT) && \ ln -s libclang-$(LLVM_VERSION).so.$(SONAME_CLANG) libclang-$(LLVM_VERSION).so.$(SONAME_EXT) - : # libomp - cd debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib && rm -f libomp.so; \ - ln -s libomp.so.$(SONAME_OPENMP) libomp.so - if test "$(LIBUNWIND_ENABLE)" = yes; then \ mkdir -p debian/tmp/usr/include/libunwind; \ cp -R libunwind/include/* debian/tmp/usr/include/libunwind/; \ fi + : # libomp if test "$(OPENMP_ENABLE)" = yes; then \ - mkdir -p debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/include/openmp; \ - cp -f openmp/runtime/exports/common*/include/* debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/include/openmp; \ - cd debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib && cp libomp.so.$(SONAME_OPENMP) libomp-$(LLVM_VERSION).so.$(SONAME_OPENMP); \ + cd debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib; \ + ln -s libomp.so.$(SONAME_OPENMP) libomp.so; \ + cp libomp.so.$(SONAME_OPENMP) libomp-$(LLVM_VERSION).so.$(SONAME_OPENMP); \ fi # Remove artifact (where compiler-rt is built) @@ -674,7 +746,7 @@ endif mkdir -p $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/clang/$(LLVM_VERSION)/lib/clang_linux/ mkdir -p $(TARGET_BUILD)/tools/clang/runtime/compiler-rt/clang_linux/ mkdir -p $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/clang/$(LLVM_VERSION_FULL)/share/ -# On some archs, the sanatizers are not built. As we explicitly includes some txt files, create +# On some archs, the sanitizers are not built. As we explicitly includes some txt files, create # a fake txt to make sure it doesn't fail echo "The *.txt files, if available, contain helper to override some of the errors messages." > $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/clang/$(LLVM_VERSION_FULL)/README.txt echo "Please visit https://github.com/google/sanitizers/wiki/AddressSanitizer for help" >> $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/clang/$(LLVM_VERSION_FULL)/README.txt @@ -733,13 +805,13 @@ endif rm -f $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/include/llvm/Support/LICENSE.TXT # Disable CMake's package validation checks for target files that we may remove. - sed -i '/_IMPORT_CHECK_TARGETS \(Polly\|sancov\|omptarget\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake + sed -i '/_IMPORT_CHECK_TARGETS \(Polly\|sancov\|llvm-omp-device-info\|omptarget\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake # Disable CMake's package validation checks for binaries that may not be installed sed -i 's|.*_IMPORT_CHECK_FILES_FOR_.*/bin/.*)|#&|' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake # Adjust to the existing symlink. See #994827 - sed -i "s|libclang-$(LLVM_VERSION).so.$(LLVM_VERSION).*\"|libclang-$(LLVM_VERSION).so.1\"|" $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-relwithdebinfo.cmake + sed -i "s|libclang-$(LLVM_VERSION).so.$(LLVM_VERSION).*\"|libclang-$(LLVM_VERSION).so.1\"|" $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake # Managed in python*-lldb-X.Y.links.in rm -f $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/python*/*-packages/lldb/_lldb.so @@ -747,8 +819,8 @@ endif # Manage the polly files. Sometimes, we build them. Sometimes not. if test "$(POLLY_ENABLE)" = yes; then \ mkdir -p $(CURDIR)/debian/libclang-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/lib/ $(CURDIR)/debian/libclang-common-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/polly/; \ - mv -f $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/libpolly* \ - $(CURDIR)/debian/libclang-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/lib/; \ + mv -f $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/libPolly* \ + $(CURDIR)/debian/libclang-common-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/lib/; \ rm -rf $(CURDIR)/debian/libclang-common-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/polly; \ mv -f $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/include/polly/ \ $(CURDIR)/debian/libclang-common-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/; \ @@ -942,7 +1014,7 @@ override_dh_gencontrol: override_dh_auto_clean: - rm -rf $(TARGET_BUILD) tools/clang/include/clang/Debian/debian_path.h docs/_build/ clang/docs/_build tools/clang/docs/_html/ + rm -rf $(TARGET_BUILD) tools/clang/include/clang/Debian/debian_path.h llvm/docs/_build/ clang/docs/_build tools/clang/docs/_html/ # QA tools rm -rf cov-int/ reports/ rm -f `ls debian/*.in|sed -e "s|.in$$||g"` diff --git a/debian/tests/control b/debian/tests/control index 04df670e..1a440290 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -8,6 +8,7 @@ Restrictions: allow-stderr Tests: integration-test-suite-test Depends: @, cmake, make, g++, libstdc++-10-dev Restrictions: allow-stderr +Architecture: amd64 arm64 Tests: cmake-test Depends: gcc, build-essential, cmake, llvm-14-dev diff --git a/debian/watch b/debian/watch index a6d1751f..abd072ff 100644 --- a/debian/watch +++ b/debian/watch @@ -1,3 +1,2 @@ -version=3 +version=4 https://llvm.org/releases/download.html .*/llvm-([\d\.\-]+).src.tar.xz -