From b91115bd58c13f7c246cd0f2e9cec01ae439a3c7 Mon Sep 17 00:00:00 2001 From: Faidon Liambotis Date: Sun, 13 Nov 2022 08:45:30 +0200 Subject: [PATCH 01/38] Fix wasm include paths, unbreaking compiler-rt builds on !x86 compiler-rt WebAssembly builds were failing, and as a workaround commit ca9dbba introduced COMPILER_RT_WASM_ENABLE, disabling its compilation on several architectures (arm64 armel mips64el mipsel ppc64el armhf). This was ultimately caused by the WebAssembly driver including paths in bare /usr/include, when compiling for wasnNN-unknown-unknown targets. This in turn resulted in this chain of include paths when building compiler-rt, as one example out of many: 1. compiler-rt/lib/builtins/divtf3.c:15 #include "fp_lib.h" 2. compiler-rt/lib/builtins/fp_lib.h:23 #include "int_lib.h" 3. compiler-rt/lib/builtins/int_lib.h:93 #include 4. /usr/lib/llvm-14/lib/clang/14.0.6/include/limits.h:20 #if __has_include_next() #include_next 5. /usr/include/limits.h:26 #include 6. fatal error: 'bits/libc-header-start.h' file not found /usr/include/stdint.h is the host's glibc header, and bits/libc-header-start.h doesn't exist for the wasm targets. This is the case with or without wasi-libc, as wasi-libc is musl-based and doesn't have these paths at all. The only reason builds worked on amd64 is accident:lly the B-D chain brings in libc6-dev-i386 (through g++-multilib), which creates this symlink: /usr/include/bits -> x86_64-linux-gnu/bits This effectively meant that on amd64 builds, compiler-rt for wasm targets was compiled with glibc x86_64 headers. Ultimately this was rooted on the sysroot-based assumptions that the upstream driver makes and that we are patching (evidently incompletely) with our wasm-sysroot-usr.diff patch. Update our patch to explicitly NOT include the bare /usr/include path on non-OS targets (wasm32-unknown-unknown etc.), while keeping existing behavior for backwards compatibility when --sysroot is passed. Given this should (fingers crossed) address this invariance between amd64 and other architectures, and unbreak those builds, revert commit ca9dbba and the COMPILER_RT_WASM_ENABLE flag. --- debian/patches/wasm/wasm-sysroot-usr.diff | 16 +++++++++++++--- debian/rules | 13 +------------ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/debian/patches/wasm/wasm-sysroot-usr.diff b/debian/patches/wasm/wasm-sysroot-usr.diff index f24ec1fc..165de408 100644 --- a/debian/patches/wasm/wasm-sysroot-usr.diff +++ b/debian/patches/wasm/wasm-sysroot-usr.diff @@ -27,21 +27,31 @@ Index: llvm-toolchain-14-14.0.6/clang/lib/Driver/ToolChains/WebAssembly.cpp if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) { SmallString<128> P(D.ResourceDir); -@@ -421,10 +423,10 @@ void WebAssembly::AddClangSystemIncludeA +@@ -419,12 +421,20 @@ void WebAssembly::AddClangSystemIncludeA + return; + } ++ // add the multiarch path on e.g. wasm32-wasi if (getTriple().getOS() != llvm::Triple::UnknownOS) { const std::string MultiarchTriple = - getMultiarchTriple(D, getTriple(), D.SysRoot); - addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/include/" + MultiarchTriple); + getMultiarchTriple(D, getTriple(), SysRoot); ++ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/local/include/" + MultiarchTriple); ++ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/local/include"); + addSystemInclude(DriverArgs, CC1Args, SysRoot + "/include/" + MultiarchTriple); } - addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/include"); -+ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/include"); ++ ++ // also add the non-multiarch path, only on a known OS (as above), or when ++ // a sysroot is given, for backwards compatibility with the original driver ++ if (getTriple().getOS() != llvm::Triple::UnknownOS || ++ !getDriver().SysRoot.empty()) ++ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/include"); } void WebAssembly::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs, -@@ -467,3 +469,15 @@ SanitizerMask WebAssembly::getSupportedS +@@ -467,3 +477,15 @@ SanitizerMask WebAssembly::getSupportedS Tool *WebAssembly::buildLinker() const { return new tools::wasm::Linker(*this); } diff --git a/debian/rules b/debian/rules index f55a3caa..04ff3481 100755 --- a/debian/rules +++ b/debian/rules @@ -302,12 +302,6 @@ ifeq ($(LIBUNWIND_ENABLE),yes) endif endif -COMPILER_RT_WASM_ENABLE=yes - -ifneq (,$(filter $(DEB_HOST_ARCH), arm64 armel mips64el mipsel ppc64el armhf)) - COMPILER_RT_WASM_ENABLE=no -endif - # Do not install objects STAGE_ALL_CMAKE_EXTRA += -DMLIR_INSTALL_AGGREGATE_OBJECTS=OFF @@ -716,7 +710,6 @@ debian-libclc-build: touch $@ debian-rtlib-wasm-build: -ifeq (${COMPILER_RT_WASM_ENABLE},yes) echo "Using cmake: $(CMAKE_BIN)" for build in wasm32 wasm64; do \ mkdir -p build-compiler-rt-$$build; \ @@ -746,9 +739,6 @@ ifeq (${COMPILER_RT_WASM_ENABLE},yes) -DCOMPILER_RT_OS_DIR=wasi; \ ninja -C build-compiler-rt-$$build $(NJOBS) $(VERBOSE); \ done -else - echo "Skip on this arch" -endif touch $@ @@ -901,10 +891,9 @@ endif $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/build/utils/lit/lit/*/__pycache__/ DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C libclc/build install -ifeq (${COMPILER_RT_WASM_ENABLE},yes) + DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-compiler-rt-wasm32 install DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-compiler-rt-wasm64 install -endif # Rename binaries mkdir -p $(DEB_INST)/usr/bin/ From ecbebd0a8fd344a73c54963f287387a950b99213 Mon Sep 17 00:00:00 2001 From: Faidon Liambotis Date: Sun, 13 Nov 2022 09:51:30 +0200 Subject: [PATCH 02/38] Patch the WebAssembly include paths for C++ as well In wasm-sysroot-usr.diff we have changes to support compilation without a sysroot and with system paths. These so far have applied to the C include paths (among other things), i.e. /usr/include/. This was mainly because that's what I had at hand to test and wanted to keep things limited as a first iteration. Now that we're iterated on it and cleared out some issues, make the exact same changes for the C++ include paths as well, i.e. /usr/include//c++/v1. Nothing installs anything on those paths there yet, so this is mostly preparatory for subsequent changes. --- debian/patches/wasm/wasm-sysroot-usr.diff | 27 +++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/debian/patches/wasm/wasm-sysroot-usr.diff b/debian/patches/wasm/wasm-sysroot-usr.diff index 165de408..0d884214 100644 --- a/debian/patches/wasm/wasm-sysroot-usr.diff +++ b/debian/patches/wasm/wasm-sysroot-usr.diff @@ -27,7 +27,7 @@ Index: llvm-toolchain-14-14.0.6/clang/lib/Driver/ToolChains/WebAssembly.cpp if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) { SmallString<128> P(D.ResourceDir); -@@ -419,12 +421,20 @@ void WebAssembly::AddClangSystemIncludeA +@@ -419,27 +421,39 @@ void WebAssembly::AddClangSystemIncludeA return; } @@ -51,7 +51,30 @@ Index: llvm-toolchain-14-14.0.6/clang/lib/Driver/ToolChains/WebAssembly.cpp } void WebAssembly::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs, -@@ -467,3 +477,15 @@ SanitizerMask WebAssembly::getSupportedS + ArgStringList &CC1Args) const { ++ std::string SysRoot = computeSysRoot(); ++ + if (!DriverArgs.hasArg(options::OPT_nostdlibinc) && + !DriverArgs.hasArg(options::OPT_nostdincxx)) { + if (getTriple().getOS() != llvm::Triple::UnknownOS) { + const std::string MultiarchTriple = +- getMultiarchTriple(getDriver(), getTriple(), getDriver().SysRoot); ++ getMultiarchTriple(getDriver(), getTriple(), SysRoot); + addSystemInclude(DriverArgs, CC1Args, +- getDriver().SysRoot + "/include/" + MultiarchTriple + ++ SysRoot + "/include/" + MultiarchTriple + + "/c++/v1"); + } +- addSystemInclude(DriverArgs, CC1Args, +- getDriver().SysRoot + "/include/c++/v1"); ++ ++ // don't include the host architecture's headers in the search path ++ if (!getDriver().SysRoot.empty()) ++ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/include/c++/v1"); + } + } + +@@ -467,3 +481,15 @@ SanitizerMask WebAssembly::getSupportedS Tool *WebAssembly::buildLinker() const { return new tools::wasm::Linker(*this); } From 6923a432bf072385e0b849ae191dba9a2487e891 Mon Sep 17 00:00:00 2001 From: Faidon Liambotis Date: Sun, 13 Nov 2022 10:53:35 +0200 Subject: [PATCH 03/38] d/rules: remove targets from .PHONY We actually touch $@ at the end of these targets, so they are not phony. --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 04ff3481..48ad0b52 100755 --- a/debian/rules +++ b/debian/rules @@ -1201,4 +1201,4 @@ override_dh_auto_clean: : # remove extra stamps rm -f debian-*-build -.PHONY: override_dh_strip preconfigure debian-full-build debian-libfuzzer-build debian-libclc-build debian-rtlib-wasm-build +.PHONY: override_dh_strip preconfigure From bbfc6cca0704cce55d2bac33e3db865352539640 Mon Sep 17 00:00:00 2001 From: Faidon Liambotis Date: Sun, 13 Nov 2022 11:12:52 +0200 Subject: [PATCH 04/38] d/rules: split override_dh_auto_build into multiple lines --- debian/rules | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 48ad0b52..6b8a13b0 100755 --- a/debian/rules +++ b/debian/rules @@ -752,7 +752,12 @@ sccache-stats: fi touch $@ -override_dh_auto_build: debian-full-build debian-libfuzzer-build debian-libclc-build debian-rtlib-wasm-build sccache-stats +override_dh_auto_build: \ + debian-full-build \ + debian-libfuzzer-build \ + debian-libclc-build \ + debian-rtlib-wasm-build \ + sccache-stats override_dh_prep: build_doc dh_prep From 9459395c21478caf0b551970222d239ec250e85e Mon Sep 17 00:00:00 2001 From: Faidon Liambotis Date: Sun, 13 Nov 2022 11:20:01 +0200 Subject: [PATCH 05/38] d/rules: Makeify compiler-rt wasm target Iterate on wasm32/wasm64 using make targets rather than shell, and place build artifacts under a common "build-wasm" directory. --- debian/rules | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/debian/rules b/debian/rules index 6b8a13b0..cb05e356 100755 --- a/debian/rules +++ b/debian/rules @@ -709,16 +709,17 @@ debian-libclc-build: ninja $(NJOBS) $(VERBOSE) touch $@ -debian-rtlib-wasm-build: - echo "Using cmake: $(CMAKE_BIN)" - for build in wasm32 wasm64; do \ - mkdir -p build-compiler-rt-$$build; \ - $(CMAKE_BIN) -B build-compiler-rt-$$build -S compiler-rt/lib/builtins/ \ +build-wasm/compiler-rt-%: cpu = $(@:build-wasm/compiler-rt-%=%) +build-wasm/compiler-rt-%: + @echo "Building compiler-rt for $(cpu)" + @echo "Using cmake: $(CMAKE_BIN)" + mkdir -p "$@" + $(CMAKE_BIN) -B "$@" -S compiler-rt/lib/builtins/ \ -G Ninja \ $(SCCACHE_CMAKE) \ - -DCMAKE_C_COMPILER_TARGET=$$build-unknown-unknown \ - -DCMAKE_CXX_COMPILER_TARGET=$$build-unknown-unknown \ - -DCMAKE_ASM_COMPILER_TARGET=$$build-unknown-unknown \ + -DCMAKE_C_COMPILER_TARGET=$(cpu)-unknown-unknown \ + -DCMAKE_CXX_COMPILER_TARGET=$(cpu)-unknown-unknown \ + -DCMAKE_ASM_COMPILER_TARGET=$(cpu)-unknown-unknown \ -DCMAKE_C_COMPILER=$(STAGE_2_BIN_DIR)/clang \ -DCMAKE_CXX_COMPILER=$(STAGE_2_BIN_DIR)/clang++ \ -DCMAKE_C_FLAGS="$(opt_flags) $(STAGE_2_CFLAGS)" \ @@ -735,12 +736,14 @@ debian-rtlib-wasm-build: -DCOMPILER_RT_INCLUDE_TESTS=OFF \ -DCOMPILER_RT_USE_LIBCXX=OFF \ -DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON \ - -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=$$build-unknown-unknown \ - -DCOMPILER_RT_OS_DIR=wasi; \ - ninja -C build-compiler-rt-$$build $(NJOBS) $(VERBOSE); \ - done - touch $@ + -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=$(cpu)-unknown-unknown \ + -DCOMPILER_RT_OS_DIR=wasi + ninja -C "$@" $(NJOBS) $(VERBOSE) +debian-wasm-build: \ + build-wasm/compiler-rt-wasm32 \ + build-wasm/compiler-rt-wasm64 + touch $@ sccache-stats: # If we used sccache, shows stats @@ -756,7 +759,7 @@ override_dh_auto_build: \ debian-full-build \ debian-libfuzzer-build \ debian-libclc-build \ - debian-rtlib-wasm-build \ + debian-wasm-build \ sccache-stats override_dh_prep: build_doc @@ -897,8 +900,8 @@ endif DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C libclc/build install - DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-compiler-rt-wasm32 install - DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-compiler-rt-wasm64 install + DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-wasm/compiler-rt-wasm32 install + DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-wasm/compiler-rt-wasm64 install # Rename binaries mkdir -p $(DEB_INST)/usr/bin/ @@ -1190,7 +1193,7 @@ override_dh_auto_clean: rm -f $(CURDIR)/clang/tools/clang-format/clang-format-diff-$(LLVM_VERSION) rm -f $(CURDIR)/clang/tools/clang-format/clang-format-$(LLVM_VERSION).py rm -rf libclc/build - rm -rf build-compiler-rt-wasm32 build-compiler-rt-wasm64 + rm -rf build-wasm if test -f lld/docs/ld.lld-$(LLVM_VERSION).1; then \ mv lld/docs/ld.lld-$(LLVM_VERSION).1 lld/docs/ld.lld.1; \ fi From 97d60707ed17c4ab13f225129e3f22faaa144274 Mon Sep 17 00:00:00 2001 From: Faidon Liambotis Date: Sun, 13 Nov 2022 12:14:06 +0200 Subject: [PATCH 06/38] Build libc++/libc++abi for wasm32-wasi Do a standalone build of libcxx/libcxxabi, for wasm32-wasi. libcxx requires a libc, and thus this requires a new build dependency on wasi-libc. wasi-libc is not currently available for wasm64, so limit the build to wasm32. This introduces two new binary packages: - libc++-${LLVM_VERSION}-dev-wasm32 - libc++abi-${LLVM_VERSION}-dev-wasm32 There isn't currently a naming convention in Debian for WebAssembly. Use a "-dev-wasm32" suffix, which makes it consistent with packages such as "libc6-dev-i386" and "libstd-rust-dev-wasm32". Given these builds are specific to WASI, it can be argued that the names should be something like "-dev-wasm32-wasi", or simplified to "-dev-wasi" (not very future proof) or "-dev-wasi32" (not something upstream uses). Something to think through later on. WebAssembly only supports shared linking, hence why we -dev packages are provided, shipping development headers and static archives. --- debian/control | 43 ++++++++++ debian/libc++-X.Y-dev-wasm32.install.in | 3 + debian/libc++-X.Y-dev-wasm32.links.in | 2 + debian/libc++abi-X.Y-dev-wasm32.install.in | 1 + debian/libc++abi-X.Y-dev-wasm32.links.in | 1 + debian/qualify-clang.sh | 26 +++++-- debian/rules | 91 +++++++++++++++++++++- 7 files changed, 159 insertions(+), 8 deletions(-) create mode 100644 debian/libc++-X.Y-dev-wasm32.install.in create mode 100644 debian/libc++-X.Y-dev-wasm32.links.in create mode 100644 debian/libc++abi-X.Y-dev-wasm32.install.in create mode 100644 debian/libc++abi-X.Y-dev-wasm32.links.in diff --git a/debian/control b/debian/control index 58f91da2..9883345b 100644 --- a/debian/control +++ b/debian/control @@ -24,6 +24,7 @@ Build-Depends: debhelper (>= 10.0), cmake, ninja-build, libpfm4-dev [linux-any], python3-setuptools, libz3-dev, llvm-spirv-14 [ amd64 arm64 armel armhf mips64el mipsel ppc64el s390x ] | hello [!i386], spirv-tools [ linux-any ] | hello [ !i386], + wasi-libc, libcurl4-dev, libgrpc++-dev [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x], protobuf-compiler-grpc [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x], @@ -648,6 +649,29 @@ Description: LLVM C++ Standard library (development files) as exception objects, rtti and memory allocation. * Extensive unit tests. +Package: libc++-14-dev-wasm32 +Section: libdevel +Architecture: all +Multi-Arch: foreign +Depends: wasi-libc, libc++abi-14-dev-wasm32, ${misc:Depends} +Provides: libc++-x.y-dev-wasm32 +Conflicts: libc++-x.y-dev-wasm32 +Replaces: libc++-x.y-dev-wasm32 +Description: LLVM C++ Standard library (WASI) + libc++ is another implementation of the C++ standard library + . + Features and Goals + . + * Correctness as defined by the C++ standards. + * Fast execution. + * Minimal memory use. + * Fast compile times. + * ABI compatibility with gcc's libstdc++ for some low-level features such + as exception objects, rtti and memory allocation. + * Extensive unit tests. + . + This package provides a version for the 32-bit WebAssembly System Interface. + # ------------- libcxxabi ------------- Package: libc++abi1-14 @@ -687,6 +711,25 @@ Description: LLVM low level support for a standard C++ library (development file * Correctness as defined by the C++ standards. * Provide a portable sublayer to ease the porting of libc++ +Package: libc++abi-14-dev-wasm32 +Section: libdevel +Architecture: all +Multi-Arch: foreign +Depends: wasi-libc, ${misc:Depends} +Provides: libc++abi-x.y-dev-wasm32 +Conflicts: libc++abi-x.y-dev-wasm32 +Replaces: libc++abi-x.y-dev-wasm32 +Description: LLVM low level support for a standard C++ library (WASI) + libc++abi is another implementation of low level support for a standard C++ + library. + . + Features and Goals + . + * Correctness as defined by the C++ standards. + * Provide a portable sublayer to ease the porting of libc++ + . + This package provides a version for the 32-bit WebAssembly System Interface. + # ------------- libclc ------------- Package: libclc-14 diff --git a/debian/libc++-X.Y-dev-wasm32.install.in b/debian/libc++-X.Y-dev-wasm32.install.in new file mode 100644 index 00000000..13c31f09 --- /dev/null +++ b/debian/libc++-X.Y-dev-wasm32.install.in @@ -0,0 +1,3 @@ +usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++.a +usr/lib/llvm-@LLVM_VERSION@/include/wasm32-wasi/c++/ +usr/lib/llvm-@LLVM_VERSION@/include/wasm32-wasi/c++/v1/ diff --git a/debian/libc++-X.Y-dev-wasm32.links.in b/debian/libc++-X.Y-dev-wasm32.links.in new file mode 100644 index 00000000..465536e9 --- /dev/null +++ b/debian/libc++-X.Y-dev-wasm32.links.in @@ -0,0 +1,2 @@ +usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++.a /usr/lib/wasm32-wasi/libc++.a +usr/lib/llvm-@LLVM_VERSION@/include/wasm32-wasi/c++/v1 /usr/include/wasm32-wasi/c++/v1 diff --git a/debian/libc++abi-X.Y-dev-wasm32.install.in b/debian/libc++abi-X.Y-dev-wasm32.install.in new file mode 100644 index 00000000..1d6e8500 --- /dev/null +++ b/debian/libc++abi-X.Y-dev-wasm32.install.in @@ -0,0 +1 @@ +usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++abi.a diff --git a/debian/libc++abi-X.Y-dev-wasm32.links.in b/debian/libc++abi-X.Y-dev-wasm32.links.in new file mode 100644 index 00000000..c1655fbf --- /dev/null +++ b/debian/libc++abi-X.Y-dev-wasm32.links.in @@ -0,0 +1 @@ +usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++abi.a /usr/lib/wasm32-wasi/libc++abi.a diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index dfda6e44..385cf5a7 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -1361,22 +1361,34 @@ fi if dpkg -l|grep -q wasi-libc; then cat < printf.c #include - int main(int argc, char *argv[]) - { - printf("%s\n", "Hello world!"); + int main(int argc, char *argv[]) { + printf("%s\n", "Hello World!"); } EOF - clang-$VERSION -target wasm32-unknown-wasi -o printf printf.c + # wasi-libc supports only wasm32 right now + clang-$VERSION -target wasm32-wasi -o printf printf.c file printf &> foo.log if ! grep -q "WebAssembly" foo.log; then echo "the generated file isn't a WebAssembly file?" exit 1 fi rm -f printf.c printf + + cat < cout.cpp + #include + int main() { + std::cout << "Hello World!" << std::endl; + } +EOF + # libcxx requires wasi-libc, which only exists for wasm32 right now + clang++-$VERSION --target=wasm32-wasi -o cout cout.cpp + file cout &> foo.log + if ! grep -q "WebAssembly" foo.log; then + echo "the generated file isn't a WebAssembly file?" + exit 1 + fi + rm -f cout.cpp cout fi -echo '#include ' > foo.cpp -# Fails for now -clang++-$VERSION --target=wasm32-wasi -o foo.o -c foo.cpp||true echo ' #include diff --git a/debian/rules b/debian/rules index cb05e356..184de30a 100755 --- a/debian/rules +++ b/debian/rules @@ -740,8 +740,89 @@ build-wasm/compiler-rt-%: -DCOMPILER_RT_OS_DIR=wasi ninja -C "$@" $(NJOBS) $(VERBOSE) +build-wasm/libcxx-%-wasi: cpu = $(@:build-wasm/libcxx-%-wasi=%) +build-wasm/libcxx-%-wasi: build-wasm/compiler-rt-% + @echo "Building libcxx for $(cpu)" + @echo "Using cmake: $(CMAKE_BIN)" + + # We need a functioning clang, which in turn requires a linker. We + # patch clang to use a versioned wasm-ld (cf. wasm-ld-path.diff), so + # create wasm-ld-$(LLVM_VERSION) in the stage2 bin dir manually. + cp $(STAGE_2_BIN_DIR)/wasm-ld $(STAGE_2_BIN_DIR)/wasm-ld-$(LLVM_VERSION) + + # We need a wasm compiler-rt. Depend on the make target that builds it, + # and manually copy it to the stage2 lib dir from there + mkdir -p \ + $(STAGE_2_LIB_DIR)/clang/$(LLVM_VERSION_FULL)/lib/wasi/ + cp build-wasm/compiler-rt-$(cpu)/lib/wasi/libclang_rt.builtins-$(cpu).a \ + $(STAGE_2_LIB_DIR)/clang/$(LLVM_VERSION_FULL)/lib/wasi/ + + # Notes: + # - Uses $(LDFLAGS) instead of $(STAGE_2_LDFLAGS), because wasm-ld does not + # support --build-id yet. Upstream is working on it, cf. D107662. + # - Pass -fno-stack-protector to disable -fstack-protector-strong that is + # passed by default, as this is not supported yet in WebAssembly, cf. + # https://github.com/WebAssembly/wasi-libc/issues/157 + # - Use llvm-ar and llvm-ranlib, as binutils does not currently support + # WebAssembly and creates invalid indexes. + # - Use LLVM_LIBDIR_SUFFIX to install to /usr/lib/wasm32-wasi. To be + # replaced by CMAKE_INSTALL_LIBDIR=lib/$(cpu)-wasi when D130586 + # ships. + mkdir -p "$@" + $(CMAKE_BIN) -B "$@" -S runtimes \ + -G $(GENERATOR) \ + $(SCCACHE_CMAKE) \ + -DCMAKE_C_COMPILER_WORKS=ON \ + -DCMAKE_CXX_COMPILER_WORKS=ON \ + -DLLVM_COMPILER_CHECKED=ON \ + -DCMAKE_C_COMPILER_TARGET=$(cpu)-unknown-wasi \ + -DCMAKE_CXX_COMPILER_TARGET=$(cpu)-unknown-wasi \ + -DCMAKE_ASM_COMPILER_TARGET=$(cpu)-unknown-wasi \ + -DCMAKE_C_COMPILER=$(STAGE_2_BIN_DIR)/clang \ + -DCMAKE_CXX_COMPILER=$(STAGE_2_BIN_DIR)/clang++ \ + -DCMAKE_AR=$(STAGE_2_BIN_DIR)/llvm-ar \ + -DCMAKE_RANLIB=$(STAGE_2_BIN_DIR)/llvm-ranlib \ + -DCMAKE_C_FLAGS="$(opt_flags) $(STAGE_2_CFLAGS) -fno-stack-protector" \ + -DCMAKE_CXX_FLAGS="$(opt_flags) $(STAGE_2_CXXFLAGS) -fno-stack-protector" \ + -DCMAKE_SHARED_LINKER_FLAGS="$(LDFLAGS) -L$(STAGE_2_LIB_DIR)" \ + -DCMAKE_MODULE_LINKER_FLAGS="$(LDFLAGS) -L$(STAGE_2_LIB_DIR)" \ + -DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS) -L$(STAGE_2_LIB_DIR)" \ + -DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-$(LLVM_VERSION) \ + -DCMAKE_INSTALL_INCLUDEDIR=include/$(cpu)-wasi \ + -DLLVM_LIBDIR_SUFFIX=/$(cpu)-wasi \ + -DLLVM_CONFIG=$(STAGE_2_BIN_DIR)/llvm-config \ + -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \ + -DLIBCXX_USE_COMPILER_RT=ON \ + -DLIBCXXABI_USE_COMPILER_RT=ON \ + -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \ + -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \ + -DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=OFF \ + -DCMAKE_BUILD_TYPE=RelWithDebugInfo \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DLIBCXX_ABI_VERSION=2 \ + -DLIBCXX_HAS_MUSL_LIBC:BOOL=ON \ + -DLIBCXX_ENABLE_SHARED:BOOL=OFF \ + -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY:BOOL=OFF \ + -DLIBCXX_ENABLE_EXCEPTIONS:BOOL=OFF \ + -DLIBCXX_ENABLE_FILESYSTEM:BOOL=OFF \ + -DLIBCXX_ENABLE_THREADS:BOOL=OFF \ + -DLIBCXX_HAS_PTHREAD_API:BOOL=OFF \ + -DLIBCXX_HAS_EXTERNAL_THREAD_API:BOOL=OFF \ + -DLIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY:BOOL=OFF \ + -DLIBCXXABI_ENABLE_SHARED:BOOL=OFF \ + -DLIBCXXABI_ENABLE_EXCEPTIONS:BOOL=OFF \ + -DLIBCXXABI_SILENT_TERMINATE:BOOL=ON \ + -DLIBCXXABI_ENABLE_THREADS:BOOL=OFF \ + -DLIBCXXABI_HAS_PTHREAD_API:BOOL=OFF \ + -DLIBCXXABI_HAS_EXTERNAL_THREAD_API:BOOL=OFF \ + -DLIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY:BOOL=OFF + ninja -C "$@" $(NJOBS) $(VERBOSE) + +# Build compiler-rt for wasm32 and wasm64. Build libcxx only for wasm32, as +# libcxx requires wasi-libc, which only exists for wasm32 right now. debian-wasm-build: \ build-wasm/compiler-rt-wasm32 \ + build-wasm/libcxx-wasm32-wasi \ build-wasm/compiler-rt-wasm64 touch $@ @@ -902,6 +983,7 @@ endif DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-wasm/compiler-rt-wasm32 install DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-wasm/compiler-rt-wasm64 install + DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-wasm/libcxx-wasm32-wasi install # Rename binaries mkdir -p $(DEB_INST)/usr/bin/ @@ -1055,7 +1137,7 @@ ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' bin else # GNU strip doesn't recognize WebAssembly binaries, and actually corrupts them. # llvm-strip (as of 15.0.2) fails with --strip-debug (but works with --strip-all) - dh_strip -a -v -Xlibclang_rt.builtins-wasm32.a -Xlibclang_rt.builtins-wasm64.a + dh_strip -a -v -Xlibclang_rt.builtins-wasm32.a -Xlibclang_rt.builtins-wasm64.a -Xusr/lib/wasm32-wasi endif override_dh_install: @@ -1085,6 +1167,13 @@ override_dh_installdeb: # Remove some libc++ abi files in the libc++ file. See bug #969274 rm -f $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/c++/__cxxabi_config.h $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/c++/cxxabi.h + + mkdir -p $(CURDIR)/debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1 + mv $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/__cxxabi_config.h \ + $(CURDIR)/debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/__cxxabi_config.h + mv $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/cxxabi.h \ + $(CURDIR)/debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/cxxabi.h + # Remove auto generated python pyc find $(CURDIR)/debian/llvm-$(LLVM_VERSION)-tools/usr/lib/llvm-$(LLVM_VERSION)/ -name '*.pyc' | xargs -r rm -f From c0beef7a9cc2cd5cc2808094ed54e0b4b6803d0c Mon Sep 17 00:00:00 2001 From: Faidon Liambotis Date: Fri, 18 Nov 2022 08:44:52 +0200 Subject: [PATCH 07/38] Add changelog entries for recent WebAssembly changes * More WebAssembly (wasm32/wasm64) work: - Update patch wasm-sysroot-usr to stop including /usr/include when building for the non-OS (unknown) wasm targets, to avoid inadvertently including the host's (glibc) headers. - Re-enable builds on all architectures, previously disabled for arm64 armel mips64el mipsel ppc64el armhf in 1:14.0.6-4, due to an FTBFS related to the /usr/include issue above. - Update patch wasm-sysroot-usr to adjust system include paths for C++ headers as well. - Build libc++ and libc++abi for wasm32-wasi, generating two new binary packages, and introducing a build dependency on wasi-libc. - Misc code organization fixes to debian/rules. --- debian/changelog | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/debian/changelog b/debian/changelog index 413272da..23dc3286 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +llvm-toolchain-14 (1:14.0.6-10) UNRELEASED; urgency=medium + + * More WebAssembly (wasm32/wasm64) work: + - Update patch wasm-sysroot-usr to stop including /usr/include when + building for the non-OS (unknown) wasm targets, to avoid inadvertently + including the host's (glibc) headers. + - Re-enable builds on all architectures, previously disabled for + arm64 armel mips64el mipsel ppc64el armhf in 1:14.0.6-4, due to an FTBFS + related to the /usr/include issue above. + - Update patch wasm-sysroot-usr to adjust system include paths for C++ + headers as well. + - Build libc++ and libc++abi for wasm32-wasi, generating two new binary + packages, and introducing a build dependency on wasi-libc. + - Misc code organization fixes to debian/rules. + + -- Faidon Liambotis Fri, 18 Nov 2022 08:21:02 +0200 + llvm-toolchain-14 (1:14.0.6-9) unstable; urgency=medium * Disable the MLIR testsuite run because of a freeze From 2b5443eadb2e845e42d276bd33dd77e1624e381c Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 19 Nov 2022 10:23:25 +0100 Subject: [PATCH 08/38] prepare upload --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 23dc3286..42560da0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -llvm-toolchain-14 (1:14.0.6-10) UNRELEASED; urgency=medium +llvm-toolchain-14 (1:14.0.6-10~exp1) experimental; urgency=medium * More WebAssembly (wasm32/wasm64) work: - Update patch wasm-sysroot-usr to stop including /usr/include when From 4134347b722fdfc044fef24693a5e1b931d8983c Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 19 Nov 2022 19:06:05 +0100 Subject: [PATCH 09/38] add the override --- debian/libc++-X.Y-dev-wasm32.lintian-overrides.in | 1 + debian/libc++abi-X.Y-dev-wasm32.lintian-overrides.in | 1 + 2 files changed, 2 insertions(+) create mode 100644 debian/libc++-X.Y-dev-wasm32.lintian-overrides.in create mode 100644 debian/libc++abi-X.Y-dev-wasm32.lintian-overrides.in diff --git a/debian/libc++-X.Y-dev-wasm32.lintian-overrides.in b/debian/libc++-X.Y-dev-wasm32.lintian-overrides.in new file mode 100644 index 00000000..4cad189a --- /dev/null +++ b/debian/libc++-X.Y-dev-wasm32.lintian-overrides.in @@ -0,0 +1 @@ +libc++-@LLVM_VERSION@-dev-wasm32: arch-independent-package-contains-binary-or-object usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++.a \ No newline at end of file diff --git a/debian/libc++abi-X.Y-dev-wasm32.lintian-overrides.in b/debian/libc++abi-X.Y-dev-wasm32.lintian-overrides.in new file mode 100644 index 00000000..76ba43d2 --- /dev/null +++ b/debian/libc++abi-X.Y-dev-wasm32.lintian-overrides.in @@ -0,0 +1 @@ +libc++abi-@LLVM_VERSION@-dev-wasm32: arch-independent-package-contains-binary-or-object usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++abi.a \ No newline at end of file From 1edb50d91c1e1c089f83ed8f544d5c2d20b217c2 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 20 Nov 2022 13:10:48 +0100 Subject: [PATCH 10/38] Replace '|| true' by '-' --- debian/changelog | 6 ++++++ debian/rules | 36 ++++++++++++++++++------------------ 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/debian/changelog b/debian/changelog index 42560da0..2b1d50e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-14 (1:14.0.6-10~exp2) UNRELEASED; urgency=medium + + * Replace '|| true' by '-' + + -- Sylvestre Ledru Sun, 20 Nov 2022 13:10:23 +0100 + llvm-toolchain-14 (1:14.0.6-10~exp1) experimental; urgency=medium * More WebAssembly (wasm32/wasm64) work: diff --git a/debian/rules b/debian/rules index 184de30a..fbd9018e 100755 --- a/debian/rules +++ b/debian/rules @@ -889,14 +889,14 @@ endif mkdir -p debian/man/ ls -al clang/tools/scan-view/bin/scan-view - clang/tools/scan-view/bin/scan-view --help || true - help2man --no-info --version-string=$(LLVM_VERSION) clang/tools/scan-view/bin/scan-view > debian/man/scan-view-$(LLVM_VERSION).1 || true - help2man --no-info --version-string=$(LLVM_VERSION) clang/tools/clang-format/clang-format-diff.py > debian/man/clang-format-diff-$(LLVM_VERSION).1 || true + -clang/tools/scan-view/bin/scan-view --help + -help2man --no-info --version-string=$(LLVM_VERSION) clang/tools/scan-view/bin/scan-view > debian/man/scan-view-$(LLVM_VERSION).1 + -help2man --no-info --version-string=$(LLVM_VERSION) clang/tools/clang-format/clang-format-diff.py > debian/man/clang-format-diff-$(LLVM_VERSION).1 CMDS="llvm-dwarfdump llvm-mc llvm-objdump llvm-rtdyld llvm-size llvm-ranlib lldb clang-format clang clang++ clang-tblgen clang-check clang-cpp clang-tidy clang-apply-replacements clang-rename clang-query pp-trace sancov lli modularize clang-include-fixer find-all-symbols clang-reorder-fields ld.lld llvm-tblgen clang-change-namespace clang-offload-bundler clangd clang-repl clang-nvlink-wrapper git-clang-format run-clang-tidy"; \ for f in $$CMDS; do \ echo "Generating manpage of $$f"; \ - LD_LIBRARY_PATH=$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/:/usr/lib/*/libfakeroot help2man --no-info --version-string=$(LLVM_VERSION) $(TARGET_BUILD_STAGE2)/bin/$$f > debian/man/$$f-$(LLVM_VERSION).1 || true; \ + -LD_LIBRARY_PATH=$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/:/usr/lib/*/libfakeroot help2man --no-info --version-string=$(LLVM_VERSION) $(TARGET_BUILD_STAGE2)/bin/$$f > debian/man/$$f-$(LLVM_VERSION).1; \ done if test "$(OPENMP_ENABLE)" = yes; then \ cd openmp/runtime && doxygen doc/doxygen/config; cd -; \ @@ -1125,15 +1125,15 @@ ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' bin if test ! -f $(CURDIR)/strip; then \ ln -s $(CURDIR)/debian/llvm-$(LLVM_VERSION)/usr/lib/llvm-$(LLVM_VERSION)/bin/llvm-strip $(CURDIR)/strip; \ fi - ls -al $(CURDIR)/debian/.debhelper/*/dbgsym-root/usr/lib/debug/.build-id/*/*|| true + -ls -al $(CURDIR)/debian/.debhelper/*/dbgsym-root/usr/lib/debug/.build-id/*/* : # On some old version of Debian (stretch) and Ubuntu, Rules-Requires-Root isn't supported : # Sometime, it fails because of chown: changing ownership of 'debian/.debhelper/clang-7/dbgsym-root/usr/lib/debug/.build-id/37/ba506ae9d2f82219bf5c552f7c09853052b2b0.debug': Operation not permitted : # Therefore, continue when we encounter an error - PATH=$(CURDIR)/:$$PATH LD_LIBRARY_PATH=$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/:/usr/lib/*/libfakeroot dh_strip -a -v || true + -PATH=$(CURDIR)/:$$PATH LD_LIBRARY_PATH=$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/:/usr/lib/*/libfakeroot dh_strip -a -v : # Remove the workaround rm $(CURDIR)/strip : # for some reasons, the +x might be removed - chmod -f +x $(CURDIR)/debian/*/usr/lib/llvm-$(LLVM_VERSION)/bin/* || true + -chmod -f +x $(CURDIR)/debian/*/usr/lib/llvm-$(LLVM_VERSION)/bin/* else # GNU strip doesn't recognize WebAssembly binaries, and actually corrupts them. # llvm-strip (as of 15.0.2) fails with --strip-debug (but works with --strip-all) @@ -1188,38 +1188,38 @@ ifneq (,$(findstring $(DEB_HOST_ARCH),$(ARCH_LLVM_TEST_OK))) # logs the output to check-llvm_build_log.txt for validation through autopkgtest ninja $(VERBOSE) -C $(TARGET_BUILD) stage2-check-llvm | tee check-llvm_build_log.txt else - ninja $(VERBOSE) -C $(TARGET_BUILD) stage2-check-llvm || true + -ninja $(VERBOSE) -C $(TARGET_BUILD) stage2-check-llvm endif # Clang tests - ninja $(VERBOSE) -C $(TARGET_BUILD) stage2-check-clang || true + -ninja $(VERBOSE) -C $(TARGET_BUILD) stage2-check-clang # Clang extra tests (ex: clang-tidy) - ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-clang-tools || true + -ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-clang-tools # LLD tests ifeq (${LLD_ENABLE},yes) - ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-lld || true + -ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-lld endif # Sanitizer - ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-sanitizer || true + -ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-sanitizer # Libcxx - ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-libcxx || true + -ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-libcxx # Libcxxabi - ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-libcxxabi || true + -ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-libcxxabi # MLIR ifeq (,$(filter $(DEB_HOST_ARCH), i386 x32)) # Do not run MLIR test on i386 because of # https://github.com/llvm/llvm-project/issues/58357 - ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-mlir || true + -ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-mlir endif # Libclc - ninja $(VERBOSE) -C libclc/build test || true + -ninja $(VERBOSE) -C libclc/build test # LLDB tests ifeq (,$(filter $(DEB_HOST_ARCH), $(LLDB_DISABLE_ARCHS) armhf armel)) @@ -1230,7 +1230,7 @@ ifneq (,$(filter codecoverage,$(DEB_BUILD_OPTIONS))) ln -s lldb/_lldb.so; \ fi if test "$(CODECOVERAGE)" = "no"; then \ - LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(CURDIR)/$(TARGET_BUILD)/lib/ ninja $(VERBOSE) -C $(TARGET_BUILD) check-lldb || true; \ + -LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(CURDIR)/$(TARGET_BUILD)/lib/ ninja $(VERBOSE) -C $(TARGET_BUILD) check-lldb; \ fi # remove the workaround rm $(CURDIR)/$(TARGET_BUILD)/lib/python*/*-packages/_lldb.so @@ -1239,7 +1239,7 @@ endif # Polly tests #ifeq (${POLLY_ENABLE},yes) -# ninja -C $(TARGET_BUILD) check-polly || true +# -ninja -C $(TARGET_BUILD) check-polly #endif # Managed by debian build system From 998f20ed5f76cedcff5145f8dcb1991a02022486 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 20 Nov 2022 18:19:12 +0100 Subject: [PATCH 11/38] Revert "Replace '|| true' by '-'" This reverts commit 1edb50d91c1e1c089f83ed8f544d5c2d20b217c2. --- debian/changelog | 6 ------ debian/rules | 36 ++++++++++++++++++------------------ 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2b1d50e0..42560da0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,3 @@ -llvm-toolchain-14 (1:14.0.6-10~exp2) UNRELEASED; urgency=medium - - * Replace '|| true' by '-' - - -- Sylvestre Ledru Sun, 20 Nov 2022 13:10:23 +0100 - llvm-toolchain-14 (1:14.0.6-10~exp1) experimental; urgency=medium * More WebAssembly (wasm32/wasm64) work: diff --git a/debian/rules b/debian/rules index fbd9018e..184de30a 100755 --- a/debian/rules +++ b/debian/rules @@ -889,14 +889,14 @@ endif mkdir -p debian/man/ ls -al clang/tools/scan-view/bin/scan-view - -clang/tools/scan-view/bin/scan-view --help - -help2man --no-info --version-string=$(LLVM_VERSION) clang/tools/scan-view/bin/scan-view > debian/man/scan-view-$(LLVM_VERSION).1 - -help2man --no-info --version-string=$(LLVM_VERSION) clang/tools/clang-format/clang-format-diff.py > debian/man/clang-format-diff-$(LLVM_VERSION).1 + clang/tools/scan-view/bin/scan-view --help || true + help2man --no-info --version-string=$(LLVM_VERSION) clang/tools/scan-view/bin/scan-view > debian/man/scan-view-$(LLVM_VERSION).1 || true + help2man --no-info --version-string=$(LLVM_VERSION) clang/tools/clang-format/clang-format-diff.py > debian/man/clang-format-diff-$(LLVM_VERSION).1 || true CMDS="llvm-dwarfdump llvm-mc llvm-objdump llvm-rtdyld llvm-size llvm-ranlib lldb clang-format clang clang++ clang-tblgen clang-check clang-cpp clang-tidy clang-apply-replacements clang-rename clang-query pp-trace sancov lli modularize clang-include-fixer find-all-symbols clang-reorder-fields ld.lld llvm-tblgen clang-change-namespace clang-offload-bundler clangd clang-repl clang-nvlink-wrapper git-clang-format run-clang-tidy"; \ for f in $$CMDS; do \ echo "Generating manpage of $$f"; \ - -LD_LIBRARY_PATH=$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/:/usr/lib/*/libfakeroot help2man --no-info --version-string=$(LLVM_VERSION) $(TARGET_BUILD_STAGE2)/bin/$$f > debian/man/$$f-$(LLVM_VERSION).1; \ + LD_LIBRARY_PATH=$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/:/usr/lib/*/libfakeroot help2man --no-info --version-string=$(LLVM_VERSION) $(TARGET_BUILD_STAGE2)/bin/$$f > debian/man/$$f-$(LLVM_VERSION).1 || true; \ done if test "$(OPENMP_ENABLE)" = yes; then \ cd openmp/runtime && doxygen doc/doxygen/config; cd -; \ @@ -1125,15 +1125,15 @@ ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' bin if test ! -f $(CURDIR)/strip; then \ ln -s $(CURDIR)/debian/llvm-$(LLVM_VERSION)/usr/lib/llvm-$(LLVM_VERSION)/bin/llvm-strip $(CURDIR)/strip; \ fi - -ls -al $(CURDIR)/debian/.debhelper/*/dbgsym-root/usr/lib/debug/.build-id/*/* + ls -al $(CURDIR)/debian/.debhelper/*/dbgsym-root/usr/lib/debug/.build-id/*/*|| true : # On some old version of Debian (stretch) and Ubuntu, Rules-Requires-Root isn't supported : # Sometime, it fails because of chown: changing ownership of 'debian/.debhelper/clang-7/dbgsym-root/usr/lib/debug/.build-id/37/ba506ae9d2f82219bf5c552f7c09853052b2b0.debug': Operation not permitted : # Therefore, continue when we encounter an error - -PATH=$(CURDIR)/:$$PATH LD_LIBRARY_PATH=$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/:/usr/lib/*/libfakeroot dh_strip -a -v + PATH=$(CURDIR)/:$$PATH LD_LIBRARY_PATH=$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/:/usr/lib/*/libfakeroot dh_strip -a -v || true : # Remove the workaround rm $(CURDIR)/strip : # for some reasons, the +x might be removed - -chmod -f +x $(CURDIR)/debian/*/usr/lib/llvm-$(LLVM_VERSION)/bin/* + chmod -f +x $(CURDIR)/debian/*/usr/lib/llvm-$(LLVM_VERSION)/bin/* || true else # GNU strip doesn't recognize WebAssembly binaries, and actually corrupts them. # llvm-strip (as of 15.0.2) fails with --strip-debug (but works with --strip-all) @@ -1188,38 +1188,38 @@ ifneq (,$(findstring $(DEB_HOST_ARCH),$(ARCH_LLVM_TEST_OK))) # logs the output to check-llvm_build_log.txt for validation through autopkgtest ninja $(VERBOSE) -C $(TARGET_BUILD) stage2-check-llvm | tee check-llvm_build_log.txt else - -ninja $(VERBOSE) -C $(TARGET_BUILD) stage2-check-llvm + ninja $(VERBOSE) -C $(TARGET_BUILD) stage2-check-llvm || true endif # Clang tests - -ninja $(VERBOSE) -C $(TARGET_BUILD) stage2-check-clang + ninja $(VERBOSE) -C $(TARGET_BUILD) stage2-check-clang || true # Clang extra tests (ex: clang-tidy) - -ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-clang-tools + ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-clang-tools || true # LLD tests ifeq (${LLD_ENABLE},yes) - -ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-lld + ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-lld || true endif # Sanitizer - -ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-sanitizer + ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-sanitizer || true # Libcxx - -ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-libcxx + ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-libcxx || true # Libcxxabi - -ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-libcxxabi + ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-libcxxabi || true # MLIR ifeq (,$(filter $(DEB_HOST_ARCH), i386 x32)) # Do not run MLIR test on i386 because of # https://github.com/llvm/llvm-project/issues/58357 - -ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-mlir + ninja $(VERBOSE) -C $(TARGET_BUILD_STAGE2) check-mlir || true endif # Libclc - -ninja $(VERBOSE) -C libclc/build test + ninja $(VERBOSE) -C libclc/build test || true # LLDB tests ifeq (,$(filter $(DEB_HOST_ARCH), $(LLDB_DISABLE_ARCHS) armhf armel)) @@ -1230,7 +1230,7 @@ ifneq (,$(filter codecoverage,$(DEB_BUILD_OPTIONS))) ln -s lldb/_lldb.so; \ fi if test "$(CODECOVERAGE)" = "no"; then \ - -LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(CURDIR)/$(TARGET_BUILD)/lib/ ninja $(VERBOSE) -C $(TARGET_BUILD) check-lldb; \ + LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(CURDIR)/$(TARGET_BUILD)/lib/ ninja $(VERBOSE) -C $(TARGET_BUILD) check-lldb || true; \ fi # remove the workaround rm $(CURDIR)/$(TARGET_BUILD)/lib/python*/*-packages/_lldb.so @@ -1239,7 +1239,7 @@ endif # Polly tests #ifeq (${POLLY_ENABLE},yes) -# -ninja -C $(TARGET_BUILD) check-polly +# ninja -C $(TARGET_BUILD) check-polly || true #endif # Managed by debian build system From ba4fb0b8e5617d822132bb8e1efe12625c87fb90 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Sun, 4 Dec 2022 09:08:45 +0100 Subject: [PATCH 12/38] Upload 1:14.0.6-9 to sid, fixing the various RC bugs --- debian/changelog | 29 ++-- debian/control | 43 ----- debian/libc++-X.Y-dev-wasm32.install.in | 3 - debian/libc++-X.Y-dev-wasm32.links.in | 2 - ...libc++-X.Y-dev-wasm32.lintian-overrides.in | 1 - debian/libc++abi-X.Y-dev-wasm32.install.in | 1 - debian/libc++abi-X.Y-dev-wasm32.links.in | 1 - ...c++abi-X.Y-dev-wasm32.lintian-overrides.in | 1 - debian/patches/basic_string.patch | 87 ++++++++++ debian/patches/series | 1 + debian/patches/wasm/wasm-sysroot-usr.diff | 39 +---- debian/qualify-clang.sh | 26 +-- debian/rules | 154 ++++-------------- 13 files changed, 142 insertions(+), 246 deletions(-) delete mode 100644 debian/libc++-X.Y-dev-wasm32.install.in delete mode 100644 debian/libc++-X.Y-dev-wasm32.links.in delete mode 100644 debian/libc++-X.Y-dev-wasm32.lintian-overrides.in delete mode 100644 debian/libc++abi-X.Y-dev-wasm32.install.in delete mode 100644 debian/libc++abi-X.Y-dev-wasm32.links.in delete mode 100644 debian/libc++abi-X.Y-dev-wasm32.lintian-overrides.in create mode 100644 debian/patches/basic_string.patch diff --git a/debian/changelog b/debian/changelog index 42560da0..1d9830da 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,27 +1,13 @@ -llvm-toolchain-14 (1:14.0.6-10~exp1) experimental; urgency=medium - - * More WebAssembly (wasm32/wasm64) work: - - Update patch wasm-sysroot-usr to stop including /usr/include when - building for the non-OS (unknown) wasm targets, to avoid inadvertently - including the host's (glibc) headers. - - Re-enable builds on all architectures, previously disabled for - arm64 armel mips64el mipsel ppc64el armhf in 1:14.0.6-4, due to an FTBFS - related to the /usr/include issue above. - - Update patch wasm-sysroot-usr to adjust system include paths for C++ - headers as well. - - Build libc++ and libc++abi for wasm32-wasi, generating two new binary - packages, and introducing a build dependency on wasi-libc. - - Misc code organization fixes to debian/rules. - - -- Faidon Liambotis Fri, 18 Nov 2022 08:21:02 +0200 - llvm-toolchain-14 (1:14.0.6-9) unstable; urgency=medium + * Cherry-pick upstream commit c081bf4098c729afacf20303cc9df62bf13c3362 + to fix chromium failure in basic_string (Closes: #1025394) * Disable the MLIR testsuite run because of a freeze (Closes: #1024154) See https://github.com/llvm/llvm-project/issues/58357 + * Disable wasm on riscv64 - -- Sylvestre Ledru Tue, 15 Nov 2022 18:23:44 +0100 + -- Gianfranco Costamagna Sun, 04 Dec 2022 09:03:06 +0100 llvm-toolchain-14 (1:14.0.6-8) unstable; urgency=medium @@ -1873,6 +1859,13 @@ llvm-toolchain-snapshot (1:11~++20200621103028+10b0539772d-1~exp1) UNRELEASED; u * Upstream change ad97ccf6b26a29262c9cbf5b3e7f6e84c6dcf55f broke clangd-atomic-cmake.patch causing some undef symbol on i386 and atomic + * experimental New snapshot release + * experimental New snapshot release + * experimental New snapshot release + * experimental New snapshot release + * experimental New snapshot release + * experimental New snapshot release + * experimental New snapshot release -- Sylvestre Ledru Sun, 21 Jun 2020 10:33:23 +0200 diff --git a/debian/control b/debian/control index 9883345b..58f91da2 100644 --- a/debian/control +++ b/debian/control @@ -24,7 +24,6 @@ Build-Depends: debhelper (>= 10.0), cmake, ninja-build, libpfm4-dev [linux-any], python3-setuptools, libz3-dev, llvm-spirv-14 [ amd64 arm64 armel armhf mips64el mipsel ppc64el s390x ] | hello [!i386], spirv-tools [ linux-any ] | hello [ !i386], - wasi-libc, libcurl4-dev, libgrpc++-dev [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x], protobuf-compiler-grpc [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x], @@ -649,29 +648,6 @@ Description: LLVM C++ Standard library (development files) as exception objects, rtti and memory allocation. * Extensive unit tests. -Package: libc++-14-dev-wasm32 -Section: libdevel -Architecture: all -Multi-Arch: foreign -Depends: wasi-libc, libc++abi-14-dev-wasm32, ${misc:Depends} -Provides: libc++-x.y-dev-wasm32 -Conflicts: libc++-x.y-dev-wasm32 -Replaces: libc++-x.y-dev-wasm32 -Description: LLVM C++ Standard library (WASI) - libc++ is another implementation of the C++ standard library - . - Features and Goals - . - * Correctness as defined by the C++ standards. - * Fast execution. - * Minimal memory use. - * Fast compile times. - * ABI compatibility with gcc's libstdc++ for some low-level features such - as exception objects, rtti and memory allocation. - * Extensive unit tests. - . - This package provides a version for the 32-bit WebAssembly System Interface. - # ------------- libcxxabi ------------- Package: libc++abi1-14 @@ -711,25 +687,6 @@ Description: LLVM low level support for a standard C++ library (development file * Correctness as defined by the C++ standards. * Provide a portable sublayer to ease the porting of libc++ -Package: libc++abi-14-dev-wasm32 -Section: libdevel -Architecture: all -Multi-Arch: foreign -Depends: wasi-libc, ${misc:Depends} -Provides: libc++abi-x.y-dev-wasm32 -Conflicts: libc++abi-x.y-dev-wasm32 -Replaces: libc++abi-x.y-dev-wasm32 -Description: LLVM low level support for a standard C++ library (WASI) - libc++abi is another implementation of low level support for a standard C++ - library. - . - Features and Goals - . - * Correctness as defined by the C++ standards. - * Provide a portable sublayer to ease the porting of libc++ - . - This package provides a version for the 32-bit WebAssembly System Interface. - # ------------- libclc ------------- Package: libclc-14 diff --git a/debian/libc++-X.Y-dev-wasm32.install.in b/debian/libc++-X.Y-dev-wasm32.install.in deleted file mode 100644 index 13c31f09..00000000 --- a/debian/libc++-X.Y-dev-wasm32.install.in +++ /dev/null @@ -1,3 +0,0 @@ -usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++.a -usr/lib/llvm-@LLVM_VERSION@/include/wasm32-wasi/c++/ -usr/lib/llvm-@LLVM_VERSION@/include/wasm32-wasi/c++/v1/ diff --git a/debian/libc++-X.Y-dev-wasm32.links.in b/debian/libc++-X.Y-dev-wasm32.links.in deleted file mode 100644 index 465536e9..00000000 --- a/debian/libc++-X.Y-dev-wasm32.links.in +++ /dev/null @@ -1,2 +0,0 @@ -usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++.a /usr/lib/wasm32-wasi/libc++.a -usr/lib/llvm-@LLVM_VERSION@/include/wasm32-wasi/c++/v1 /usr/include/wasm32-wasi/c++/v1 diff --git a/debian/libc++-X.Y-dev-wasm32.lintian-overrides.in b/debian/libc++-X.Y-dev-wasm32.lintian-overrides.in deleted file mode 100644 index 4cad189a..00000000 --- a/debian/libc++-X.Y-dev-wasm32.lintian-overrides.in +++ /dev/null @@ -1 +0,0 @@ -libc++-@LLVM_VERSION@-dev-wasm32: arch-independent-package-contains-binary-or-object usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++.a \ No newline at end of file diff --git a/debian/libc++abi-X.Y-dev-wasm32.install.in b/debian/libc++abi-X.Y-dev-wasm32.install.in deleted file mode 100644 index 1d6e8500..00000000 --- a/debian/libc++abi-X.Y-dev-wasm32.install.in +++ /dev/null @@ -1 +0,0 @@ -usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++abi.a diff --git a/debian/libc++abi-X.Y-dev-wasm32.links.in b/debian/libc++abi-X.Y-dev-wasm32.links.in deleted file mode 100644 index c1655fbf..00000000 --- a/debian/libc++abi-X.Y-dev-wasm32.links.in +++ /dev/null @@ -1 +0,0 @@ -usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++abi.a /usr/lib/wasm32-wasi/libc++abi.a diff --git a/debian/libc++abi-X.Y-dev-wasm32.lintian-overrides.in b/debian/libc++abi-X.Y-dev-wasm32.lintian-overrides.in deleted file mode 100644 index 76ba43d2..00000000 --- a/debian/libc++abi-X.Y-dev-wasm32.lintian-overrides.in +++ /dev/null @@ -1 +0,0 @@ -libc++abi-@LLVM_VERSION@-dev-wasm32: arch-independent-package-contains-binary-or-object usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++abi.a \ No newline at end of file diff --git a/debian/patches/basic_string.patch b/debian/patches/basic_string.patch new file mode 100644 index 00000000..ceefe082 --- /dev/null +++ b/debian/patches/basic_string.patch @@ -0,0 +1,87 @@ +From c081bf4098c729afacf20303cc9df62bf13c3362 Mon Sep 17 00:00:00 2001 +From: serge-sans-paille +Date: Sat, 18 Jun 2022 13:48:41 +0200 +Subject: [PATCH] [clang] Enforce instantiation of constexpr template functions + during non-constexpr evaluation + +Otherwise these functions are not instantiated and we end up with an undefined +symbol. + +Fix #55560 + +Differential Revision: https://reviews.llvm.org/D128119 +--- + clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 5 +++-- + .../CodeGenCXX/constexpr-late-instantiation.cpp | 17 +++++++++++++++++ + .../SemaCXX/constexpr-late-instantiation.cpp | 15 +++++++++++++++ + 3 files changed, 35 insertions(+), 2 deletions(-) + create mode 100644 clang/test/CodeGenCXX/constexpr-late-instantiation.cpp + create mode 100644 clang/test/SemaCXX/constexpr-late-instantiation.cpp + +diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +index 467372c71496a..293782822e839 100644 +--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp ++++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +@@ -4826,7 +4826,8 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, + /*Complain*/DefinitionRequired)) { + if (DefinitionRequired) + Function->setInvalidDecl(); +- else if (TSK == TSK_ExplicitInstantiationDefinition) { ++ else if (TSK == TSK_ExplicitInstantiationDefinition || ++ (Function->isConstexpr() && !Recursive)) { + // Try again at the end of the translation unit (at which point a + // definition will be required). + assert(!Recursive); +@@ -4841,7 +4842,7 @@ void Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, + Diag(PatternDecl->getLocation(), diag::note_forward_template_decl); + if (getLangOpts().CPlusPlus11) + Diag(PointOfInstantiation, diag::note_inst_declaration_hint) +- << Function; ++ << Function; + } + } + +diff --git a/clang/test/CodeGenCXX/constexpr-late-instantiation.cpp b/clang/test/CodeGenCXX/constexpr-late-instantiation.cpp +new file mode 100644 +index 0000000000000..1c8eef73f2dda +--- /dev/null ++++ b/clang/test/CodeGenCXX/constexpr-late-instantiation.cpp +@@ -0,0 +1,17 @@ ++// Make sure foo is instantiated and we don't get a link error ++// RUN: %clang_cc1 -S -emit-llvm -triple %itanium_abi_triple %s -o- | FileCheck %s ++ ++template ++constexpr T foo(T a); ++ ++// CHECK-LABEL: define {{.*}} @main ++int main() { ++ // CHECK: call {{.*}} @_Z3fooIiET_S0_ ++ int k = foo(5); ++} ++// CHECK: } ++ ++template ++constexpr T foo(T a) { ++ return a; ++} +diff --git a/clang/test/SemaCXX/constexpr-late-instantiation.cpp b/clang/test/SemaCXX/constexpr-late-instantiation.cpp +new file mode 100644 +index 0000000000000..ec8e071217c1d +--- /dev/null ++++ b/clang/test/SemaCXX/constexpr-late-instantiation.cpp +@@ -0,0 +1,15 @@ ++// RUN: %clang_cc1 %s -fsyntax-only -verify ++ ++template ++constexpr T foo(T a); // expected-note {{declared here}} ++ ++int main() { ++ int k = foo(5); // Ok ++ constexpr int j = // expected-error {{constexpr variable 'j' must be initialized by a constant expression}} ++ foo(5); // expected-note {{undefined function 'foo' cannot be used in a constant expression}} ++} ++ ++template ++constexpr T foo(T a) { ++ return a; ++} diff --git a/debian/patches/series b/debian/patches/series index b3563d78..69b91812 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -160,3 +160,4 @@ fix-typo-1018770.diff lldb/lldb-swig.diff lldb/lldb-swig-2.diff protobuf_3.21.patch +basic_string.patch diff --git a/debian/patches/wasm/wasm-sysroot-usr.diff b/debian/patches/wasm/wasm-sysroot-usr.diff index 0d884214..f24ec1fc 100644 --- a/debian/patches/wasm/wasm-sysroot-usr.diff +++ b/debian/patches/wasm/wasm-sysroot-usr.diff @@ -27,54 +27,21 @@ Index: llvm-toolchain-14-14.0.6/clang/lib/Driver/ToolChains/WebAssembly.cpp if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) { SmallString<128> P(D.ResourceDir); -@@ -419,27 +421,39 @@ void WebAssembly::AddClangSystemIncludeA - return; - } +@@ -421,10 +423,10 @@ void WebAssembly::AddClangSystemIncludeA -+ // add the multiarch path on e.g. wasm32-wasi if (getTriple().getOS() != llvm::Triple::UnknownOS) { const std::string MultiarchTriple = - getMultiarchTriple(D, getTriple(), D.SysRoot); - addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/include/" + MultiarchTriple); + getMultiarchTriple(D, getTriple(), SysRoot); -+ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/local/include/" + MultiarchTriple); -+ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/local/include"); + addSystemInclude(DriverArgs, CC1Args, SysRoot + "/include/" + MultiarchTriple); } - addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/include"); -+ -+ // also add the non-multiarch path, only on a known OS (as above), or when -+ // a sysroot is given, for backwards compatibility with the original driver -+ if (getTriple().getOS() != llvm::Triple::UnknownOS || -+ !getDriver().SysRoot.empty()) -+ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/include"); ++ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/include"); } void WebAssembly::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs, - ArgStringList &CC1Args) const { -+ std::string SysRoot = computeSysRoot(); -+ - if (!DriverArgs.hasArg(options::OPT_nostdlibinc) && - !DriverArgs.hasArg(options::OPT_nostdincxx)) { - if (getTriple().getOS() != llvm::Triple::UnknownOS) { - const std::string MultiarchTriple = -- getMultiarchTriple(getDriver(), getTriple(), getDriver().SysRoot); -+ getMultiarchTriple(getDriver(), getTriple(), SysRoot); - addSystemInclude(DriverArgs, CC1Args, -- getDriver().SysRoot + "/include/" + MultiarchTriple + -+ SysRoot + "/include/" + MultiarchTriple + - "/c++/v1"); - } -- addSystemInclude(DriverArgs, CC1Args, -- getDriver().SysRoot + "/include/c++/v1"); -+ -+ // don't include the host architecture's headers in the search path -+ if (!getDriver().SysRoot.empty()) -+ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/include/c++/v1"); - } - } - -@@ -467,3 +481,15 @@ SanitizerMask WebAssembly::getSupportedS +@@ -467,3 +469,15 @@ SanitizerMask WebAssembly::getSupportedS Tool *WebAssembly::buildLinker() const { return new tools::wasm::Linker(*this); } diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 385cf5a7..dfda6e44 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -1361,34 +1361,22 @@ fi if dpkg -l|grep -q wasi-libc; then cat < printf.c #include - int main(int argc, char *argv[]) { - printf("%s\n", "Hello World!"); + int main(int argc, char *argv[]) + { + printf("%s\n", "Hello world!"); } EOF - # wasi-libc supports only wasm32 right now - clang-$VERSION -target wasm32-wasi -o printf printf.c + clang-$VERSION -target wasm32-unknown-wasi -o printf printf.c file printf &> foo.log if ! grep -q "WebAssembly" foo.log; then echo "the generated file isn't a WebAssembly file?" exit 1 fi rm -f printf.c printf - - cat < cout.cpp - #include - int main() { - std::cout << "Hello World!" << std::endl; - } -EOF - # libcxx requires wasi-libc, which only exists for wasm32 right now - clang++-$VERSION --target=wasm32-wasi -o cout cout.cpp - file cout &> foo.log - if ! grep -q "WebAssembly" foo.log; then - echo "the generated file isn't a WebAssembly file?" - exit 1 - fi - rm -f cout.cpp cout fi +echo '#include ' > foo.cpp +# Fails for now +clang++-$VERSION --target=wasm32-wasi -o foo.o -c foo.cpp||true echo ' #include diff --git a/debian/rules b/debian/rules index 184de30a..41309bc2 100755 --- a/debian/rules +++ b/debian/rules @@ -302,6 +302,12 @@ ifeq ($(LIBUNWIND_ENABLE),yes) endif endif +COMPILER_RT_WASM_ENABLE=yes + +ifneq (,$(filter $(DEB_HOST_ARCH), arm64 armel mips64el mipsel ppc64el armhf riscv64)) + COMPILER_RT_WASM_ENABLE=no +endif + # Do not install objects STAGE_ALL_CMAKE_EXTRA += -DMLIR_INSTALL_AGGREGATE_OBJECTS=OFF @@ -709,17 +715,17 @@ debian-libclc-build: ninja $(NJOBS) $(VERBOSE) touch $@ -build-wasm/compiler-rt-%: cpu = $(@:build-wasm/compiler-rt-%=%) -build-wasm/compiler-rt-%: - @echo "Building compiler-rt for $(cpu)" - @echo "Using cmake: $(CMAKE_BIN)" - mkdir -p "$@" - $(CMAKE_BIN) -B "$@" -S compiler-rt/lib/builtins/ \ +debian-rtlib-wasm-build: +ifeq (${COMPILER_RT_WASM_ENABLE},yes) + echo "Using cmake: $(CMAKE_BIN)" + for build in wasm32 wasm64; do \ + mkdir -p build-compiler-rt-$$build; \ + $(CMAKE_BIN) -B build-compiler-rt-$$build -S compiler-rt/lib/builtins/ \ -G Ninja \ $(SCCACHE_CMAKE) \ - -DCMAKE_C_COMPILER_TARGET=$(cpu)-unknown-unknown \ - -DCMAKE_CXX_COMPILER_TARGET=$(cpu)-unknown-unknown \ - -DCMAKE_ASM_COMPILER_TARGET=$(cpu)-unknown-unknown \ + -DCMAKE_C_COMPILER_TARGET=$$build-unknown-unknown \ + -DCMAKE_CXX_COMPILER_TARGET=$$build-unknown-unknown \ + -DCMAKE_ASM_COMPILER_TARGET=$$build-unknown-unknown \ -DCMAKE_C_COMPILER=$(STAGE_2_BIN_DIR)/clang \ -DCMAKE_CXX_COMPILER=$(STAGE_2_BIN_DIR)/clang++ \ -DCMAKE_C_FLAGS="$(opt_flags) $(STAGE_2_CFLAGS)" \ @@ -736,112 +742,25 @@ build-wasm/compiler-rt-%: -DCOMPILER_RT_INCLUDE_TESTS=OFF \ -DCOMPILER_RT_USE_LIBCXX=OFF \ -DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON \ - -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=$(cpu)-unknown-unknown \ - -DCOMPILER_RT_OS_DIR=wasi - ninja -C "$@" $(NJOBS) $(VERBOSE) - -build-wasm/libcxx-%-wasi: cpu = $(@:build-wasm/libcxx-%-wasi=%) -build-wasm/libcxx-%-wasi: build-wasm/compiler-rt-% - @echo "Building libcxx for $(cpu)" - @echo "Using cmake: $(CMAKE_BIN)" - - # We need a functioning clang, which in turn requires a linker. We - # patch clang to use a versioned wasm-ld (cf. wasm-ld-path.diff), so - # create wasm-ld-$(LLVM_VERSION) in the stage2 bin dir manually. - cp $(STAGE_2_BIN_DIR)/wasm-ld $(STAGE_2_BIN_DIR)/wasm-ld-$(LLVM_VERSION) - - # We need a wasm compiler-rt. Depend on the make target that builds it, - # and manually copy it to the stage2 lib dir from there - mkdir -p \ - $(STAGE_2_LIB_DIR)/clang/$(LLVM_VERSION_FULL)/lib/wasi/ - cp build-wasm/compiler-rt-$(cpu)/lib/wasi/libclang_rt.builtins-$(cpu).a \ - $(STAGE_2_LIB_DIR)/clang/$(LLVM_VERSION_FULL)/lib/wasi/ - - # Notes: - # - Uses $(LDFLAGS) instead of $(STAGE_2_LDFLAGS), because wasm-ld does not - # support --build-id yet. Upstream is working on it, cf. D107662. - # - Pass -fno-stack-protector to disable -fstack-protector-strong that is - # passed by default, as this is not supported yet in WebAssembly, cf. - # https://github.com/WebAssembly/wasi-libc/issues/157 - # - Use llvm-ar and llvm-ranlib, as binutils does not currently support - # WebAssembly and creates invalid indexes. - # - Use LLVM_LIBDIR_SUFFIX to install to /usr/lib/wasm32-wasi. To be - # replaced by CMAKE_INSTALL_LIBDIR=lib/$(cpu)-wasi when D130586 - # ships. - mkdir -p "$@" - $(CMAKE_BIN) -B "$@" -S runtimes \ - -G $(GENERATOR) \ - $(SCCACHE_CMAKE) \ - -DCMAKE_C_COMPILER_WORKS=ON \ - -DCMAKE_CXX_COMPILER_WORKS=ON \ - -DLLVM_COMPILER_CHECKED=ON \ - -DCMAKE_C_COMPILER_TARGET=$(cpu)-unknown-wasi \ - -DCMAKE_CXX_COMPILER_TARGET=$(cpu)-unknown-wasi \ - -DCMAKE_ASM_COMPILER_TARGET=$(cpu)-unknown-wasi \ - -DCMAKE_C_COMPILER=$(STAGE_2_BIN_DIR)/clang \ - -DCMAKE_CXX_COMPILER=$(STAGE_2_BIN_DIR)/clang++ \ - -DCMAKE_AR=$(STAGE_2_BIN_DIR)/llvm-ar \ - -DCMAKE_RANLIB=$(STAGE_2_BIN_DIR)/llvm-ranlib \ - -DCMAKE_C_FLAGS="$(opt_flags) $(STAGE_2_CFLAGS) -fno-stack-protector" \ - -DCMAKE_CXX_FLAGS="$(opt_flags) $(STAGE_2_CXXFLAGS) -fno-stack-protector" \ - -DCMAKE_SHARED_LINKER_FLAGS="$(LDFLAGS) -L$(STAGE_2_LIB_DIR)" \ - -DCMAKE_MODULE_LINKER_FLAGS="$(LDFLAGS) -L$(STAGE_2_LIB_DIR)" \ - -DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS) -L$(STAGE_2_LIB_DIR)" \ - -DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-$(LLVM_VERSION) \ - -DCMAKE_INSTALL_INCLUDEDIR=include/$(cpu)-wasi \ - -DLLVM_LIBDIR_SUFFIX=/$(cpu)-wasi \ - -DLLVM_CONFIG=$(STAGE_2_BIN_DIR)/llvm-config \ - -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \ - -DLIBCXX_USE_COMPILER_RT=ON \ - -DLIBCXXABI_USE_COMPILER_RT=ON \ - -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \ - -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \ - -DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=OFF \ - -DCMAKE_BUILD_TYPE=RelWithDebugInfo \ - -DLIBCXX_CXX_ABI=libcxxabi \ - -DLIBCXX_ABI_VERSION=2 \ - -DLIBCXX_HAS_MUSL_LIBC:BOOL=ON \ - -DLIBCXX_ENABLE_SHARED:BOOL=OFF \ - -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY:BOOL=OFF \ - -DLIBCXX_ENABLE_EXCEPTIONS:BOOL=OFF \ - -DLIBCXX_ENABLE_FILESYSTEM:BOOL=OFF \ - -DLIBCXX_ENABLE_THREADS:BOOL=OFF \ - -DLIBCXX_HAS_PTHREAD_API:BOOL=OFF \ - -DLIBCXX_HAS_EXTERNAL_THREAD_API:BOOL=OFF \ - -DLIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY:BOOL=OFF \ - -DLIBCXXABI_ENABLE_SHARED:BOOL=OFF \ - -DLIBCXXABI_ENABLE_EXCEPTIONS:BOOL=OFF \ - -DLIBCXXABI_SILENT_TERMINATE:BOOL=ON \ - -DLIBCXXABI_ENABLE_THREADS:BOOL=OFF \ - -DLIBCXXABI_HAS_PTHREAD_API:BOOL=OFF \ - -DLIBCXXABI_HAS_EXTERNAL_THREAD_API:BOOL=OFF \ - -DLIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY:BOOL=OFF - ninja -C "$@" $(NJOBS) $(VERBOSE) - -# Build compiler-rt for wasm32 and wasm64. Build libcxx only for wasm32, as -# libcxx requires wasi-libc, which only exists for wasm32 right now. -debian-wasm-build: \ - build-wasm/compiler-rt-wasm32 \ - build-wasm/libcxx-wasm32-wasi \ - build-wasm/compiler-rt-wasm64 + -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=$$build-unknown-unknown \ + -DCOMPILER_RT_OS_DIR=wasi; \ + ninja -C build-compiler-rt-$$build $(NJOBS) $(VERBOSE); \ + done +else + echo "Skip on this arch" +endif touch $@ + sccache-stats: # If we used sccache, shows stats if test -f /opt/sccache/sccache; then \ ls -al /opt/sccache/; \ - mkdir -p /tmp/buildd/source/; \ - /opt/sccache/sccache --stats-format json --show-stats > /tmp/buildd/source/sccache-stats.json; \ - cat /tmp/buildd/source/sccache-stats.json; \ + /opt/sccache/sccache --show-stats; \ fi touch $@ -override_dh_auto_build: \ - debian-full-build \ - debian-libfuzzer-build \ - debian-libclc-build \ - debian-wasm-build \ - sccache-stats +override_dh_auto_build: debian-full-build debian-libfuzzer-build debian-libclc-build debian-rtlib-wasm-build sccache-stats override_dh_prep: build_doc dh_prep @@ -980,10 +899,10 @@ endif $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/build/utils/lit/lit/*/__pycache__/ DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C libclc/build install - - DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-wasm/compiler-rt-wasm32 install - DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-wasm/compiler-rt-wasm64 install - DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-wasm/libcxx-wasm32-wasi install +ifeq (${COMPILER_RT_WASM_ENABLE},yes) + DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-compiler-rt-wasm32 install + DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-compiler-rt-wasm64 install +endif # Rename binaries mkdir -p $(DEB_INST)/usr/bin/ @@ -1137,7 +1056,7 @@ ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' bin else # GNU strip doesn't recognize WebAssembly binaries, and actually corrupts them. # llvm-strip (as of 15.0.2) fails with --strip-debug (but works with --strip-all) - dh_strip -a -v -Xlibclang_rt.builtins-wasm32.a -Xlibclang_rt.builtins-wasm64.a -Xusr/lib/wasm32-wasi + dh_strip -a -v -Xlibclang_rt.builtins-wasm32.a -Xlibclang_rt.builtins-wasm64.a endif override_dh_install: @@ -1167,13 +1086,6 @@ override_dh_installdeb: # Remove some libc++ abi files in the libc++ file. See bug #969274 rm -f $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/c++/__cxxabi_config.h $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/c++/cxxabi.h - - mkdir -p $(CURDIR)/debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1 - mv $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/__cxxabi_config.h \ - $(CURDIR)/debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/__cxxabi_config.h - mv $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/cxxabi.h \ - $(CURDIR)/debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/cxxabi.h - # Remove auto generated python pyc find $(CURDIR)/debian/llvm-$(LLVM_VERSION)-tools/usr/lib/llvm-$(LLVM_VERSION)/ -name '*.pyc' | xargs -r rm -f @@ -1262,7 +1174,7 @@ override_dh_auto_test: endif -override_dh_gencontrol: sccache-stats +override_dh_gencontrol: dh_gencontrol -- $(control_vars) @@ -1282,7 +1194,7 @@ override_dh_auto_clean: rm -f $(CURDIR)/clang/tools/clang-format/clang-format-diff-$(LLVM_VERSION) rm -f $(CURDIR)/clang/tools/clang-format/clang-format-$(LLVM_VERSION).py rm -rf libclc/build - rm -rf build-wasm + rm -rf build-compiler-rt-wasm32 build-compiler-rt-wasm64 if test -f lld/docs/ld.lld-$(LLVM_VERSION).1; then \ mv lld/docs/ld.lld-$(LLVM_VERSION).1 lld/docs/ld.lld.1; \ fi @@ -1298,4 +1210,4 @@ override_dh_auto_clean: : # remove extra stamps rm -f debian-*-build -.PHONY: override_dh_strip preconfigure +.PHONY: override_dh_strip preconfigure debian-full-build debian-libfuzzer-build debian-libclc-build debian-rtlib-wasm-build From 78fcc5f7bba27d6188dcb648ccc08817cd084e0a Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Sun, 4 Dec 2022 09:13:31 +0100 Subject: [PATCH 13/38] Merge with experimental upload 1:14.0.6-10~exp1 --- debian/changelog | 24 ++- debian/control | 43 +++++ debian/libc++-X.Y-dev-wasm32.install.in | 3 + debian/libc++-X.Y-dev-wasm32.links.in | 2 + ...libc++-X.Y-dev-wasm32.lintian-overrides.in | 1 + debian/libc++abi-X.Y-dev-wasm32.install.in | 1 + debian/libc++abi-X.Y-dev-wasm32.links.in | 1 + ...c++abi-X.Y-dev-wasm32.lintian-overrides.in | 1 + debian/patches/wasm/wasm-sysroot-usr.diff | 39 ++++- debian/qualify-clang.sh | 26 ++- debian/rules | 154 ++++++++++++++---- 11 files changed, 245 insertions(+), 50 deletions(-) create mode 100644 debian/libc++-X.Y-dev-wasm32.install.in create mode 100644 debian/libc++-X.Y-dev-wasm32.links.in create mode 100644 debian/libc++-X.Y-dev-wasm32.lintian-overrides.in create mode 100644 debian/libc++abi-X.Y-dev-wasm32.install.in create mode 100644 debian/libc++abi-X.Y-dev-wasm32.links.in create mode 100644 debian/libc++abi-X.Y-dev-wasm32.lintian-overrides.in diff --git a/debian/changelog b/debian/changelog index 1d9830da..7744b446 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +llvm-toolchain-14 (1:14.0.6-10~exp1) experimental; urgency=medium + + * More WebAssembly (wasm32/wasm64) work: + - Update patch wasm-sysroot-usr to stop including /usr/include when + building for the non-OS (unknown) wasm targets, to avoid inadvertently + including the host's (glibc) headers. + - Re-enable builds on all architectures, previously disabled for + arm64 armel mips64el mipsel ppc64el armhf in 1:14.0.6-4, due to an FTBFS + related to the /usr/include issue above. + - Update patch wasm-sysroot-usr to adjust system include paths for C++ + headers as well. + - Build libc++ and libc++abi for wasm32-wasi, generating two new binary + packages, and introducing a build dependency on wasi-libc. + - Misc code organization fixes to debian/rules. + + -- Faidon Liambotis Fri, 18 Nov 2022 08:21:02 +0200 + llvm-toolchain-14 (1:14.0.6-9) unstable; urgency=medium * Cherry-pick upstream commit c081bf4098c729afacf20303cc9df62bf13c3362 @@ -1859,13 +1876,6 @@ llvm-toolchain-snapshot (1:11~++20200621103028+10b0539772d-1~exp1) UNRELEASED; u * Upstream change ad97ccf6b26a29262c9cbf5b3e7f6e84c6dcf55f broke clangd-atomic-cmake.patch causing some undef symbol on i386 and atomic - * experimental New snapshot release - * experimental New snapshot release - * experimental New snapshot release - * experimental New snapshot release - * experimental New snapshot release - * experimental New snapshot release - * experimental New snapshot release -- Sylvestre Ledru Sun, 21 Jun 2020 10:33:23 +0200 diff --git a/debian/control b/debian/control index 58f91da2..9883345b 100644 --- a/debian/control +++ b/debian/control @@ -24,6 +24,7 @@ Build-Depends: debhelper (>= 10.0), cmake, ninja-build, libpfm4-dev [linux-any], python3-setuptools, libz3-dev, llvm-spirv-14 [ amd64 arm64 armel armhf mips64el mipsel ppc64el s390x ] | hello [!i386], spirv-tools [ linux-any ] | hello [ !i386], + wasi-libc, libcurl4-dev, libgrpc++-dev [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x], protobuf-compiler-grpc [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x], @@ -648,6 +649,29 @@ Description: LLVM C++ Standard library (development files) as exception objects, rtti and memory allocation. * Extensive unit tests. +Package: libc++-14-dev-wasm32 +Section: libdevel +Architecture: all +Multi-Arch: foreign +Depends: wasi-libc, libc++abi-14-dev-wasm32, ${misc:Depends} +Provides: libc++-x.y-dev-wasm32 +Conflicts: libc++-x.y-dev-wasm32 +Replaces: libc++-x.y-dev-wasm32 +Description: LLVM C++ Standard library (WASI) + libc++ is another implementation of the C++ standard library + . + Features and Goals + . + * Correctness as defined by the C++ standards. + * Fast execution. + * Minimal memory use. + * Fast compile times. + * ABI compatibility with gcc's libstdc++ for some low-level features such + as exception objects, rtti and memory allocation. + * Extensive unit tests. + . + This package provides a version for the 32-bit WebAssembly System Interface. + # ------------- libcxxabi ------------- Package: libc++abi1-14 @@ -687,6 +711,25 @@ Description: LLVM low level support for a standard C++ library (development file * Correctness as defined by the C++ standards. * Provide a portable sublayer to ease the porting of libc++ +Package: libc++abi-14-dev-wasm32 +Section: libdevel +Architecture: all +Multi-Arch: foreign +Depends: wasi-libc, ${misc:Depends} +Provides: libc++abi-x.y-dev-wasm32 +Conflicts: libc++abi-x.y-dev-wasm32 +Replaces: libc++abi-x.y-dev-wasm32 +Description: LLVM low level support for a standard C++ library (WASI) + libc++abi is another implementation of low level support for a standard C++ + library. + . + Features and Goals + . + * Correctness as defined by the C++ standards. + * Provide a portable sublayer to ease the porting of libc++ + . + This package provides a version for the 32-bit WebAssembly System Interface. + # ------------- libclc ------------- Package: libclc-14 diff --git a/debian/libc++-X.Y-dev-wasm32.install.in b/debian/libc++-X.Y-dev-wasm32.install.in new file mode 100644 index 00000000..13c31f09 --- /dev/null +++ b/debian/libc++-X.Y-dev-wasm32.install.in @@ -0,0 +1,3 @@ +usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++.a +usr/lib/llvm-@LLVM_VERSION@/include/wasm32-wasi/c++/ +usr/lib/llvm-@LLVM_VERSION@/include/wasm32-wasi/c++/v1/ diff --git a/debian/libc++-X.Y-dev-wasm32.links.in b/debian/libc++-X.Y-dev-wasm32.links.in new file mode 100644 index 00000000..465536e9 --- /dev/null +++ b/debian/libc++-X.Y-dev-wasm32.links.in @@ -0,0 +1,2 @@ +usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++.a /usr/lib/wasm32-wasi/libc++.a +usr/lib/llvm-@LLVM_VERSION@/include/wasm32-wasi/c++/v1 /usr/include/wasm32-wasi/c++/v1 diff --git a/debian/libc++-X.Y-dev-wasm32.lintian-overrides.in b/debian/libc++-X.Y-dev-wasm32.lintian-overrides.in new file mode 100644 index 00000000..4cad189a --- /dev/null +++ b/debian/libc++-X.Y-dev-wasm32.lintian-overrides.in @@ -0,0 +1 @@ +libc++-@LLVM_VERSION@-dev-wasm32: arch-independent-package-contains-binary-or-object usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++.a \ No newline at end of file diff --git a/debian/libc++abi-X.Y-dev-wasm32.install.in b/debian/libc++abi-X.Y-dev-wasm32.install.in new file mode 100644 index 00000000..1d6e8500 --- /dev/null +++ b/debian/libc++abi-X.Y-dev-wasm32.install.in @@ -0,0 +1 @@ +usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++abi.a diff --git a/debian/libc++abi-X.Y-dev-wasm32.links.in b/debian/libc++abi-X.Y-dev-wasm32.links.in new file mode 100644 index 00000000..c1655fbf --- /dev/null +++ b/debian/libc++abi-X.Y-dev-wasm32.links.in @@ -0,0 +1 @@ +usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++abi.a /usr/lib/wasm32-wasi/libc++abi.a diff --git a/debian/libc++abi-X.Y-dev-wasm32.lintian-overrides.in b/debian/libc++abi-X.Y-dev-wasm32.lintian-overrides.in new file mode 100644 index 00000000..76ba43d2 --- /dev/null +++ b/debian/libc++abi-X.Y-dev-wasm32.lintian-overrides.in @@ -0,0 +1 @@ +libc++abi-@LLVM_VERSION@-dev-wasm32: arch-independent-package-contains-binary-or-object usr/lib/llvm-@LLVM_VERSION@/lib/wasm32-wasi/libc++abi.a \ No newline at end of file diff --git a/debian/patches/wasm/wasm-sysroot-usr.diff b/debian/patches/wasm/wasm-sysroot-usr.diff index f24ec1fc..0d884214 100644 --- a/debian/patches/wasm/wasm-sysroot-usr.diff +++ b/debian/patches/wasm/wasm-sysroot-usr.diff @@ -27,21 +27,54 @@ Index: llvm-toolchain-14-14.0.6/clang/lib/Driver/ToolChains/WebAssembly.cpp if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) { SmallString<128> P(D.ResourceDir); -@@ -421,10 +423,10 @@ void WebAssembly::AddClangSystemIncludeA +@@ -419,27 +421,39 @@ void WebAssembly::AddClangSystemIncludeA + return; + } ++ // add the multiarch path on e.g. wasm32-wasi if (getTriple().getOS() != llvm::Triple::UnknownOS) { const std::string MultiarchTriple = - getMultiarchTriple(D, getTriple(), D.SysRoot); - addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/include/" + MultiarchTriple); + getMultiarchTriple(D, getTriple(), SysRoot); ++ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/local/include/" + MultiarchTriple); ++ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/local/include"); + addSystemInclude(DriverArgs, CC1Args, SysRoot + "/include/" + MultiarchTriple); } - addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/include"); -+ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/include"); ++ ++ // also add the non-multiarch path, only on a known OS (as above), or when ++ // a sysroot is given, for backwards compatibility with the original driver ++ if (getTriple().getOS() != llvm::Triple::UnknownOS || ++ !getDriver().SysRoot.empty()) ++ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/include"); } void WebAssembly::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs, -@@ -467,3 +469,15 @@ SanitizerMask WebAssembly::getSupportedS + ArgStringList &CC1Args) const { ++ std::string SysRoot = computeSysRoot(); ++ + if (!DriverArgs.hasArg(options::OPT_nostdlibinc) && + !DriverArgs.hasArg(options::OPT_nostdincxx)) { + if (getTriple().getOS() != llvm::Triple::UnknownOS) { + const std::string MultiarchTriple = +- getMultiarchTriple(getDriver(), getTriple(), getDriver().SysRoot); ++ getMultiarchTriple(getDriver(), getTriple(), SysRoot); + addSystemInclude(DriverArgs, CC1Args, +- getDriver().SysRoot + "/include/" + MultiarchTriple + ++ SysRoot + "/include/" + MultiarchTriple + + "/c++/v1"); + } +- addSystemInclude(DriverArgs, CC1Args, +- getDriver().SysRoot + "/include/c++/v1"); ++ ++ // don't include the host architecture's headers in the search path ++ if (!getDriver().SysRoot.empty()) ++ addSystemInclude(DriverArgs, CC1Args, SysRoot + "/include/c++/v1"); + } + } + +@@ -467,3 +481,15 @@ SanitizerMask WebAssembly::getSupportedS Tool *WebAssembly::buildLinker() const { return new tools::wasm::Linker(*this); } diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index dfda6e44..385cf5a7 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -1361,22 +1361,34 @@ fi if dpkg -l|grep -q wasi-libc; then cat < printf.c #include - int main(int argc, char *argv[]) - { - printf("%s\n", "Hello world!"); + int main(int argc, char *argv[]) { + printf("%s\n", "Hello World!"); } EOF - clang-$VERSION -target wasm32-unknown-wasi -o printf printf.c + # wasi-libc supports only wasm32 right now + clang-$VERSION -target wasm32-wasi -o printf printf.c file printf &> foo.log if ! grep -q "WebAssembly" foo.log; then echo "the generated file isn't a WebAssembly file?" exit 1 fi rm -f printf.c printf + + cat < cout.cpp + #include + int main() { + std::cout << "Hello World!" << std::endl; + } +EOF + # libcxx requires wasi-libc, which only exists for wasm32 right now + clang++-$VERSION --target=wasm32-wasi -o cout cout.cpp + file cout &> foo.log + if ! grep -q "WebAssembly" foo.log; then + echo "the generated file isn't a WebAssembly file?" + exit 1 + fi + rm -f cout.cpp cout fi -echo '#include ' > foo.cpp -# Fails for now -clang++-$VERSION --target=wasm32-wasi -o foo.o -c foo.cpp||true echo ' #include diff --git a/debian/rules b/debian/rules index 41309bc2..184de30a 100755 --- a/debian/rules +++ b/debian/rules @@ -302,12 +302,6 @@ ifeq ($(LIBUNWIND_ENABLE),yes) endif endif -COMPILER_RT_WASM_ENABLE=yes - -ifneq (,$(filter $(DEB_HOST_ARCH), arm64 armel mips64el mipsel ppc64el armhf riscv64)) - COMPILER_RT_WASM_ENABLE=no -endif - # Do not install objects STAGE_ALL_CMAKE_EXTRA += -DMLIR_INSTALL_AGGREGATE_OBJECTS=OFF @@ -715,17 +709,17 @@ debian-libclc-build: ninja $(NJOBS) $(VERBOSE) touch $@ -debian-rtlib-wasm-build: -ifeq (${COMPILER_RT_WASM_ENABLE},yes) - echo "Using cmake: $(CMAKE_BIN)" - for build in wasm32 wasm64; do \ - mkdir -p build-compiler-rt-$$build; \ - $(CMAKE_BIN) -B build-compiler-rt-$$build -S compiler-rt/lib/builtins/ \ +build-wasm/compiler-rt-%: cpu = $(@:build-wasm/compiler-rt-%=%) +build-wasm/compiler-rt-%: + @echo "Building compiler-rt for $(cpu)" + @echo "Using cmake: $(CMAKE_BIN)" + mkdir -p "$@" + $(CMAKE_BIN) -B "$@" -S compiler-rt/lib/builtins/ \ -G Ninja \ $(SCCACHE_CMAKE) \ - -DCMAKE_C_COMPILER_TARGET=$$build-unknown-unknown \ - -DCMAKE_CXX_COMPILER_TARGET=$$build-unknown-unknown \ - -DCMAKE_ASM_COMPILER_TARGET=$$build-unknown-unknown \ + -DCMAKE_C_COMPILER_TARGET=$(cpu)-unknown-unknown \ + -DCMAKE_CXX_COMPILER_TARGET=$(cpu)-unknown-unknown \ + -DCMAKE_ASM_COMPILER_TARGET=$(cpu)-unknown-unknown \ -DCMAKE_C_COMPILER=$(STAGE_2_BIN_DIR)/clang \ -DCMAKE_CXX_COMPILER=$(STAGE_2_BIN_DIR)/clang++ \ -DCMAKE_C_FLAGS="$(opt_flags) $(STAGE_2_CFLAGS)" \ @@ -742,25 +736,112 @@ ifeq (${COMPILER_RT_WASM_ENABLE},yes) -DCOMPILER_RT_INCLUDE_TESTS=OFF \ -DCOMPILER_RT_USE_LIBCXX=OFF \ -DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON \ - -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=$$build-unknown-unknown \ - -DCOMPILER_RT_OS_DIR=wasi; \ - ninja -C build-compiler-rt-$$build $(NJOBS) $(VERBOSE); \ - done -else - echo "Skip on this arch" -endif - touch $@ + -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=$(cpu)-unknown-unknown \ + -DCOMPILER_RT_OS_DIR=wasi + ninja -C "$@" $(NJOBS) $(VERBOSE) +build-wasm/libcxx-%-wasi: cpu = $(@:build-wasm/libcxx-%-wasi=%) +build-wasm/libcxx-%-wasi: build-wasm/compiler-rt-% + @echo "Building libcxx for $(cpu)" + @echo "Using cmake: $(CMAKE_BIN)" + + # We need a functioning clang, which in turn requires a linker. We + # patch clang to use a versioned wasm-ld (cf. wasm-ld-path.diff), so + # create wasm-ld-$(LLVM_VERSION) in the stage2 bin dir manually. + cp $(STAGE_2_BIN_DIR)/wasm-ld $(STAGE_2_BIN_DIR)/wasm-ld-$(LLVM_VERSION) + + # We need a wasm compiler-rt. Depend on the make target that builds it, + # and manually copy it to the stage2 lib dir from there + mkdir -p \ + $(STAGE_2_LIB_DIR)/clang/$(LLVM_VERSION_FULL)/lib/wasi/ + cp build-wasm/compiler-rt-$(cpu)/lib/wasi/libclang_rt.builtins-$(cpu).a \ + $(STAGE_2_LIB_DIR)/clang/$(LLVM_VERSION_FULL)/lib/wasi/ + + # Notes: + # - Uses $(LDFLAGS) instead of $(STAGE_2_LDFLAGS), because wasm-ld does not + # support --build-id yet. Upstream is working on it, cf. D107662. + # - Pass -fno-stack-protector to disable -fstack-protector-strong that is + # passed by default, as this is not supported yet in WebAssembly, cf. + # https://github.com/WebAssembly/wasi-libc/issues/157 + # - Use llvm-ar and llvm-ranlib, as binutils does not currently support + # WebAssembly and creates invalid indexes. + # - Use LLVM_LIBDIR_SUFFIX to install to /usr/lib/wasm32-wasi. To be + # replaced by CMAKE_INSTALL_LIBDIR=lib/$(cpu)-wasi when D130586 + # ships. + mkdir -p "$@" + $(CMAKE_BIN) -B "$@" -S runtimes \ + -G $(GENERATOR) \ + $(SCCACHE_CMAKE) \ + -DCMAKE_C_COMPILER_WORKS=ON \ + -DCMAKE_CXX_COMPILER_WORKS=ON \ + -DLLVM_COMPILER_CHECKED=ON \ + -DCMAKE_C_COMPILER_TARGET=$(cpu)-unknown-wasi \ + -DCMAKE_CXX_COMPILER_TARGET=$(cpu)-unknown-wasi \ + -DCMAKE_ASM_COMPILER_TARGET=$(cpu)-unknown-wasi \ + -DCMAKE_C_COMPILER=$(STAGE_2_BIN_DIR)/clang \ + -DCMAKE_CXX_COMPILER=$(STAGE_2_BIN_DIR)/clang++ \ + -DCMAKE_AR=$(STAGE_2_BIN_DIR)/llvm-ar \ + -DCMAKE_RANLIB=$(STAGE_2_BIN_DIR)/llvm-ranlib \ + -DCMAKE_C_FLAGS="$(opt_flags) $(STAGE_2_CFLAGS) -fno-stack-protector" \ + -DCMAKE_CXX_FLAGS="$(opt_flags) $(STAGE_2_CXXFLAGS) -fno-stack-protector" \ + -DCMAKE_SHARED_LINKER_FLAGS="$(LDFLAGS) -L$(STAGE_2_LIB_DIR)" \ + -DCMAKE_MODULE_LINKER_FLAGS="$(LDFLAGS) -L$(STAGE_2_LIB_DIR)" \ + -DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS) -L$(STAGE_2_LIB_DIR)" \ + -DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-$(LLVM_VERSION) \ + -DCMAKE_INSTALL_INCLUDEDIR=include/$(cpu)-wasi \ + -DLLVM_LIBDIR_SUFFIX=/$(cpu)-wasi \ + -DLLVM_CONFIG=$(STAGE_2_BIN_DIR)/llvm-config \ + -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \ + -DLIBCXX_USE_COMPILER_RT=ON \ + -DLIBCXXABI_USE_COMPILER_RT=ON \ + -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON \ + -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON \ + -DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=OFF \ + -DCMAKE_BUILD_TYPE=RelWithDebugInfo \ + -DLIBCXX_CXX_ABI=libcxxabi \ + -DLIBCXX_ABI_VERSION=2 \ + -DLIBCXX_HAS_MUSL_LIBC:BOOL=ON \ + -DLIBCXX_ENABLE_SHARED:BOOL=OFF \ + -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY:BOOL=OFF \ + -DLIBCXX_ENABLE_EXCEPTIONS:BOOL=OFF \ + -DLIBCXX_ENABLE_FILESYSTEM:BOOL=OFF \ + -DLIBCXX_ENABLE_THREADS:BOOL=OFF \ + -DLIBCXX_HAS_PTHREAD_API:BOOL=OFF \ + -DLIBCXX_HAS_EXTERNAL_THREAD_API:BOOL=OFF \ + -DLIBCXX_BUILD_EXTERNAL_THREAD_LIBRARY:BOOL=OFF \ + -DLIBCXXABI_ENABLE_SHARED:BOOL=OFF \ + -DLIBCXXABI_ENABLE_EXCEPTIONS:BOOL=OFF \ + -DLIBCXXABI_SILENT_TERMINATE:BOOL=ON \ + -DLIBCXXABI_ENABLE_THREADS:BOOL=OFF \ + -DLIBCXXABI_HAS_PTHREAD_API:BOOL=OFF \ + -DLIBCXXABI_HAS_EXTERNAL_THREAD_API:BOOL=OFF \ + -DLIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY:BOOL=OFF + ninja -C "$@" $(NJOBS) $(VERBOSE) + +# Build compiler-rt for wasm32 and wasm64. Build libcxx only for wasm32, as +# libcxx requires wasi-libc, which only exists for wasm32 right now. +debian-wasm-build: \ + build-wasm/compiler-rt-wasm32 \ + build-wasm/libcxx-wasm32-wasi \ + build-wasm/compiler-rt-wasm64 + touch $@ sccache-stats: # If we used sccache, shows stats if test -f /opt/sccache/sccache; then \ ls -al /opt/sccache/; \ - /opt/sccache/sccache --show-stats; \ + mkdir -p /tmp/buildd/source/; \ + /opt/sccache/sccache --stats-format json --show-stats > /tmp/buildd/source/sccache-stats.json; \ + cat /tmp/buildd/source/sccache-stats.json; \ fi touch $@ -override_dh_auto_build: debian-full-build debian-libfuzzer-build debian-libclc-build debian-rtlib-wasm-build sccache-stats +override_dh_auto_build: \ + debian-full-build \ + debian-libfuzzer-build \ + debian-libclc-build \ + debian-wasm-build \ + sccache-stats override_dh_prep: build_doc dh_prep @@ -899,10 +980,10 @@ endif $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/build/utils/lit/lit/*/__pycache__/ DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C libclc/build install -ifeq (${COMPILER_RT_WASM_ENABLE},yes) - DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-compiler-rt-wasm32 install - DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-compiler-rt-wasm64 install -endif + + DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-wasm/compiler-rt-wasm32 install + DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-wasm/compiler-rt-wasm64 install + DESTDIR=$(DEB_INST) ninja $(VERBOSE) -C build-wasm/libcxx-wasm32-wasi install # Rename binaries mkdir -p $(DEB_INST)/usr/bin/ @@ -1056,7 +1137,7 @@ ifeq ($(shell dpkg --compare-versions $(shell dpkg-query -W -f '$${Version}' bin else # GNU strip doesn't recognize WebAssembly binaries, and actually corrupts them. # llvm-strip (as of 15.0.2) fails with --strip-debug (but works with --strip-all) - dh_strip -a -v -Xlibclang_rt.builtins-wasm32.a -Xlibclang_rt.builtins-wasm64.a + dh_strip -a -v -Xlibclang_rt.builtins-wasm32.a -Xlibclang_rt.builtins-wasm64.a -Xusr/lib/wasm32-wasi endif override_dh_install: @@ -1086,6 +1167,13 @@ override_dh_installdeb: # Remove some libc++ abi files in the libc++ file. See bug #969274 rm -f $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/c++/__cxxabi_config.h $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/c++/cxxabi.h + + mkdir -p $(CURDIR)/debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1 + mv $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/__cxxabi_config.h \ + $(CURDIR)/debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/__cxxabi_config.h + mv $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/cxxabi.h \ + $(CURDIR)/debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/cxxabi.h + # Remove auto generated python pyc find $(CURDIR)/debian/llvm-$(LLVM_VERSION)-tools/usr/lib/llvm-$(LLVM_VERSION)/ -name '*.pyc' | xargs -r rm -f @@ -1174,7 +1262,7 @@ override_dh_auto_test: endif -override_dh_gencontrol: +override_dh_gencontrol: sccache-stats dh_gencontrol -- $(control_vars) @@ -1194,7 +1282,7 @@ override_dh_auto_clean: rm -f $(CURDIR)/clang/tools/clang-format/clang-format-diff-$(LLVM_VERSION) rm -f $(CURDIR)/clang/tools/clang-format/clang-format-$(LLVM_VERSION).py rm -rf libclc/build - rm -rf build-compiler-rt-wasm32 build-compiler-rt-wasm64 + rm -rf build-wasm if test -f lld/docs/ld.lld-$(LLVM_VERSION).1; then \ mv lld/docs/ld.lld-$(LLVM_VERSION).1 lld/docs/ld.lld.1; \ fi @@ -1210,4 +1298,4 @@ override_dh_auto_clean: : # remove extra stamps rm -f debian-*-build -.PHONY: override_dh_strip preconfigure debian-full-build debian-libfuzzer-build debian-libclc-build debian-rtlib-wasm-build +.PHONY: override_dh_strip preconfigure From e5225028af02f1ba42d733851fad51c2ee453d99 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 8 Dec 2022 23:58:42 +0100 Subject: [PATCH 14/38] touch the target to simplify multiple runs --- debian/rules | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/rules b/debian/rules index 184de30a..2b389879 100755 --- a/debian/rules +++ b/debian/rules @@ -902,6 +902,7 @@ endif cd openmp/runtime && doxygen doc/doxygen/config; cd -; \ cd openmp/runtime/doc/doxygen/generated/html/ && rm jquery.js && ln -s /usr/share/javascript/jquery/jquery.js; \ fi + touch $@ override_dh_auto_install: # Clean up temporary files to make sure the install works @@ -1082,6 +1083,7 @@ endif # Delete the target build directory to save some space on the build systems # All the files have been installed in $(CURDIR)/debian/tmp/ already rm -rf $(TARGET_BUILD) + touch $@ override_dh_makeshlibs: From 6fb05958638f308a66cacbe54f922c0446de5df6 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 10 Dec 2022 16:35:19 +0100 Subject: [PATCH 15/38] transform debian/control into debian/control.in --- debian/README | 8 +- debian/changelog | 6 + debian/control.in | 853 ++++++++++++++++++++++++++++++++++++++++++++++ debian/rules | 8 + 4 files changed, 874 insertions(+), 1 deletion(-) create mode 100644 debian/control.in diff --git a/debian/README b/debian/README index cdf5f885..aa6d4d2f 100644 --- a/debian/README +++ b/debian/README @@ -9,10 +9,15 @@ The current snapshot release is maintained in the "snapshot" branch. The easiest way to get all branches is probably to have one clone per version: -for f in 8 9 10 snapshot; do +for f in 14 15 snapshot; do git clone git@salsa.debian.org:pkg-llvm-team/llvm-toolchain.git -b $f $f done +debian/control is generated from debian/control.in by running: + +ebian/rules preconfigure + + Steps for manually building a snapshot release ============================================== @@ -78,6 +83,7 @@ Additional maintainer scripts The script qualify-clang.sh that is found at the git debian/ directory should be used to quickly test a newly built package. It runs a short set of sanity-check tests and regression tests. +It is executed in autopkgtest. The script releases/snapshot/debian/prepare-new-release.sh is used when preparing a new point release. It automatically replaces version numbers diff --git a/debian/changelog b/debian/changelog index 7744b446..5b72a647 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-14 (1:14.0.6-10~exp2) UNRELEASED; urgency=medium + + * transform debian/control into debian/control.in + + -- Sylvestre Ledru Sat, 10 Dec 2022 16:34:17 +0100 + llvm-toolchain-14 (1:14.0.6-10~exp1) experimental; urgency=medium * More WebAssembly (wasm32/wasm64) work: diff --git a/debian/control.in b/debian/control.in new file mode 100644 index 00000000..3cebecc8 --- /dev/null +++ b/debian/control.in @@ -0,0 +1,853 @@ +Source: llvm-toolchain-@LLVM_VERSION@ +Section: devel +Priority: optional +Rules-Requires-Root: no +Maintainer: LLVM Packaging Team +Uploaders: Sylvestre Ledru , Gianfranco Costamagna +Build-Depends: debhelper (>= 10.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), + binutils-dev, + libxml2-dev, + libjsoncpp-dev, pkg-config, + lcov, procps, help2man, zlib1g-dev, + g++-multilib [amd64 i386 kfreebsd-amd64 mips64 mips64el mipsel powerpc ppc64 s390 s390x sparc sparc64 x32], + libjs-mathjax, python3-recommonmark, + doxygen, gfortran, + ocaml-base [amd64 arm64 armhf ppc64el riscv64 s390x] | ocaml-nox [amd64 arm64 armhf ppc64el riscv64 s390x], + ocaml-findlib [amd64 arm64 armhf ppc64el riscv64 s390x], + libctypes-ocaml-dev [amd64 arm64 armhf ppc64el riscv64 s390x], + dh-exec, dh-ocaml [amd64 arm64 armhf ppc64el riscv64 s390x], + libpfm4-dev [linux-any], python3-setuptools, libz3-dev, + llvm-spirv-14 [ amd64 arm64 armel armhf mips64el mipsel ppc64el s390x ] | hello [!i386], + spirv-tools [ linux-any ] | hello [ !i386], + wasi-libc, + libcurl4-dev, + libgrpc++-dev [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x], + protobuf-compiler-grpc [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x], + libprotobuf-dev [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x], + protobuf-compiler [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x] +# "| hello" is for older buster/bionic distros without spirv support +Build-Conflicts: oprofile +Standards-Version: 4.2.1 +Homepage: https://www.llvm.org/ +Vcs-Git: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain.git -b @BRANCH_NAME@ +Vcs-Browser: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/tree/@BRANCH_NAME@ + +# ------------- clang ------------- + +Package: clang-@LLVM_VERSION@ +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, ${dep:devlibs}, + ${dep:devlibs-objc}, libclang-common-@LLVM_VERSION@-dev (= ${binary:Version}), + llvm-@LLVM_VERSION@-linker-tools (= ${binary:Version}), + libclang1-@LLVM_VERSION@ (= ${binary:Version}), libc6-dev, binutils +Provides: c-compiler, objc-compiler, c++-compiler +Recommends: llvm-@LLVM_VERSION@-dev, python3 +# libomp-@LLVM_VERSION@-dev +Suggests: clang-@LLVM_VERSION@-doc, wasi-libc +Description: C, C++ and Objective-C compiler + Clang project is a C, C++, Objective C and Objective C++ front-end + based on the LLVM compiler. Its goal is to offer a replacement to the + GNU Compiler Collection (GCC). + . + Clang implements all of the ISO C++ 1998, 11, 14 and 17 standards and also + provides most of the support of C++20. + +Package: clang-tools-@LLVM_VERSION@ +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, clang-@LLVM_VERSION@ (= ${binary:Version}), + python3 +Description: clang-based tools for C/C++ developments + Clang project is a C, C++, Objective C and Objective C++ front-end + based on the LLVM compiler. Its goal is to offer a replacement to the + GNU Compiler Collection (GCC). + . + Clang implements all of the ISO C++ 1998, 11, 14 and 17 standards and also + provides most of the support of C++20. + . + This package contains some clang-based tools like scan-build, clang-cl, etc. + +Package: clang-format-@LLVM_VERSION@ +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, python3, + libllvm@LLVM_VERSION@ (= ${binary:Version}) +Description: Tool to format C/C++/Obj-C code + Clang-format is both a library and a stand-alone tool with the goal of + automatically reformatting C++ sources files according to configurable + style guides. To do so, clang-format uses Clang's Lexer to transform an + input file into a token stream and then changes all the whitespace around + those tokens. The goal is for clang-format to both serve both as a user + tool (ideally with powerful IDE integrations) and part of other + refactoring tools, e.g. to do a reformatting of all the lines changed + during a renaming. + . + This package also provides vim and emacs plugins. + +Package: clang-tidy-@LLVM_VERSION@ +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, python3, + libllvm@LLVM_VERSION@ (= ${binary:Version}), libclang-common-@LLVM_VERSION@-dev, + clang-tools-@LLVM_VERSION@, python3-yaml +Description: clang-based C++ linter tool + Provide an extensible framework for diagnosing and fixing typical programming + errors, like style violations, interface misuse, or bugs that can be deduced + via static analysis. clang-tidy is modular and provides a convenient interface + for writing new checks. + +Package: clangd-@LLVM_VERSION@ +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, + libclang-common-@LLVM_VERSION@-dev (= ${binary:Version}) +Description: Language server that provides IDE-like features to editors + clangd understands your C++ code and adds smart features to your editor: + - code completion + - compile errors + - go-to-definition + - and more. + . + clangd is a language server that implements the Language Server Protocol; + it can work with many editors through a plugin. + +Package: clang-@LLVM_VERSION@-doc +Architecture: all +Section: doc +Depends: ${shlibs:Depends}, ${misc:Depends}, libjs-mathjax +Description: C, C++ and Objective-C compiler - Documentation + Clang project is a C, C++, Objective C and Objective C++ front-end + based on the LLVM compiler. Its goal is to offer a replacement to the + GNU Compiler Collection (GCC). + . + Clang implements all of the ISO C++ 1998, 11, 14 and 17 standards and also + provides most of the support of C++20. + . + This package contains the documentation. + +Package: libclang1-@LLVM_VERSION@ +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends} +Description: C interface to the Clang library + Clang project is a C, C++, Objective C and Objective C++ front-end + based on the LLVM compiler. Its goal is to offer a replacement to the + GNU Compiler Collection (GCC). + . + Clang implements all of the ISO C++ 1998, 11, 14 and 17 standards and also + provides most of the support of C++20. + . + This package contains the Clang library. + . + The C Interface to Clang provides a relatively small API that exposes + facilities for parsing source code into an abstract syntax tree (AST), + loading already-parsed ASTs, traversing the AST, associating physical source + locations with elements within the AST, and other facilities that support + Clang-based development tools. + +Package: libclang-@LLVM_VERSION@-dev +Architecture: any +Section: libdevel +Depends: ${shlibs:Depends}, ${misc:Depends}, ${dep:devlibs}, + ${dep:devlibs-objc}, libclang1-@LLVM_VERSION@ (= ${binary:Version}), + libclang-common-@LLVM_VERSION@-dev (= ${binary:Version}) +Breaks: llvm-@LLVM_VERSION@-dev (<< 1:14.0.4-2) +Replaces: llvm-@LLVM_VERSION@-dev (<< 1:14.0.4-2) +Description: Clang library - Development package + Clang project is a C, C++, Objective C and Objective C++ front-end + based on the LLVM compiler. Its goal is to offer a replacement to the + GNU Compiler Collection (GCC). + . + Clang implements all of the ISO C++ 1998, 11, 14 and 17 standards and also + provides most of the support of C++20. + . + This package contains the Clang headers to develop extensions over + libclang1-@LLVM_VERSION@. + +Package: libclang-common-@LLVM_VERSION@-dev +Architecture: any +Section: libdevel +Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm@LLVM_VERSION@ (= ${binary:Version}) +Description: Clang library - Common development package + Clang project is a C, C++, Objective C and Objective C++ front-end + based on the LLVM compiler. Its goal is to offer a replacement to the + GNU Compiler Collection (GCC). + . + Clang implements all of the ISO C++ 1998, 11, 14 and 17 standards and also + provides most of the support of C++20. + . + This package contains the Clang generic headers and some libraries + (profiling, etc). + +Package: libclang-cpp@LLVM_VERSION@ +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm@LLVM_VERSION@ (= ${binary:Version}) +Pre-Depends: ${misc:Pre-Depends} +Description: C++ interface to the Clang library + Clang project is a C, C++, Objective C and Objective C++ front-end + based on the LLVM compiler. Its goal is to offer a replacement to the + GNU Compiler Collection (GCC). + . + Clang implements all of the ISO C++ 1998, 11, 14 and 17 standards and also + provides most of the support of C++20. + . + This package contains the Clang C++ library. + . + The C++ Interface to Clang provides an API that exposes + facilities for parsing source code into an abstract syntax tree (AST), + loading already-parsed ASTs, traversing the AST, associating physical source + locations with elements within the AST, and other facilities that support + Clang-based development tools. + +Package: libclang-cpp@LLVM_VERSION@-dev +Architecture: any +Section: libdevel +Depends: ${shlibs:Depends}, ${misc:Depends}, ${dep:devlibs}, + libclang-cpp@LLVM_VERSION@ (= ${binary:Version}) +# Move of libclang-cpp.so into libclang-cpp@LLVM_VERSION@.dev +Description: C++ interface to the Clang library + Clang project is a C, C++, Objective C and Objective C++ front-end + based on the LLVM compiler. Its goal is to offer a replacement to the + GNU Compiler Collection (GCC). + . + Clang implements all of the ISO C++ 1998, 11, 14 and 17 standards and also + provides most of the support of C++20. + . + This package contains the Clang C++ library. + . + The C++ Interface to Clang provides an API that exposes + facilities for parsing source code into an abstract syntax tree (AST), + loading already-parsed ASTs, traversing the AST, associating physical source + locations with elements within the AST, and other facilities that support + Clang-based development tools. + . + This package contains symlinks without a version number, which needed by + linker at build time. + + +Package: libfuzzer-@LLVM_VERSION@-dev +Architecture: linux-any +Section: libdevel +Depends: ${shlibs:Depends}, ${misc:Depends}, clang-@LLVM_VERSION@ (= ${binary:Version}) +Description: Library for coverage-guided fuzz testing + LibFuzzer is a library for in-process, coverage-guided, evolutionary fuzzing + of other libraries. + . + LibFuzzer is similar in concept to American Fuzzy Lop (AFL), but it performs + all of its fuzzing inside a single process. This in-process fuzzing can be + more restrictive and fragile, but is potentially much faster as there is no + overhead for process start-up. + . + The fuzzer is linked with the library under test, and feeds fuzzed inputs to + the library via a specific fuzzing entrypoint (aka 'target function'); the + fuzzer then tracks which areas of the code are reached, and generates mutations + on the corpus of input data in order to maximize the code coverage. The code + coverage information for libFuzzer is provided by LLVM's SanitizerCoverage + instrumentation. + + +Package: python3-clang-@LLVM_VERSION@ +Section: python +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, python3, libclang-@LLVM_VERSION@-dev +Replaces: python-clang-x.y, +Conflicts: python-clang-x.y +Provides: python-clang-x.y +Description: Clang Python Bindings + Clang project is a C, C++, Objective C and Objective C++ front-end + based on the LLVM compiler. Its goal is to offer a replacement to the + GNU Compiler Collection (GCC). + . + Clang implements all of the ISO C++ 1998, 11, 14 and 17 standards and also + provides most of the support of C++20. + . + This binding package provides access to the Clang compiler and libraries. + +Package: clang-@LLVM_VERSION@-examples +Architecture: any +Section: doc +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Clang examples + Clang project is a C, C++, Objective C and Objective C++ front-end + based on the LLVM compiler. Its goal is to offer a replacement to the + GNU Compiler Collection (GCC). + . + Clang implements all of the ISO C++ 1998, 11, 14 and 17 standards and also + provides most of the support of C++20. + . + This package contains the Clang examples. + +# ------------- LLVM ------------- + +Package: libllvm@LLVM_VERSION@ +Architecture: any +Section: libs +Depends: ${shlibs:Depends}, ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends} +Multi-Arch: same +Description: Modular compiler and toolchain technologies, runtime library + LLVM is a collection of libraries and tools that make it easy to build + compilers, optimizers, just-in-time code generators, and many other + compiler-related programs. + . + This package contains the LLVM runtime library. + +Package: llvm-@LLVM_VERSION@-linker-tools +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Modular compiler and toolchain technologies - Plugins + LLVM is a collection of libraries and tools that make it easy to build + compilers, optimizers, just-in-time code generators, and many other + compiler-related programs. + . + This package contains the LLVMgold and LLVMPolly linker plugins. + +Package: llvm-@LLVM_VERSION@ +Architecture: any +Suggests: llvm-@LLVM_VERSION@-doc +Depends: llvm-@LLVM_VERSION@-runtime (= ${binary:Version}), + llvm-@LLVM_VERSION@-linker-tools (= ${binary:Version}), + ${shlibs:Depends}, ${misc:Depends} +Recommends: llvm-@LLVM_VERSION@-dev +Description: Modular compiler and toolchain technologies + LLVM is a collection of libraries and tools that make it easy to build + compilers, optimizers, just-in-time code generators, and many other + compiler-related programs. + . + LLVM uses a single, language-independent virtual instruction set both + as an offline code representation (to communicate code between + compiler phases and to run-time systems) and as the compiler internal + representation (to analyze and transform programs). This persistent + code representation allows a common set of sophisticated compiler + techniques to be applied at compile-time, link-time, install-time, + run-time, or "idle-time" (between program runs). + . + The strengths of the LLVM infrastructure are its extremely + simple design (which makes it easy to understand and use), + source-language independence, powerful mid-level optimizer, automated + compiler debugging support, extensibility, and its stability and + reliability. LLVM is currently being used to host a wide variety of + academic research projects and commercial projects. LLVM includes C + and C++ front-ends, a front-end for a Forth-like language (Stacker), + a young scheme front-end, and Java support is in development. LLVM can + generate code for X96, SparcV10, PowerPC or many other architectures. + +Package: llvm-@LLVM_VERSION@-runtime +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: binfmt-support | systemd +Description: Modular compiler and toolchain technologies, IR interpreter + LLVM is a collection of libraries and tools that make it easy to build + compilers, optimizers, just-in-time code generators, and many other + compiler-related programs. + . + LLVM uses a single, language-independent virtual instruction set both + as an offline code representation (to communicate code between + compiler phases and to run-time systems) and as the compiler internal + representation (to analyze and transform programs). This persistent + code representation allows a common set of sophisticated compiler + techniques to be applied at compile-time, link-time, install-time, + run-time, or "idle-time" (between program runs). + . + This package provides the minimal required to execute programs in LLVM + format. + +Package: llvm-@LLVM_VERSION@-dev +Architecture: any +Depends: ${shlibs:Depends}, libffi-dev, ${misc:Depends}, + llvm-@LLVM_VERSION@ (= ${binary:Version}), libllvm@LLVM_VERSION@ (= ${binary:Version}), libtinfo-dev, + llvm-@LLVM_VERSION@-tools (= ${binary:Version}), libclang-cpp@LLVM_VERSION@ (= ${binary:Version}), + libz3-dev, libxml2-dev +Description: Modular compiler and toolchain technologies, libraries and headers + LLVM is a collection of libraries and tools that make it easy to build + compilers, optimizers, just-in-time code generators, and many other + compiler-related programs. + . + LLVM uses a single, language-independent virtual instruction set both + as an offline code representation (to communicate code between + compiler phases and to run-time systems) and as the compiler internal + representation (to analyze and transform programs). This persistent + code representation allows a common set of sophisticated compiler + techniques to be applied at compile-time, link-time, install-time, + run-time, or "idle-time" (between program runs). + . + This package provides the libraries and headers to develop applications + using llvm. + +Package: llvm-@LLVM_VERSION@-tools +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, python3, + python3-pygments, python3-yaml, +# Because of yaml-bench +Description: Modular compiler and toolchain technologies, tools + LLVM is a collection of libraries and tools that make it easy to build + compilers, optimizers, just-in-time code generators, and many other + compiler-related programs. + . + LLVM uses a single, language-independent virtual instruction set both + as an offline code representation (to communicate code between + compiler phases and to run-time systems) and as the compiler internal + representation (to analyze and transform programs). This persistent + code representation allows a common set of sophisticated compiler + techniques to be applied at compile-time, link-time, install-time, + run-time, or "idle-time" (between program runs). + . + This package provides tools for testing. + +Package: libllvm-@LLVM_VERSION@-ocaml-dev +Section: ocaml +Architecture: amd64 arm64 armhf ppc64el s390x riscv64 +Suggests: llvm-@LLVM_VERSION@-doc +Depends: ${shlibs:Depends}, ${misc:Depends}, ${ocaml:Depends}, llvm-@LLVM_VERSION@-dev (= ${binary:Version}) +Replaces: libllvm-x.y-ocaml-dev +Conflicts: libllvm-x.y-ocaml-dev +Provides: ${ocaml:Provides}, libllvm-x.y-ocaml-dev +Description: Modular compiler and toolchain technologies, OCaml bindings + LLVM is a collection of libraries and tools that make it easy to build + compilers, optimizers, just-in-time code generators, and many other + compiler-related programs. + . + LLVM uses a single, language-independent virtual instruction set both + as an offline code representation (to communicate code between + compiler phases and to run-time systems) and as the compiler internal + representation (to analyze and transform programs). This persistent + code representation allows a common set of sophisticated compiler + techniques to be applied at compile-time, link-time, install-time, + run-time, or "idle-time" (between program runs). + . + This package provides the OCaml bindings to develop applications using llvm. + +Package: llvm-@LLVM_VERSION@-doc +Section: doc +Architecture: all +Depends: ${misc:Depends}, libjs-jquery, libjs-underscore +Description: Modular compiler and toolchain technologies, documentation + LLVM is a collection of libraries and tools that make it easy to build + compilers, optimizers, just-in-time code generators, and many other + compiler-related programs. + . + LLVM uses a single, language-independent virtual instruction set both + as an offline code representation (to communicate code between + compiler phases and to run-time systems) and as the compiler internal + representation (to analyze and transform programs). This persistent + code representation allows a common set of sophisticated compiler + techniques to be applied at compile-time, link-time, install-time, + run-time, or "idle-time" (between program runs). + . + This package contains all documentation (extensive). + +Package: llvm-@LLVM_VERSION@-examples +Section: doc +Architecture: all +Depends: ${misc:Depends}, llvm-@LLVM_VERSION@-dev (>= ${source:Version}), llvm-@LLVM_VERSION@-dev (<< ${source:Version}+c~) +Description: Modular compiler and toolchain technologies, examples + LLVM is a collection of libraries and tools that make it easy to build + compilers, optimizers, just-in-time code generators, and many other + compiler-related programs. + . + LLVM uses a single, language-independent virtual instruction set both + as an offline code representation (to communicate code between + compiler phases and to run-time systems) and as the compiler internal + representation (to analyze and transform programs). This persistent + code representation allows a common set of sophisticated compiler + techniques to be applied at compile-time, link-time, install-time, + run-time, or "idle-time" (between program runs). + . + This package contains examples for using LLVM, both in developing + extensions to LLVM and in using it to compile code. + + +# ------------- lld ------------- + +Package: lld-@LLVM_VERSION@ +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}, libllvm@LLVM_VERSION@ (= ${binary:Version}) +Pre-Depends: ${misc:Pre-Depends} +Description: LLVM-based linker + LLD is a new, high-performance linker. It is built as a set of reusable + components which highly leverage existing libraries in the larger LLVM + Project. + +Package: liblld-@LLVM_VERSION@ +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}, libllvm@LLVM_VERSION@ (= ${binary:Version}) +Pre-Depends: ${misc:Pre-Depends} +Section: libs +Description: LLVM-based linker, library + LLD is a new, high-performance linker. It is built as a set of reusable + components which highly leverage existing libraries in the larger LLVM + Project. + . + This package contains the LLD runtime library. + +Package: liblld-@LLVM_VERSION@-dev +Section: libdevel +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-@LLVM_VERSION@ (= ${binary:Version}), + liblld-@LLVM_VERSION@ (= ${binary:Version}) +Pre-Depends: ${misc:Pre-Depends} +Description: LLVM-based linker, header files + LLD is a new, high-performance linker. It is built as a set of reusable + components which highly leverage existing libraries in the larger LLVM + Project. + . + This package provides the header files to build extension over lld. + + +# ------------- lldb ------------- + +Package: lldb-@LLVM_VERSION@ +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}, libllvm@LLVM_VERSION@ (= ${binary:Version}), llvm-@LLVM_VERSION@-dev, + python3-lldb-@LLVM_VERSION@ +Pre-Depends: ${misc:Pre-Depends} +Description: Next generation, high-performance debugger + LLDB is a next generation, high-performance debugger. It is built as a set of + reusable components which highly leverage existing libraries in the larger LLVM + Project, such as the Clang expression parser and LLVM disassembler. + +Package: liblldb-@LLVM_VERSION@ +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}, libllvm@LLVM_VERSION@ (= ${binary:Version}) +Pre-Depends: ${misc:Pre-Depends} +Section: libs +Description: Next generation, high-performance debugger, library + LLDB is a next generation, high-performance debugger. It is built as a set of + reusable components which highly leverage existing libraries in the larger LLVM + Project, such as the Clang expression parser and LLVM disassembler. + . + This package contains the LLDB runtime library. + +Package: python3-lldb-@LLVM_VERSION@ +Section: python +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-@LLVM_VERSION@ (= ${binary:Version}), python3-six +Conflicts: python3-lldb-x.y +Replaces: python3-lldb-x.y +Provides: python3-lldb-x.y +Pre-Depends: ${misc:Pre-Depends} +Description: Next generation, high-performance debugger, python3 lib + LLDB is a next generation, high-performance debugger. It is built as a set of + reusable components which highly leverage existing libraries in the larger LLVM + Project, such as the Clang expression parser and LLVM disassembler. + . + This binding package provides access to lldb. + +Package: liblldb-@LLVM_VERSION@-dev +Section: libdevel +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-@LLVM_VERSION@ (= ${binary:Version}) +Pre-Depends: ${misc:Pre-Depends} +Description: Next generation, high-performance debugger, header files + LLDB is a next generation, high-performance debugger. It is built as a set of + reusable components which highly leverage existing libraries in the larger LLVM + Project, such as the Clang expression parser and LLVM disassembler. + . + This package provides the header files to build extension over lldb. + + +# ------------- openmp ------------- +# 44 because it was the first version in which openmp & libc++ have been +# managed in llvm-defaults + +Package: libomp-@LLVM_VERSION@-dev +Section: libdevel +Architecture: amd64 arm64 armhf i386 mips64el ppc64el ppc64 riscv64 +Depends: libomp5-@LLVM_VERSION@ (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Suggests: libomp-@LLVM_VERSION@-doc +Breaks: libiomp-dev (<< 3.7-1), libomp-dev (<< 44), llvm-@LLVM_VERSION@ (<< 1:14~++20211011113307+f7ca54289c14) +Provides: libomp-x.y-dev +Conflicts: libomp-x.y-dev +Replaces: libomp-x.y-dev, llvm-@LLVM_VERSION@ (<< 1:14~++20211011113307+f7ca54289c14) +Description: LLVM OpenMP runtime - dev package + The runtime is the part of the OpenMP implementation that your code is + linked against, and that manages the multiple threads in an OpenMP program + while it is executing. + +Package: libomp5-@LLVM_VERSION@ +Multi-Arch: same +Architecture: amd64 arm64 armhf i386 mips64el ppc64el ppc64 riscv64 +Depends: ${shlibs:Depends}, ${misc:Depends} +Breaks: libomp5 (<< 44) +Provides: libomp-x.y +Conflicts: libomp-x.y +Replaces: libomp-x.y +Description: LLVM OpenMP runtime + The runtime is the part of the OpenMP implementation that your code is + linked against, and that manages the multiple threads in an OpenMP program + while it is executing. + +Package: libomp-@LLVM_VERSION@-doc +Section: doc +Architecture: amd64 arm64 armhf i386 mips64el ppc64el ppc64 riscv64 +Depends: ${shlibs:Depends}, ${misc:Depends}, libjs-jquery +Replaces: libiomp-x.y-doc +Breaks: libiomp-x.y-doc +Description: LLVM OpenMP runtime - Documentation + The runtime is the part of the OpenMP implementation that your code is + linked against, and that manages the multiple threads in an OpenMP program + while it is executing. + . + This package contains the documentation of this package. + +# ------------- libcxx ------------- + +Package: libc++1-@LLVM_VERSION@ +Section: libs +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} +Suggests: clang +Breaks: libc++1 (<< 44) +Provides: libc++-x.y +Conflicts: libc++-x.y +Replaces: libc++-x.y +Description: LLVM C++ Standard library + libc++ is another implementation of the C++ standard library. + . + Features and Goals + . + * Correctness as defined by the C++ standards. + * Fast execution. + * Minimal memory use. + * Fast compile times. + * ABI compatibility with gcc's libstdc++ for some low-level features such + as exception objects, rtti and memory allocation. + * Extensive unit tests. + +Package: libc++-@LLVM_VERSION@-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: libc++1-@LLVM_VERSION@ (= ${binary:Version}), ${misc:Depends}, + libunwind-@LLVM_VERSION@-dev [amd64 arm64 armhf i386 mips64el ppc64el ppc64 riscv64] +Breaks: libc++-dev (<< 44) +Provides: libc++-x.y-dev +Conflicts: libc++-x.y-dev +Replaces: libc++-x.y-dev +Description: LLVM C++ Standard library (development files) + libc++ is another implementation of the C++ standard library + . + Features and Goals + . + * Correctness as defined by the C++ standards. + * Fast execution. + * Minimal memory use. + * Fast compile times. + * ABI compatibility with gcc's libstdc++ for some low-level features such + as exception objects, rtti and memory allocation. + * Extensive unit tests. + +Package: libc++-@LLVM_VERSION@-dev-wasm32 +Section: libdevel +Architecture: all +Multi-Arch: foreign +Depends: wasi-libc, libc++abi-@LLVM_VERSION@-dev-wasm32, ${misc:Depends} +Provides: libc++-x.y-dev-wasm32 +Conflicts: libc++-x.y-dev-wasm32 +Replaces: libc++-x.y-dev-wasm32 +Description: LLVM C++ Standard library (WASI) + libc++ is another implementation of the C++ standard library + . + Features and Goals + . + * Correctness as defined by the C++ standards. + * Fast execution. + * Minimal memory use. + * Fast compile times. + * ABI compatibility with gcc's libstdc++ for some low-level features such + as exception objects, rtti and memory allocation. + * Extensive unit tests. + . + This package provides a version for the 32-bit WebAssembly System Interface. + +# ------------- libcxxabi ------------- + +Package: libc++abi1-@LLVM_VERSION@ +Section: libs +Architecture: any +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Depends: ${shlibs:Depends}, ${misc:Depends} +Breaks: libc++abi1 (<< 44) +Provides: libc++abi-x.y +Conflicts: libc++abi-x.y +Replaces: libc++abi-x.y +Description: LLVM low level support for a standard C++ library + libc++abi is another implementation of low level support for a standard C++ + library. + . + Features and Goals + . + * Correctness as defined by the C++ standards. + * Provide a portable sublayer to ease the porting of libc++ + +Package: libc++abi-@LLVM_VERSION@-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: libc++abi1-@LLVM_VERSION@ (= ${binary:Version}), ${misc:Depends} +Breaks: libc++abi-dev (<= 44) +Provides: libc++abi-x.y-dev +Conflicts: libc++abi-x.y-dev +Replaces: libc++abi-x.y-dev +Description: LLVM low level support for a standard C++ library (development files) + libc++abi is another implementation of low level support for a standard C++ + library. + . + Features and Goals + . + * Correctness as defined by the C++ standards. + * Provide a portable sublayer to ease the porting of libc++ + +Package: libc++abi-@LLVM_VERSION@-dev-wasm32 +Section: libdevel +Architecture: all +Multi-Arch: foreign +Depends: wasi-libc, ${misc:Depends} +Provides: libc++abi-x.y-dev-wasm32 +Conflicts: libc++abi-x.y-dev-wasm32 +Replaces: libc++abi-x.y-dev-wasm32 +Description: LLVM low level support for a standard C++ library (WASI) + libc++abi is another implementation of low level support for a standard C++ + library. + . + Features and Goals + . + * Correctness as defined by the C++ standards. + * Provide a portable sublayer to ease the porting of libc++ + . + This package provides a version for the 32-bit WebAssembly System Interface. + +# ------------- libclc ------------- + +Package: libclc-@LLVM_VERSION@ +Section: libs +Architecture: all +Multi-Arch: foreign +Depends: + ${misc:Depends}, + libclc-@LLVM_VERSION@-dev (= ${binary:Version}), + libclang-common-@LLVM_VERSION@-dev, +Breaks: libclc-amdgcn, libclc-ptx, libclc-r600 +Provides: libclc-x.y +Conflicts: libclc-x.y +Replaces: libclc-x.y, libclc-amdgcn, libclc-ptx, libclc-r600, +Description: OpenCL C language implementation - platform support + libclc is an open implementation of the OpenCL C programming language, + as specified by the OpenCL 1.1 Specification. + . + This package contains support for the amdgcn (AMD GPU), PTX and r600 + platforms. + +Package: libclc-@LLVM_VERSION@-dev +Section: libdevel +Architecture: all +Multi-Arch: foreign +Depends: + ${misc:Depends}, +Breaks: libclc-dev +Provides: libclc-x.y-dev +Conflicts: libclc-x.y-dev +Replaces: libclc-dev, libclc-x.y-dev +Description: OpenCL C language implementation - development files + libclc is an open implementation of the OpenCL C programming language, + as specified by the OpenCL 1.1 Specification. + . + This package contains development header files. + +# ------------- libunwind ------------- + +Package: libunwind-@LLVM_VERSION@ +Section: libs +Architecture: amd64 arm64 armhf i386 mips64el ppc64el ppc64 riscv64 +Multi-Arch: same +Depends: ${shlibs:Depends}, + ${misc:Depends} +Provides: libunwind-x.y +Conflicts: libunwind-x.y +Replaces: libunwind-x.y +Description: production-quality unwinder + libunwind is a production-quality unwinder, with platform support for DWARF + unwind info, SjLj, and ARM EHABI. + . + The low level libunwind API was designed to work either in-process (aka local) + or to operate on another process (aka remote), but only the local path has + been implemented. Remote unwinding remains as future work. + +Package: libunwind-@LLVM_VERSION@-dev +Section: libdevel +Architecture: amd64 arm64 armhf i386 mips64el ppc64el ppc64 riscv64 +Multi-Arch: same +Depends: + ${misc:Depends}, + libunwind-@LLVM_VERSION@ (= ${binary:Version}) +Provides: libunwind-dev, libunwind-x.y-dev +Conflicts: libunwind-dev, libunwind-x.y-dev +Replaces: libunwind-dev, libunwind-x.y-dev +Description: production-quality unwinder + libunwind is a production-quality unwinder, with platform support for DWARF + unwind info, SjLj, and ARM EHABI. + . + The low level libunwind API was designed to work either in-process (aka local) + or to operate on another process (aka remote), but only the local path has + been implemented. Remote unwinding remains as future work. + +# ------------- mlir ------------- + +Package: mlir-@LLVM_VERSION@-tools +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Multi-Level Intermediate Representation tools + Novel approach to building reusable and extensible compiler infrastructure. + MLIR aims to address software fragmentation, improve compilation for + heterogeneous hardware, significantly reduce the cost of building domain + specific compilers, and aid in connecting existing compilers together. + . + This package provides tools. + +Package: libmlir-@LLVM_VERSION@ +Section: libs +Architecture: any +Multi-Arch: same +Depends: ${shlibs:Depends}, + ${misc:Depends} +Provides: libmlir-x.y +Conflicts: libmlir-x.y +Replaces: libmlir-x.y +Description: Multi-Level Intermediate Representation library + Novel approach to building reusable and extensible compiler infrastructure. + MLIR aims to address software fragmentation, improve compilation for + heterogeneous hardware, significantly reduce the cost of building domain + specific compilers, and aid in connecting existing compilers together. + + +Package: libmlir-@LLVM_VERSION@-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Depends: + ${misc:Depends}, + libmlir-@LLVM_VERSION@ (= ${binary:Version}) +Breaks: libmlir-dev +Provides: libmlir-x.y-dev +Conflicts: libmlir-x.y-dev +Replaces: libmlir-dev, libmlir-x.y-dev +Description: Multi-Level Intermediate Representation library + Novel approach to building reusable and extensible compiler infrastructure. + MLIR aims to address software fragmentation, improve compilation for + heterogeneous hardware, significantly reduce the cost of building domain + specific compilers, and aid in connecting existing compilers together. + + diff --git a/debian/rules b/debian/rules index 2b389879..93e9f558 100755 --- a/debian/rules +++ b/debian/rules @@ -20,6 +20,13 @@ ifeq ($(LLVM_VERSION),$(LLVM_VERSION_FULL)) LLVM_VERSION_FULL := $(LLVM_VERSION).0.0 endif +SOURCE_NAME := $(shell dpkg-parsechangelog -S Source) +ifneq (,$(findstring snapshot,$(SOURCE_NAME))) + BRANCH_NAME=snapshot +else + BRANCH_NAME=$(LLVM_VERSION) +endif + SONAME_EXT := 1 # clang soname has started with llvm-toolchain-13. # it is normal that 13 is what is seen in 14 or later version as @@ -473,6 +480,7 @@ preconfigure: f2=$$(echo $$f | sed 's/\.in$$//;s/X\.Y/$(LLVM_VERSION)/'); \ echo "$$f => $$f2"; \ sed -e 's|@DEB_HOST_MULTIARCH@|$(DEB_HOST_MULTIARCH)|g' \ + -e "s|@BRANCH_NAME@|$(BRANCH_NAME)|g" \ -e "s|@OCAML_STDLIB_DIR@|$(OCAML_STDLIB_DIR)|g" \ -e "s|@LLVM_VERSION_FULL@|$(LLVM_VERSION_FULL)|g" \ -e "s|@LLVM_VERSION@|$(LLVM_VERSION)|g" $$f > $$f2; \ From 3b5da5d9fdd340da09e2e1c08f24b8912390559a Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 19 Dec 2022 11:10:19 +0100 Subject: [PATCH 16/38] * Transform debian/control into debian/control.in (preparation for flang support) * Try to unbreak the builds with wasm --- debian/changelog | 10 +++++++--- debian/rules | 16 ++++++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 5b72a647..a0c69853 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,12 @@ -llvm-toolchain-14 (1:14.0.6-10~exp2) UNRELEASED; urgency=medium +llvm-toolchain-14 (1:14.0.6-10~exp3) UNRELEASED; urgency=medium - * transform debian/control into debian/control.in + * Transform debian/control into debian/control.in (preparation for + flang support) - -- Sylvestre Ledru Sat, 10 Dec 2022 16:34:17 +0100 + [ Faidon Liambotis ] + * Try to unbreak the builds with wasm + + -- Sylvestre Ledru Mon, 19 Dec 2022 11:09:58 +0100 llvm-toolchain-14 (1:14.0.6-10~exp1) experimental; urgency=medium diff --git a/debian/rules b/debian/rules index 93e9f558..821e7f4d 100755 --- a/debian/rules +++ b/debian/rules @@ -1162,6 +1162,16 @@ else endif endif dh_install --fail-missing +# Move the libc+ abi files from libc++ to libc++-abi for the wasm32 packages +# These packages are arch: all, so only do so when the packages are built +ifneq (,$(filter libc++-$(LLVM_VERSION)-dev-wasm32, $(shell dh_listpackages))) + mkdir -p $(CURDIR)/debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1 + mv $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/__cxxabi_config.h \ + $(CURDIR)/debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/__cxxabi_config.h + mv $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/cxxabi.h \ + $(CURDIR)/debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/cxxabi.h +endif + override_dh_installdeb: # Managed by the package @@ -1178,12 +1188,6 @@ override_dh_installdeb: # Remove some libc++ abi files in the libc++ file. See bug #969274 rm -f $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/c++/__cxxabi_config.h $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/c++/cxxabi.h - mkdir -p $(CURDIR)/debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1 - mv $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/__cxxabi_config.h \ - $(CURDIR)/debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/__cxxabi_config.h - mv $(CURDIR)/debian/libc++-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/cxxabi.h \ - $(CURDIR)/debian/libc++abi-$(LLVM_VERSION)-dev-wasm32/usr/lib/llvm-$(LLVM_VERSION)/include/wasm32-wasi/c++/v1/cxxabi.h - # Remove auto generated python pyc find $(CURDIR)/debian/llvm-$(LLVM_VERSION)-tools/usr/lib/llvm-$(LLVM_VERSION)/ -name '*.pyc' | xargs -r rm -f From 0e2e9334ef00d3474f595a204fd83752210ce917 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 19 Dec 2022 11:20:13 +0100 Subject: [PATCH 17/38] do not delete control.in --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index 821e7f4d..a28bcb7c 100755 --- a/debian/rules +++ b/debian/rules @@ -1284,7 +1284,7 @@ override_dh_auto_clean: rm -rf $(TARGET_BUILD) 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"` + rm -f `ls debian/*.in|grep -v control.in|sed -e "s|.in$$||g"` find utils -name '*.pyc' | xargs -r rm -f # Use -I because a test has a space in its name find lldb/test -iname '*.pyc' | xargs -I{} -r rm -f {} From 7eed507f83196d3471440a08aec19ff70a08ff73 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 19 Dec 2022 16:05:22 +0100 Subject: [PATCH 18/38] Remove old removals --- debian/rules | 4 ---- 1 file changed, 4 deletions(-) diff --git a/debian/rules b/debian/rules index a28bcb7c..e23d6dad 100755 --- a/debian/rules +++ b/debian/rules @@ -1288,10 +1288,6 @@ override_dh_auto_clean: find utils -name '*.pyc' | xargs -r rm -f # Use -I because a test has a space in its name find lldb/test -iname '*.pyc' | xargs -I{} -r rm -f {} - find test -name '*.pyc' -o -name '*.cm[ix]' | xargs -r rm -f - find test/Bindings -name '*.o' | xargs -r rm -f - rm -f tools/clang tools/polly tools/lld tools/lldb projects/compiler-rt - rm -rf tools/clang/tools/extra clang/tools/extra/ rm -f $(CURDIR)/utils/vim/llvm-$(LLVM_VERSION).vim $(CURDIR)/utils/vim/tablegen-$(LLVM_VERSION).vim rm -f $(CURDIR)/clang/tools/clang-format/clang-format-diff-$(LLVM_VERSION) rm -f $(CURDIR)/clang/tools/clang-format/clang-format-$(LLVM_VERSION).py From 2c450a09ecc8fced0263de70541664b00feb1799 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 19 Dec 2022 16:11:45 +0100 Subject: [PATCH 19/38] fix the clean --- debian/rules | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index e23d6dad..dff31e6c 100755 --- a/debian/rules +++ b/debian/rules @@ -1297,8 +1297,10 @@ override_dh_auto_clean: mv lld/docs/ld.lld-$(LLVM_VERSION).1 lld/docs/ld.lld.1; \ fi for f in debian/*.in; do \ - f2=$$(echo $$f | sed 's/\.in$$//;s/X\.Y/$(LLVM_VERSION)/'); \ - rm -f $$f2; \ + if ! echo $$f|grep control; then \ + f2=$$(echo $$f | sed 's/\.in$$//;s/X\.Y/$(LLVM_VERSION)/'); \ + rm -f $$f2; \ + fi; \ done if test "$(SCAN_BUILD)" = "yes"; then \ patch -f -R -p1 < debian/patches/on-the-fly/use-scan-build-runtimes.diff||true; \ From fabb4d2349ff188b513985190e45dde64ee5ef52 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 19 Dec 2022 17:06:53 +0100 Subject: [PATCH 20/38] Do not install wasm-libc if doesn't exist --- debian/changelog | 1 + debian/control | 2 +- debian/control.in | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index a0c69853..5d92030c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ llvm-toolchain-14 (1:14.0.6-10~exp3) UNRELEASED; urgency=medium * Transform debian/control into debian/control.in (preparation for flang support) + * Do not install wasm-libc if doesn't exist [ Faidon Liambotis ] * Try to unbreak the builds with wasm diff --git a/debian/control b/debian/control index 9883345b..90521a47 100644 --- a/debian/control +++ b/debian/control @@ -24,7 +24,7 @@ Build-Depends: debhelper (>= 10.0), cmake, ninja-build, libpfm4-dev [linux-any], python3-setuptools, libz3-dev, llvm-spirv-14 [ amd64 arm64 armel armhf mips64el mipsel ppc64el s390x ] | hello [!i386], spirv-tools [ linux-any ] | hello [ !i386], - wasi-libc, + wasi-libc | hello [ !i386], libcurl4-dev, libgrpc++-dev [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x], protobuf-compiler-grpc [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x], diff --git a/debian/control.in b/debian/control.in index 3cebecc8..49b1d96f 100644 --- a/debian/control.in +++ b/debian/control.in @@ -24,7 +24,7 @@ Build-Depends: debhelper (>= 10.0), cmake, ninja-build, libpfm4-dev [linux-any], python3-setuptools, libz3-dev, llvm-spirv-14 [ amd64 arm64 armel armhf mips64el mipsel ppc64el s390x ] | hello [!i386], spirv-tools [ linux-any ] | hello [ !i386], - wasi-libc, + wasi-libc | hello [ !i386], libcurl4-dev, libgrpc++-dev [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x], protobuf-compiler-grpc [amd64 arm64 armel armhf mips64el mipsel ppc64 ppc64el powerpc riscv64 s390x], From 882ec835f6e3b159c43ad834b231267f6b07038a Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 19 Dec 2022 17:07:17 +0100 Subject: [PATCH 21/38] prepare upload --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 5d92030c..c55e004b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -llvm-toolchain-14 (1:14.0.6-10~exp3) UNRELEASED; urgency=medium +llvm-toolchain-14 (1:14.0.6-10~exp3) experimental; urgency=medium * Transform debian/control into debian/control.in (preparation for flang support) From d24f4d88f13021fca6afe9ce9d087c71362af2cf Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 24 Dec 2022 12:13:45 +0100 Subject: [PATCH 22/38] * Move the compiler-rt content into a new package called libclang-rt-X.Y-dev (including polly) * the wasm targets are shipped into libclang-rt-14-dev-wasm32 and libclang-rt-14-dev-wasm64 * libclang-common-X.Y-dev arch moved to all --- debian/changelog | 10 ++++ debian/control | 48 +++++++++++++++++-- debian/control.in | 48 +++++++++++++++++-- debian/libclang-common-X.Y-dev.install.in | 16 +++---- debian/libclang-rt-X.Y-dev-wasm32.install.in | 2 + ...ang-rt-X.Y-dev-wasm32.lintian-overrides.in | 4 ++ debian/libclang-rt-X.Y-dev-wasm64.install.in | 2 + ...ang-rt-X.Y-dev-wasm64.lintian-overrides.in | 4 ++ debian/libclang-rt-X.Y-dev.install.in | 9 ++++ .../libclang-rt-X.Y-dev.lintian-overrides.in | 2 + debian/rules | 6 ++- 11 files changed, 133 insertions(+), 18 deletions(-) create mode 100644 debian/libclang-rt-X.Y-dev-wasm32.install.in create mode 100644 debian/libclang-rt-X.Y-dev-wasm32.lintian-overrides.in create mode 100644 debian/libclang-rt-X.Y-dev-wasm64.install.in create mode 100644 debian/libclang-rt-X.Y-dev-wasm64.lintian-overrides.in create mode 100644 debian/libclang-rt-X.Y-dev.install.in create mode 100644 debian/libclang-rt-X.Y-dev.lintian-overrides.in diff --git a/debian/changelog b/debian/changelog index c55e004b..8c6c311d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +llvm-toolchain-14 (1:14.0.6-10~exp4) UNRELEASED; urgency=medium + + * Move the compiler-rt content into a new package called + libclang-rt-X.Y-dev (including polly) + * the wasm targets are shipped into libclang-rt-14-dev-wasm32 + and libclang-rt-14-dev-wasm64 + * libclang-common-X.Y-dev arch moved to all + + -- Sylvestre Ledru Wed, 21 Dec 2022 13:48:40 +0100 + llvm-toolchain-14 (1:14.0.6-10~exp3) experimental; urgency=medium * Transform debian/control into debian/control.in (preparation for diff --git a/debian/control b/debian/control index 90521a47..7d0c85db 100644 --- a/debian/control +++ b/debian/control @@ -16,7 +16,7 @@ Build-Depends: debhelper (>= 10.0), cmake, ninja-build, lcov, procps, help2man, zlib1g-dev, g++-multilib [amd64 i386 kfreebsd-amd64 mips64 mips64el mipsel powerpc ppc64 s390 s390x sparc sparc64 x32], libjs-mathjax, python3-recommonmark, - doxygen, gfortran, + doxygen, ocaml-base [amd64 arm64 armhf ppc64el riscv64 s390x] | ocaml-nox [amd64 arm64 armhf ppc64el riscv64 s390x], ocaml-findlib [amd64 arm64 armhf ppc64el riscv64 s390x], libctypes-ocaml-dev [amd64 arm64 armhf ppc64el riscv64 s390x], @@ -167,9 +167,10 @@ Description: Clang library - Development package libclang1-14. Package: libclang-common-14-dev -Architecture: any +Architecture: all Section: libdevel Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm14 (= ${binary:Version}) +Recommends: libclang-rt-14-dev (>= 14.0.6-10~exp4) Description: Clang library - Common development package Clang project is a C, C++, Objective C and Objective C++ front-end based on the LLVM compiler. Its goal is to offer a replacement to the @@ -178,8 +179,47 @@ Description: Clang library - Common development package Clang implements all of the ISO C++ 1998, 11, 14 and 17 standards and also provides most of the support of C++20. . - This package contains the Clang generic headers and some libraries - (profiling, etc). + This package contains the Clang generic headers. + +Package: libclang-rt-14-dev +Architecture: any +Multi-Arch: same +Section: libdevel +Breaks: libclang-common-14-dev (<< 14.0.6-10~exp4) +Replaces: libclang-common-14-dev (<< 14.0.6-10~exp4) +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Compiler-rt - development package + This package provides various libraries: + . + * builtins - Simple libraries that provide implementation of the + low-level target-specific hooks required by code generation + and other runtime components. + * sanitizer runtimes - AddressSanitizer, ThreadSanitizer, + UndefinedBehaviorSanitizer, MemorySanitizer, LeakSanitizer + DataFlowSanitizer, etc + * profile - Library which is used to collect coverage information. + +Package: libclang-rt-14-dev-wasm32 +Architecture: all +Multi-Arch: foreign +Section: libdevel +Breaks: libclang-common-14-dev (<< 14.0.6-10~exp4) +Replaces: libclang-common-14-dev (<< 14.0.6-10~exp4) +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: libclang-common-14-dev (>= 14.0.6-10~exp4) +Description: Compiler-rt - wasm32 builtins + Provides the compiler-rt builtins for WebAssembly 32 bits + +Package: libclang-rt-14-dev-wasm64 +Architecture: all +Multi-Arch: foreign +Section: libdevel +Breaks: libclang-common-14-dev (<< 14.0.6-10~exp4) +Replaces: libclang-common-14-dev (<< 14.0.6-10~exp4) +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: libclang-common-14-dev (>= 14.0.6-10~exp4) +Description: Compiler-rt - development package + Provides the compiler-rt builtins for WebAssembly 32 bits Package: libclang-cpp14 Section: libs diff --git a/debian/control.in b/debian/control.in index 49b1d96f..c88e3471 100644 --- a/debian/control.in +++ b/debian/control.in @@ -16,7 +16,7 @@ Build-Depends: debhelper (>= 10.0), cmake, ninja-build, lcov, procps, help2man, zlib1g-dev, g++-multilib [amd64 i386 kfreebsd-amd64 mips64 mips64el mipsel powerpc ppc64 s390 s390x sparc sparc64 x32], libjs-mathjax, python3-recommonmark, - doxygen, gfortran, + doxygen, ocaml-base [amd64 arm64 armhf ppc64el riscv64 s390x] | ocaml-nox [amd64 arm64 armhf ppc64el riscv64 s390x], ocaml-findlib [amd64 arm64 armhf ppc64el riscv64 s390x], libctypes-ocaml-dev [amd64 arm64 armhf ppc64el riscv64 s390x], @@ -167,9 +167,10 @@ Description: Clang library - Development package libclang1-@LLVM_VERSION@. Package: libclang-common-@LLVM_VERSION@-dev -Architecture: any +Architecture: all Section: libdevel Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm@LLVM_VERSION@ (= ${binary:Version}) +Recommends: libclang-rt-@LLVM_VERSION@-dev (>= 14.0.6-10~exp4) Description: Clang library - Common development package Clang project is a C, C++, Objective C and Objective C++ front-end based on the LLVM compiler. Its goal is to offer a replacement to the @@ -178,8 +179,47 @@ Description: Clang library - Common development package Clang implements all of the ISO C++ 1998, 11, 14 and 17 standards and also provides most of the support of C++20. . - This package contains the Clang generic headers and some libraries - (profiling, etc). + This package contains the Clang generic headers. + +Package: libclang-rt-@LLVM_VERSION@-dev +Architecture: any +Multi-Arch: same +Section: libdevel +Breaks: libclang-common-@LLVM_VERSION@-dev (<< 14.0.6-10~exp4) +Replaces: libclang-common-@LLVM_VERSION@-dev (<< 14.0.6-10~exp4) +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Compiler-rt - development package + This package provides various libraries: + . + * builtins - Simple libraries that provide implementation of the + low-level target-specific hooks required by code generation + and other runtime components. + * sanitizer runtimes - AddressSanitizer, ThreadSanitizer, + UndefinedBehaviorSanitizer, MemorySanitizer, LeakSanitizer + DataFlowSanitizer, etc + * profile - Library which is used to collect coverage information. + +Package: libclang-rt-@LLVM_VERSION@-dev-wasm32 +Architecture: all +Multi-Arch: foreign +Section: libdevel +Breaks: libclang-common-@LLVM_VERSION@-dev (<< 14.0.6-10~exp4) +Replaces: libclang-common-@LLVM_VERSION@-dev (<< 14.0.6-10~exp4) +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: libclang-common-@LLVM_VERSION@-dev (>= 14.0.6-10~exp4) +Description: Compiler-rt - wasm32 builtins + Provides the compiler-rt builtins for WebAssembly 32 bits + +Package: libclang-rt-@LLVM_VERSION@-dev-wasm64 +Architecture: all +Multi-Arch: foreign +Section: libdevel +Breaks: libclang-common-@LLVM_VERSION@-dev (<< 14.0.6-10~exp4) +Replaces: libclang-common-@LLVM_VERSION@-dev (<< 14.0.6-10~exp4) +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: libclang-common-@LLVM_VERSION@-dev (>= 14.0.6-10~exp4) +Description: Compiler-rt - development package + Provides the compiler-rt builtins for WebAssembly 32 bits Package: libclang-cpp@LLVM_VERSION@ Section: libs diff --git a/debian/libclang-common-X.Y-dev.install.in b/debian/libclang-common-X.Y-dev.install.in index 303ed2ca..c856e801 100644 --- a/debian/libclang-common-X.Y-dev.install.in +++ b/debian/libclang-common-X.Y-dev.install.in @@ -1,9 +1,9 @@ -#!/usr/bin/dh-exec +#usr/lib/llvm-@LLVM_VERSION@/include/polly -usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/include - -usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/lib -usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/*.txt -usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/share/*.txt - -[!powerpc !powerpcspe] usr/lib/llvm-@LLVM_VERSION@/lib/libPolly*.a +usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/include/*.h +usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/include/module.modulemap +usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/include/xray/ +usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/include/profile/ +usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/include/ppc_wrappers/ +usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/include/openmp_wrappers/ +usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/include/cuda_wrappers/ diff --git a/debian/libclang-rt-X.Y-dev-wasm32.install.in b/debian/libclang-rt-X.Y-dev-wasm32.install.in new file mode 100644 index 00000000..2f223e7f --- /dev/null +++ b/debian/libclang-rt-X.Y-dev-wasm32.install.in @@ -0,0 +1,2 @@ +usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/lib/wasi/libclang_rt.builtins-wasm32.a + diff --git a/debian/libclang-rt-X.Y-dev-wasm32.lintian-overrides.in b/debian/libclang-rt-X.Y-dev-wasm32.lintian-overrides.in new file mode 100644 index 00000000..47b7f52f --- /dev/null +++ b/debian/libclang-rt-X.Y-dev-wasm32.lintian-overrides.in @@ -0,0 +1,4 @@ +libclang-rt-@LLVM_VERSION@-dev-wasm32: arch-independent-package-contains-binary-or-object *usr/lib/llvm-@LLVM_VERSION@/lib/* +libclang-rt-@LLVM_VERSION@-dev-wasm32: arch-dependent-file-not-in-arch-specific-directory *usr/lib/llvm-@LLVM_VERSION@/lib/* +# wasm code +libclang-rt-@LLVM_VERSION@-dev-wasm32: no-code-sections *usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/lib/wasi/libclang_rt.builtins-wasm32.a* diff --git a/debian/libclang-rt-X.Y-dev-wasm64.install.in b/debian/libclang-rt-X.Y-dev-wasm64.install.in new file mode 100644 index 00000000..b8594282 --- /dev/null +++ b/debian/libclang-rt-X.Y-dev-wasm64.install.in @@ -0,0 +1,2 @@ +usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/lib/wasi/libclang_rt.builtins-wasm64.a + diff --git a/debian/libclang-rt-X.Y-dev-wasm64.lintian-overrides.in b/debian/libclang-rt-X.Y-dev-wasm64.lintian-overrides.in new file mode 100644 index 00000000..a3a81721 --- /dev/null +++ b/debian/libclang-rt-X.Y-dev-wasm64.lintian-overrides.in @@ -0,0 +1,4 @@ +libclang-rt-@LLVM_VERSION@-dev-wasm64: arch-independent-package-contains-binary-or-object *usr/lib/llvm-@LLVM_VERSION@/lib/* +libclang-rt-@LLVM_VERSION@-dev-wasm64: arch-dependent-file-not-in-arch-specific-directory *usr/lib/llvm-@LLVM_VERSION@/lib/* +# wasm code +libclang-rt-@LLVM_VERSION@-dev-wasm64: no-code-sections *usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/lib/wasi/libclang_rt.builtins-wasm64.a* diff --git a/debian/libclang-rt-X.Y-dev.install.in b/debian/libclang-rt-X.Y-dev.install.in new file mode 100644 index 00000000..2116c799 --- /dev/null +++ b/debian/libclang-rt-X.Y-dev.install.in @@ -0,0 +1,9 @@ +#!/usr/bin/dh-exec + +usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/share/*.txt +usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/include/sanitizer/ +usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/lib/linux/*clang_rt* +usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/README.txt +usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/include/fuzzer/ + +[!powerpc !powerpcspe] usr/lib/llvm-@LLVM_VERSION@/lib/libPolly*.a diff --git a/debian/libclang-rt-X.Y-dev.lintian-overrides.in b/debian/libclang-rt-X.Y-dev.lintian-overrides.in new file mode 100644 index 00000000..5c99be12 --- /dev/null +++ b/debian/libclang-rt-X.Y-dev.lintian-overrides.in @@ -0,0 +1,2 @@ +libclang-rt-@LLVM_VERSION@-dev: arch-dependent-file-not-in-arch-specific-directory *usr/lib/llvm-@LLVM_VERSION@/lib/* +libclang-rt-@LLVM_VERSION@-dev: no-code-sections *usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/lib/linux/libclang_rt.asan_static-i386.a* \ No newline at end of file diff --git a/debian/rules b/debian/rules index dff31e6c..6bfb8f81 100755 --- a/debian/rules +++ b/debian/rules @@ -490,7 +490,7 @@ preconfigure: chmod +x \ debian/clang-tools-$(LLVM_VERSION).install \ debian/libclang-$(LLVM_VERSION)-dev.install \ - debian/libclang-common-$(LLVM_VERSION)-dev.install \ + debian/libclang-rt-$(LLVM_VERSION)-dev.install \ debian/libomp-$(LLVM_VERSION)-dev.install \ debian/llvm-$(LLVM_VERSION)-dev.install \ debian/llvm-$(LLVM_VERSION)-linker-tools.install \ @@ -932,6 +932,8 @@ override_dh_auto_install: # Only run on executable, not script chrpath -d `find $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/bin/ -type f -executable -exec file -i '{}' \; | grep 'x-executable; charset=binary'|cut -d: -f1` + # To fix custom-library-search-path + chrpath -d $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/clang/$(LLVM_VERSION)*/lib/linux/*.so : # libclang cd debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib/ && \ @@ -1308,6 +1310,6 @@ override_dh_auto_clean: : # for some reason, the docs are written to debian/usr and debian/man ... rm -rf debian/usr debian/man : # remove extra stamps - rm -f debian-*-build + rm -f debian-*-build override_dh_auto_install sccache-stats build_doc .PHONY: override_dh_strip preconfigure From d98af97b4bdf2e897b21098fd471bef3213f087f Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 24 Dec 2022 12:16:38 +0100 Subject: [PATCH 23/38] also install them --- debian/qualify-clang.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 385cf5a7..8c202fbc 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -9,7 +9,8 @@ VERSION=$(dpkg-parsechangelog | sed -rne "s,^Version: 1:([0-9]+).*,\1,p") DETAILED_VERSION=$(dpkg-parsechangelog | sed -rne "s,^Version: 1:([0-9.]+)(~|-)(.*),\1\2\3,p") DEB_HOST_ARCH=$(dpkg-architecture -qDEB_HOST_ARCH) -LIST="libomp5-${VERSION}_${DETAILED_VERSION}_amd64.deb libomp-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb lldb-${VERSION}_${DETAILED_VERSION}_amd64.deb python3-lldb-${VERSION}_${DETAILED_VERSION}_amd64.deb libllvm${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb liblldb-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang1-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-common-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}_${DETAILED_VERSION}_amd64.deb liblldb-${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-runtime_${DETAILED_VERSION}_amd64.deb lld-${VERSION}_${DETAILED_VERSION}_amd64.deb libfuzzer-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++abi-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++1-${VERSION}_${DETAILED_VERSION}_amd64.deb libc++abi1-${VERSION}_${DETAILED_VERSION}_amd64.deb clang-${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-tools_${DETAILED_VERSION}_amd64.deb clang-tools-${VERSION}_${DETAILED_VERSION}_amd64.deb clangd-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-cpp${VERSION}_${DETAILED_VERSION}_amd64.deb clang-tidy-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-cpp${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclc-${VERSION}_${DETAILED_VERSION}_all.deb libclc-${VERSION}-dev_${DETAILED_VERSION}_all.deb llvm-${VERSION}-linker-tools_${DETAILED_VERSION}_amd64.deb libunwind-${VERSION}_${DETAILED_VERSION}_amd64.deb libunwind-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libmlir-${VERSION}_${DETAILED_VERSION}_amd64.deb libmlir-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb" +LIST="libomp5-${VERSION}_${DETAILED_VERSION}_amd64.deb libomp-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb lldb-${VERSION}_${DETAILED_VERSION}_amd64.deb python3-lldb-${VERSION}_${DETAILED_VERSION}_amd64.deb libllvm${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb liblldb-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang1-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-common-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}_${DETAILED_VERSION}_amd64.deb liblldb-${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-runtime_${DETAILED_VERSION}_amd64.deb lld-${VERSION}_${DETAILED_VERSION}_amd64.deb libfuzzer-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++abi-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++1-${VERSION}_${DETAILED_VERSION}_amd64.deb libc++abi1-${VERSION}_${DETAILED_VERSION}_amd64.deb clang-${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-tools_${DETAILED_VERSION}_amd64.deb clang-tools-${VERSION}_${DETAILED_VERSION}_amd64.deb clangd-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-cpp${VERSION}_${DETAILED_VERSION}_amd64.deb clang-tidy-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-cpp${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclc-${VERSION}_${DETAILED_VERSION}_all.deb libclc-${VERSION}-dev_${DETAILED_VERSION}_all.deb llvm-${VERSION}-linker-tools_${DETAILED_VERSION}_amd64.deb libunwind-${VERSION}_${DETAILED_VERSION}_amd64.deb libunwind-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libmlir-${VERSION}_${DETAILED_VERSION}_amd64.deb libmlir-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-rt-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-rt-${VERSION}-dev-wasm32_${DETAILED_VERSION}_all.deb libclang-rt-${VERSION}-dev-wasm64_${DETAILED_VERSION}_all.deb" + echo "To install everything:" echo "sudo apt --purge remove 'libomp5-*' 'libc++*dev' 'libc++*' 'python3-lldb-*' 'libunwind-*' 'libclc-*' 'libclc-*dev' 'libmlir-*'" echo "sudo dpkg -i $LIST" From dcf126ba327e8a862d2eee07113e0274c9341d9b Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 26 Dec 2022 17:56:24 +0100 Subject: [PATCH 24/38] link-grpc.diff: add the detection of other libs necessary for grpc (Closes: #1025529) --- debian/changelog | 4 +++- debian/patches/link-grpc.diff | 41 +++++++++++++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 debian/patches/link-grpc.diff diff --git a/debian/changelog b/debian/changelog index 8c6c311d..db815041 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,12 @@ -llvm-toolchain-14 (1:14.0.6-10~exp4) UNRELEASED; urgency=medium +llvm-toolchain-14 (1:14.0.6-10~exp4) experimental; urgency=medium * Move the compiler-rt content into a new package called libclang-rt-X.Y-dev (including polly) * the wasm targets are shipped into libclang-rt-14-dev-wasm32 and libclang-rt-14-dev-wasm64 * libclang-common-X.Y-dev arch moved to all + * link-grpc.diff: add the detection of other libs necessary for + grpc (Closes: #1025529) -- Sylvestre Ledru Wed, 21 Dec 2022 13:48:40 +0100 diff --git a/debian/patches/link-grpc.diff b/debian/patches/link-grpc.diff new file mode 100644 index 00000000..f176121f --- /dev/null +++ b/debian/patches/link-grpc.diff @@ -0,0 +1,41 @@ +Index: llvm-toolchain-14-14.0.6/llvm/cmake/modules/FindGRPC.cmake +=================================================================== +--- llvm-toolchain-14-14.0.6.orig/llvm/cmake/modules/FindGRPC.cmake ++++ llvm-toolchain-14-14.0.6/llvm/cmake/modules/FindGRPC.cmake +@@ -73,10 +73,27 @@ else() + endif() + endif() + endif() ++ ++ find_library(GPR_LIBRARY gpr $GRPC_OPTS REQUIRED) ++ add_library(gpr UNKNOWN IMPORTED GLOBAL) ++ message(STATUS "Using gpr: " ${GPR_LIBRARY}) ++ set_target_properties(gpr PROPERTIES IMPORTED_LOCATION ${GPR_LIBRARY}) ++ + find_library(GRPC_LIBRARY grpc++ $GRPC_OPTS REQUIRED) + add_library(grpc++ UNKNOWN IMPORTED GLOBAL) + message(STATUS "Using grpc++: " ${GRPC_LIBRARY}) + set_target_properties(grpc++ PROPERTIES IMPORTED_LOCATION ${GRPC_LIBRARY}) ++ ++ find_library(GRPC2_LIBRARY grpc $GRPC_OPTS REQUIRED) ++ add_library(grpc UNKNOWN IMPORTED GLOBAL) ++ message(STATUS "Using grpc: " ${GRPC2_LIBRARY}) ++ set_target_properties(grpc PROPERTIES IMPORTED_LOCATION ${GRPC2_LIBRARY}) ++ ++ find_library(ABSL_SYNCHRONIZATION_LIBRARY absl_synchronization $GRPC_OPTS REQUIRED) ++ add_library(absl_synchronization UNKNOWN IMPORTED GLOBAL) ++ message(STATUS "Using absl_synchronization: " ${ABSL_SYNCHRONIZATION_LIBRARY}) ++ set_target_properties(absl_synchronization PROPERTIES IMPORTED_LOCATION ${ABSL_SYNCHRONIZATION_LIBRARY}) ++ + if (ENABLE_GRPC_REFLECTION) + find_library(GRPC_REFLECTION_LIBRARY grpc++_reflection $GRPC_OPTS REQUIRED) + add_library(grpc++_reflection UNKNOWN IMPORTED GLOBAL) +@@ -123,7 +140,7 @@ function(generate_protos LibraryName Pro + + add_clang_library(${LibraryName} ${GeneratedProtoSource} + PARTIAL_SOURCES_INTENDED +- LINK_LIBS PUBLIC grpc++ protobuf) ++ LINK_LIBS PUBLIC protobuf gpr grpc absl_synchronization grpc++) + + # Ensure dependency headers are generated before dependent protos are built. + # DEPENDS arg is a list of "Foo.proto". While they're logically relative to diff --git a/debian/patches/series b/debian/patches/series index 69b91812..bb79f0a8 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -161,3 +161,4 @@ lldb/lldb-swig.diff lldb/lldb-swig-2.diff protobuf_3.21.patch basic_string.patch +link-grpc.diff From de2e93731c25987044742298c582fd1b46c1671c Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 26 Dec 2022 22:17:23 +0100 Subject: [PATCH 25/38] add missing package --- debian/qualify-clang.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 8c202fbc..b5c64e55 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -9,7 +9,7 @@ VERSION=$(dpkg-parsechangelog | sed -rne "s,^Version: 1:([0-9]+).*,\1,p") DETAILED_VERSION=$(dpkg-parsechangelog | sed -rne "s,^Version: 1:([0-9.]+)(~|-)(.*),\1\2\3,p") DEB_HOST_ARCH=$(dpkg-architecture -qDEB_HOST_ARCH) -LIST="libomp5-${VERSION}_${DETAILED_VERSION}_amd64.deb libomp-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb lldb-${VERSION}_${DETAILED_VERSION}_amd64.deb python3-lldb-${VERSION}_${DETAILED_VERSION}_amd64.deb libllvm${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb liblldb-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang1-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-common-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}_${DETAILED_VERSION}_amd64.deb liblldb-${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-runtime_${DETAILED_VERSION}_amd64.deb lld-${VERSION}_${DETAILED_VERSION}_amd64.deb libfuzzer-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++abi-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++1-${VERSION}_${DETAILED_VERSION}_amd64.deb libc++abi1-${VERSION}_${DETAILED_VERSION}_amd64.deb clang-${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-tools_${DETAILED_VERSION}_amd64.deb clang-tools-${VERSION}_${DETAILED_VERSION}_amd64.deb clangd-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-cpp${VERSION}_${DETAILED_VERSION}_amd64.deb clang-tidy-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-cpp${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclc-${VERSION}_${DETAILED_VERSION}_all.deb libclc-${VERSION}-dev_${DETAILED_VERSION}_all.deb llvm-${VERSION}-linker-tools_${DETAILED_VERSION}_amd64.deb libunwind-${VERSION}_${DETAILED_VERSION}_amd64.deb libunwind-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libmlir-${VERSION}_${DETAILED_VERSION}_amd64.deb libmlir-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-rt-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-rt-${VERSION}-dev-wasm32_${DETAILED_VERSION}_all.deb libclang-rt-${VERSION}-dev-wasm64_${DETAILED_VERSION}_all.deb" +LIST="libomp5-${VERSION}_${DETAILED_VERSION}_amd64.deb libomp-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb lldb-${VERSION}_${DETAILED_VERSION}_amd64.deb python3-lldb-${VERSION}_${DETAILED_VERSION}_amd64.deb libllvm${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb liblldb-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang1-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-common-${VERSION}-dev_${DETAILED_VERSION}_all.deb llvm-${VERSION}_${DETAILED_VERSION}_amd64.deb liblldb-${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-runtime_${DETAILED_VERSION}_amd64.deb lld-${VERSION}_${DETAILED_VERSION}_amd64.deb libfuzzer-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++abi-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++1-${VERSION}_${DETAILED_VERSION}_amd64.deb libc++abi1-${VERSION}_${DETAILED_VERSION}_amd64.deb clang-${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-tools_${DETAILED_VERSION}_amd64.deb clang-tools-${VERSION}_${DETAILED_VERSION}_amd64.deb clangd-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-cpp${VERSION}_${DETAILED_VERSION}_amd64.deb clang-tidy-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-cpp${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclc-${VERSION}_${DETAILED_VERSION}_all.deb libclc-${VERSION}-dev_${DETAILED_VERSION}_all.deb llvm-${VERSION}-linker-tools_${DETAILED_VERSION}_amd64.deb libunwind-${VERSION}_${DETAILED_VERSION}_amd64.deb libunwind-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libmlir-${VERSION}_${DETAILED_VERSION}_amd64.deb libmlir-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-rt-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-rt-${VERSION}-dev-wasm32_${DETAILED_VERSION}_all.deb libclang-rt-${VERSION}-dev-wasm64_${DETAILED_VERSION}_all.deb libc++abi-${VERSION}-dev-wasm32_${DETAILED_VERSION}_all.deb libc++-${VERSION}-dev-wasm32_${DETAILED_VERSION}_all.deb" echo "To install everything:" echo "sudo apt --purge remove 'libomp5-*' 'libc++*dev' 'libc++*' 'python3-lldb-*' 'libunwind-*' 'libclc-*' 'libclc-*dev' 'libmlir-*'" From 1782ae9af33a90ca463065823c04718d3c059142 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 26 Dec 2022 22:17:35 +0100 Subject: [PATCH 26/38] add a warning is was-libc isn't installed --- debian/qualify-clang.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index b5c64e55..ddec2ca1 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -1389,6 +1389,8 @@ EOF exit 1 fi rm -f cout.cpp cout +else + echo "wasi-libc not installed" fi echo ' From d86636d8bc88c6940c4bd9b2131e13b1a069ad51 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 27 Dec 2022 00:29:58 +0100 Subject: [PATCH 27/38] then ${binary:Version} => ${source:Version} to avoid not-binnmuable-any-depends-all --- debian/changelog | 2 ++ debian/control | 8 ++++---- debian/control.in | 8 ++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index db815041..f674bcdf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ llvm-toolchain-14 (1:14.0.6-10~exp4) experimental; urgency=medium * the wasm targets are shipped into libclang-rt-14-dev-wasm32 and libclang-rt-14-dev-wasm64 * libclang-common-X.Y-dev arch moved to all + then ${binary:Version} => ${source:Version} + to avoid not-binnmuable-any-depends-all * link-grpc.diff: add the detection of other libs necessary for grpc (Closes: #1025529) diff --git a/debian/control b/debian/control index 7d0c85db..983f11da 100644 --- a/debian/control +++ b/debian/control @@ -42,7 +42,7 @@ Vcs-Browser: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/tree/14 Package: clang-14 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ${dep:devlibs}, - ${dep:devlibs-objc}, libclang-common-14-dev (= ${binary:Version}), + ${dep:devlibs-objc}, libclang-common-14-dev (= ${source:Version}), llvm-14-linker-tools (= ${binary:Version}), libclang1-14 (= ${binary:Version}), libc6-dev, binutils Provides: c-compiler, objc-compiler, c++-compiler @@ -101,7 +101,7 @@ Description: clang-based C++ linter tool Package: clangd-14 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, - libclang-common-14-dev (= ${binary:Version}) + libclang-common-14-dev (= ${source:Version}) Description: Language server that provides IDE-like features to editors clangd understands your C++ code and adds smart features to your editor: - code completion @@ -152,7 +152,7 @@ Architecture: any Section: libdevel Depends: ${shlibs:Depends}, ${misc:Depends}, ${dep:devlibs}, ${dep:devlibs-objc}, libclang1-14 (= ${binary:Version}), - libclang-common-14-dev (= ${binary:Version}) + libclang-common-14-dev (= ${source:Version}) Breaks: llvm-14-dev (<< 1:14.0.4-2) Replaces: llvm-14-dev (<< 1:14.0.4-2) Description: Clang library - Development package @@ -169,7 +169,7 @@ Description: Clang library - Development package Package: libclang-common-14-dev Architecture: all Section: libdevel -Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm14 (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm14 (= ${source:Version}) Recommends: libclang-rt-14-dev (>= 14.0.6-10~exp4) Description: Clang library - Common development package Clang project is a C, C++, Objective C and Objective C++ front-end diff --git a/debian/control.in b/debian/control.in index c88e3471..31bddef1 100644 --- a/debian/control.in +++ b/debian/control.in @@ -42,7 +42,7 @@ Vcs-Browser: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/tree/@BRANCH_ Package: clang-@LLVM_VERSION@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, ${dep:devlibs}, - ${dep:devlibs-objc}, libclang-common-@LLVM_VERSION@-dev (= ${binary:Version}), + ${dep:devlibs-objc}, libclang-common-@LLVM_VERSION@-dev (= ${source:Version}), llvm-@LLVM_VERSION@-linker-tools (= ${binary:Version}), libclang1-@LLVM_VERSION@ (= ${binary:Version}), libc6-dev, binutils Provides: c-compiler, objc-compiler, c++-compiler @@ -101,7 +101,7 @@ Description: clang-based C++ linter tool Package: clangd-@LLVM_VERSION@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, - libclang-common-@LLVM_VERSION@-dev (= ${binary:Version}) + libclang-common-@LLVM_VERSION@-dev (= ${source:Version}) Description: Language server that provides IDE-like features to editors clangd understands your C++ code and adds smart features to your editor: - code completion @@ -152,7 +152,7 @@ Architecture: any Section: libdevel Depends: ${shlibs:Depends}, ${misc:Depends}, ${dep:devlibs}, ${dep:devlibs-objc}, libclang1-@LLVM_VERSION@ (= ${binary:Version}), - libclang-common-@LLVM_VERSION@-dev (= ${binary:Version}) + libclang-common-@LLVM_VERSION@-dev (= ${source:Version}) Breaks: llvm-@LLVM_VERSION@-dev (<< 1:14.0.4-2) Replaces: llvm-@LLVM_VERSION@-dev (<< 1:14.0.4-2) Description: Clang library - Development package @@ -169,7 +169,7 @@ Description: Clang library - Development package Package: libclang-common-@LLVM_VERSION@-dev Architecture: all Section: libdevel -Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm@LLVM_VERSION@ (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm@LLVM_VERSION@ (= ${source:Version}) Recommends: libclang-rt-@LLVM_VERSION@-dev (>= 14.0.6-10~exp4) Description: Clang library - Common development package Clang project is a C, C++, Objective C and Objective C++ front-end From f5d0923c6dedb718d67729002e79c7b4737f5321 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Tue, 27 Dec 2022 11:16:38 +0100 Subject: [PATCH 28/38] fix the dep to address https://lintian.debian.org/tags/not-binnmuable-all-depends-any --- debian/control | 2 +- debian/control.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 983f11da..fd75dfe1 100644 --- a/debian/control +++ b/debian/control @@ -169,7 +169,7 @@ Description: Clang library - Development package Package: libclang-common-14-dev Architecture: all Section: libdevel -Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm14 (= ${source:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm14 (>= ${source:Version}) Recommends: libclang-rt-14-dev (>= 14.0.6-10~exp4) Description: Clang library - Common development package Clang project is a C, C++, Objective C and Objective C++ front-end diff --git a/debian/control.in b/debian/control.in index 31bddef1..f728c340 100644 --- a/debian/control.in +++ b/debian/control.in @@ -169,7 +169,7 @@ Description: Clang library - Development package Package: libclang-common-@LLVM_VERSION@-dev Architecture: all Section: libdevel -Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm@LLVM_VERSION@ (= ${source:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm@LLVM_VERSION@ (>= ${source:Version}) Recommends: libclang-rt-@LLVM_VERSION@-dev (>= 14.0.6-10~exp4) Description: Clang library - Common development package Clang project is a C, C++, Objective C and Objective C++ front-end From 3e3e3fe1b7d8e0524289cbec5fec1f2c0292bb70 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 28 Dec 2022 12:38:14 +0100 Subject: [PATCH 29/38] Fix the libclang-rt-14-dev-wasm64 description --- debian/changelog | 6 ++++++ debian/control | 4 ++-- debian/control.in | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index f674bcdf..9ca0d3e9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-14 (1:14.0.6-10~exp5) UNRELEASED; urgency=medium + + * Fix the libclang-rt-14-dev-wasm64 description + + -- Sylvestre Ledru Wed, 28 Dec 2022 12:35:04 +0100 + llvm-toolchain-14 (1:14.0.6-10~exp4) experimental; urgency=medium * Move the compiler-rt content into a new package called diff --git a/debian/control b/debian/control index fd75dfe1..9d58082d 100644 --- a/debian/control +++ b/debian/control @@ -218,8 +218,8 @@ Breaks: libclang-common-14-dev (<< 14.0.6-10~exp4) Replaces: libclang-common-14-dev (<< 14.0.6-10~exp4) Depends: ${shlibs:Depends}, ${misc:Depends} Recommends: libclang-common-14-dev (>= 14.0.6-10~exp4) -Description: Compiler-rt - development package - Provides the compiler-rt builtins for WebAssembly 32 bits +Description: Compiler-rt - wasm64 builtins + Provides the compiler-rt builtins for WebAssembly 64 bits Package: libclang-cpp14 Section: libs diff --git a/debian/control.in b/debian/control.in index f728c340..42539320 100644 --- a/debian/control.in +++ b/debian/control.in @@ -218,8 +218,8 @@ Breaks: libclang-common-@LLVM_VERSION@-dev (<< 14.0.6-10~exp4) Replaces: libclang-common-@LLVM_VERSION@-dev (<< 14.0.6-10~exp4) Depends: ${shlibs:Depends}, ${misc:Depends} Recommends: libclang-common-@LLVM_VERSION@-dev (>= 14.0.6-10~exp4) -Description: Compiler-rt - development package - Provides the compiler-rt builtins for WebAssembly 32 bits +Description: Compiler-rt - wasm64 builtins + Provides the compiler-rt builtins for WebAssembly 64 bits Package: libclang-cpp@LLVM_VERSION@ Section: libs From 7f77dcfd6674b8856b8135bb0a2a99231ae50227 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 28 Dec 2022 12:38:21 +0100 Subject: [PATCH 30/38] remove old content from NEWS --- debian/NEWS | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 debian/NEWS diff --git a/debian/NEWS b/debian/NEWS deleted file mode 100644 index edd628b7..00000000 --- a/debian/NEWS +++ /dev/null @@ -1,25 +0,0 @@ -llvm-toolchain-7 (1:7.0.1-1) unstable; urgency=medium - - * llvm-toolchain packages are built using clang itself (stage2) - - stage1 = build clang with gcc - - stage2 = clang building itself - This could lead to some unexpected (but rare) ABI issues. - - -- Sylvestre Ledru Fri, 16 Nov 2018 13:00:39 +0100 - -llvm-toolchain-7 (1:7-1) unstable; urgency=medium - - * From version 7, llvm-toolchain also provides libc++, libc++abi - and OpenMP packages. Non-coinstallable on purpose. - * Packages, binaries and libraries have been renamed. - Instead of the X.Y naming, we moved to X to match the - naming from upstream. - As example, clang version 7 is named clang-7 (unlike clang-6.0) - - -- Sylvestre Ledru Wed, 17 Jan 2018 10:50:39 +0100 - -llvm-toolchain-snapshot (1:3.6~svn214630-1~exp1) experimental; urgency=medium - - * clang is now co-instalable. Available on version 3.4, 3.5 and 3.6 - - -- Sylvestre Ledru Sat, 02 Aug 2014 12:57:41 +0200 From a3209cea009d05bb86776ad8c9bb9d562dcda518 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 28 Dec 2022 12:46:50 +0100 Subject: [PATCH 31/38] document the change --- debian/NEWS | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 debian/NEWS diff --git a/debian/NEWS b/debian/NEWS new file mode 100644 index 00000000..5a4965b9 --- /dev/null +++ b/debian/NEWS @@ -0,0 +1,9 @@ +llvm-toolchain-14 (1:14.0.6-10) UNRELEASED; urgency=medium + + * libclang-common-X.Y-dev has been splitted into libclang-rt-X.Y-dev, + libclang-rt-14-dev-wasm32 and libclang-rt-14-dev-wasm64 + compiler-rt and polly moved to libclang-rt-X.Y-dev + libclang-common-X.Y-dev is now arch:any and contains headers + libclang-common-X.Y-dev recommends libclang-rt-X.Y-dev + + -- Sylvestre Ledru Wed, 28 Dec 2022 12:36:23 +0100 From 519cbc611b4a53487aa236ed1ef53ce62588a8bf Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 28 Dec 2022 13:19:53 +0100 Subject: [PATCH 32/38] Create a libpolly-X.Y-dev package --- debian/NEWS | 2 +- debian/changelog | 1 + debian/control | 17 +++++++++++++++++ debian/control.in | 17 +++++++++++++++++ debian/libclang-common-X.Y-dev.install.in | 2 +- debian/rules | 12 ++++++------ 6 files changed, 43 insertions(+), 8 deletions(-) diff --git a/debian/NEWS b/debian/NEWS index 5a4965b9..985d4184 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,7 +1,7 @@ llvm-toolchain-14 (1:14.0.6-10) UNRELEASED; urgency=medium * libclang-common-X.Y-dev has been splitted into libclang-rt-X.Y-dev, - libclang-rt-14-dev-wasm32 and libclang-rt-14-dev-wasm64 + libpolly-X.Y-dev, libclang-rt-14-dev-wasm32 and libclang-rt-14-dev-wasm64 compiler-rt and polly moved to libclang-rt-X.Y-dev libclang-common-X.Y-dev is now arch:any and contains headers libclang-common-X.Y-dev recommends libclang-rt-X.Y-dev diff --git a/debian/changelog b/debian/changelog index 9ca0d3e9..ac7392bb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ llvm-toolchain-14 (1:14.0.6-10~exp5) UNRELEASED; urgency=medium + * Create a libpolly-X.Y-dev package * Fix the libclang-rt-14-dev-wasm64 description -- Sylvestre Ledru Wed, 28 Dec 2022 12:35:04 +0100 diff --git a/debian/control b/debian/control index 9d58082d..95b20791 100644 --- a/debian/control +++ b/debian/control @@ -181,6 +181,8 @@ Description: Clang library - Common development package . This package contains the Clang generic headers. +# ------------- compiler-rt ------------- + Package: libclang-rt-14-dev Architecture: any Multi-Arch: same @@ -221,6 +223,21 @@ Recommends: libclang-common-14-dev (>= 14.0.6-10~exp4) Description: Compiler-rt - wasm64 builtins Provides the compiler-rt builtins for WebAssembly 64 bits +# ------------- polly ------------- + +Package: libpolly-14-dev +Architecture: any +Multi-Arch: same +Section: libdevel +Breaks: libclang-rt-14-dev (<< 14.0.6-10~exp5), libclang-common-14-dev (<< 14.0.6-10~exp5) +Replaces: libclang-rt-14-dev (<< 14.0.6-10~exp5), libclang-common-14-dev (<< 14.0.6-10~exp5) +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: High-level loop and data-locality optimizer + Uses an abstract mathematical representation based on integer polyhedra + to analyze and optimize the memory access pattern of a program + +# ------------- clang libraries ------------- + Package: libclang-cpp14 Section: libs Architecture: any diff --git a/debian/control.in b/debian/control.in index 42539320..9f19c5ad 100644 --- a/debian/control.in +++ b/debian/control.in @@ -181,6 +181,8 @@ Description: Clang library - Common development package . This package contains the Clang generic headers. +# ------------- compiler-rt ------------- + Package: libclang-rt-@LLVM_VERSION@-dev Architecture: any Multi-Arch: same @@ -221,6 +223,21 @@ Recommends: libclang-common-@LLVM_VERSION@-dev (>= 14.0.6-10~exp4) Description: Compiler-rt - wasm64 builtins Provides the compiler-rt builtins for WebAssembly 64 bits +# ------------- polly ------------- + +Package: libpolly-@LLVM_VERSION@-dev +Architecture: any +Multi-Arch: same +Section: libdevel +Breaks: libclang-rt-@LLVM_VERSION@-dev (<< 14.0.6-10~exp5), libclang-common-@LLVM_VERSION@-dev (<< 14.0.6-10~exp5) +Replaces: libclang-rt-@LLVM_VERSION@-dev (<< 14.0.6-10~exp5), libclang-common-@LLVM_VERSION@-dev (<< 14.0.6-10~exp5) +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: High-level loop and data-locality optimizer + Uses an abstract mathematical representation based on integer polyhedra + to analyze and optimize the memory access pattern of a program + +# ------------- clang libraries ------------- + Package: libclang-cpp@LLVM_VERSION@ Section: libs Architecture: any diff --git a/debian/libclang-common-X.Y-dev.install.in b/debian/libclang-common-X.Y-dev.install.in index c856e801..89fbf8a3 100644 --- a/debian/libclang-common-X.Y-dev.install.in +++ b/debian/libclang-common-X.Y-dev.install.in @@ -1,4 +1,4 @@ -#usr/lib/llvm-@LLVM_VERSION@/include/polly + usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/include/*.h usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/include/module.modulemap diff --git a/debian/rules b/debian/rules index 6bfb8f81..ca5b96d2 100755 --- a/debian/rules +++ b/debian/rules @@ -1057,12 +1057,12 @@ 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/; \ + mkdir -p $(CURDIR)/debian/libclang-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/lib/ $(CURDIR)/debian/libpolly-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/polly/; \ 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; \ + $(CURDIR)/debian/libpolly-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/lib/; \ + rm -rf $(CURDIR)/debian/libpolly-$(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/; \ + $(CURDIR)/debian/libpolly-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/; \ fi mkdir -p $(CURDIR)/debian/usr/share/doc/llvm-$(LLVM_VERSION)-doc/ $(CURDIR)/debian/usr/share/doc/clang-$(LLVM_VERSION)-doc/ @@ -1155,8 +1155,8 @@ endif override_dh_install: ifeq (${POLLY_ENABLE},yes) # only for arch:any builds -ifneq (,$(filter libclang-common-$(LLVM_VERSION)-dev, $(shell dh_listpackages))) - dh_install -p libclang-common-$(LLVM_VERSION)-dev usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/polly/*.cmake usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/polly +ifneq (,$(filter libpolly-$(LLVM_VERSION)-dev, $(shell dh_listpackages))) + dh_install -p libpolly-$(LLVM_VERSION)-dev usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/polly/*.cmake usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/polly # On old Debian & Ubuntu, removing the files is necessary rm -rf debian/tmp/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/polly/*.cmake else From aa868d6086078168b04ed3107713e11c392b59bb Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 28 Dec 2022 13:59:34 +0100 Subject: [PATCH 33/38] also list polly --- debian/qualify-clang.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index ddec2ca1..351803e3 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -9,7 +9,7 @@ VERSION=$(dpkg-parsechangelog | sed -rne "s,^Version: 1:([0-9]+).*,\1,p") DETAILED_VERSION=$(dpkg-parsechangelog | sed -rne "s,^Version: 1:([0-9.]+)(~|-)(.*),\1\2\3,p") DEB_HOST_ARCH=$(dpkg-architecture -qDEB_HOST_ARCH) -LIST="libomp5-${VERSION}_${DETAILED_VERSION}_amd64.deb libomp-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb lldb-${VERSION}_${DETAILED_VERSION}_amd64.deb python3-lldb-${VERSION}_${DETAILED_VERSION}_amd64.deb libllvm${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb liblldb-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang1-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-common-${VERSION}-dev_${DETAILED_VERSION}_all.deb llvm-${VERSION}_${DETAILED_VERSION}_amd64.deb liblldb-${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-runtime_${DETAILED_VERSION}_amd64.deb lld-${VERSION}_${DETAILED_VERSION}_amd64.deb libfuzzer-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++abi-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++1-${VERSION}_${DETAILED_VERSION}_amd64.deb libc++abi1-${VERSION}_${DETAILED_VERSION}_amd64.deb clang-${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-tools_${DETAILED_VERSION}_amd64.deb clang-tools-${VERSION}_${DETAILED_VERSION}_amd64.deb clangd-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-cpp${VERSION}_${DETAILED_VERSION}_amd64.deb clang-tidy-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-cpp${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclc-${VERSION}_${DETAILED_VERSION}_all.deb libclc-${VERSION}-dev_${DETAILED_VERSION}_all.deb llvm-${VERSION}-linker-tools_${DETAILED_VERSION}_amd64.deb libunwind-${VERSION}_${DETAILED_VERSION}_amd64.deb libunwind-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libmlir-${VERSION}_${DETAILED_VERSION}_amd64.deb libmlir-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-rt-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-rt-${VERSION}-dev-wasm32_${DETAILED_VERSION}_all.deb libclang-rt-${VERSION}-dev-wasm64_${DETAILED_VERSION}_all.deb libc++abi-${VERSION}-dev-wasm32_${DETAILED_VERSION}_all.deb libc++-${VERSION}-dev-wasm32_${DETAILED_VERSION}_all.deb" +LIST="libomp5-${VERSION}_${DETAILED_VERSION}_amd64.deb libomp-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb lldb-${VERSION}_${DETAILED_VERSION}_amd64.deb python3-lldb-${VERSION}_${DETAILED_VERSION}_amd64.deb libllvm${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb liblldb-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang1-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-common-${VERSION}-dev_${DETAILED_VERSION}_all.deb llvm-${VERSION}_${DETAILED_VERSION}_amd64.deb liblldb-${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-runtime_${DETAILED_VERSION}_amd64.deb lld-${VERSION}_${DETAILED_VERSION}_amd64.deb libfuzzer-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++abi-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libc++1-${VERSION}_${DETAILED_VERSION}_amd64.deb libc++abi1-${VERSION}_${DETAILED_VERSION}_amd64.deb clang-${VERSION}_${DETAILED_VERSION}_amd64.deb llvm-${VERSION}-tools_${DETAILED_VERSION}_amd64.deb clang-tools-${VERSION}_${DETAILED_VERSION}_amd64.deb clangd-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-cpp${VERSION}_${DETAILED_VERSION}_amd64.deb clang-tidy-${VERSION}_${DETAILED_VERSION}_amd64.deb libclang-cpp${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclc-${VERSION}_${DETAILED_VERSION}_all.deb libclc-${VERSION}-dev_${DETAILED_VERSION}_all.deb llvm-${VERSION}-linker-tools_${DETAILED_VERSION}_amd64.deb libunwind-${VERSION}_${DETAILED_VERSION}_amd64.deb libunwind-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libmlir-${VERSION}_${DETAILED_VERSION}_amd64.deb libmlir-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-rt-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb libclang-rt-${VERSION}-dev-wasm32_${DETAILED_VERSION}_all.deb libclang-rt-${VERSION}-dev-wasm64_${DETAILED_VERSION}_all.deb libc++abi-${VERSION}-dev-wasm32_${DETAILED_VERSION}_all.deb libc++-${VERSION}-dev-wasm32_${DETAILED_VERSION}_all.deb libpolly-${VERSION}-dev_${DETAILED_VERSION}_amd64.deb" echo "To install everything:" echo "sudo apt --purge remove 'libomp5-*' 'libc++*dev' 'libc++*' 'python3-lldb-*' 'libunwind-*' 'libclc-*' 'libclc-*dev' 'libmlir-*'" From 484835276949faa4a1ac0fc869467d7b6c2a0633 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 28 Dec 2022 14:01:50 +0100 Subject: [PATCH 34/38] update of the comment --- debian/qualify-clang.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 351803e3..79075538 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -1212,11 +1212,11 @@ clang++-$VERSION foo.cpp -unwindlib=libunwind -rtlib=compiler-rt -I/usr/include/ ./a.out||true if test ! -f /usr/lib/llvm-$VERSION/include/polly/LinkAllPasses.h; then - echo "Install libclang-common-$VERSION-dev for polly"; + echo "Install libpolly-$VERSION-dev for polly"; exit -1; fi -echo "Testing polly (libclang-common-$VERSION-dev) ..." +echo "Testing polly (libpolly-$VERSION-dev) ..." # Polly echo " From 362074812c7e9919652d0a4e16a8e65b4b23988f Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 28 Dec 2022 15:05:20 +0100 Subject: [PATCH 35/38] prepare upload --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ac7392bb..8782fb89 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -llvm-toolchain-14 (1:14.0.6-10~exp5) UNRELEASED; urgency=medium +llvm-toolchain-14 (1:14.0.6-10~exp5) experimental; urgency=medium * Create a libpolly-X.Y-dev package * Fix the libclang-rt-14-dev-wasm64 description From 0fafb7f1a77ce951abb78e6e3a0a9579c54a58e9 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 28 Dec 2022 16:59:26 +0100 Subject: [PATCH 36/38] fix the version --- debian/NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/NEWS b/debian/NEWS index 985d4184..3bacb4d1 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,4 +1,4 @@ -llvm-toolchain-14 (1:14.0.6-10) UNRELEASED; urgency=medium +llvm-toolchain-14 (1:14.0.6-10) unstable; urgency=medium * libclang-common-X.Y-dev has been splitted into libclang-rt-X.Y-dev, libpolly-X.Y-dev, libclang-rt-14-dev-wasm32 and libclang-rt-14-dev-wasm64 From ca1e03b5cab0d8bd1518d80bc6a199846a029422 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 1 Jan 2023 12:09:07 +0100 Subject: [PATCH 37/38] improve the libgrpc++ patch for backports --- debian/patches/link-grpc.diff | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/debian/patches/link-grpc.diff b/debian/patches/link-grpc.diff index f176121f..8a5c3cb6 100644 --- a/debian/patches/link-grpc.diff +++ b/debian/patches/link-grpc.diff @@ -2,7 +2,7 @@ Index: llvm-toolchain-14-14.0.6/llvm/cmake/modules/FindGRPC.cmake =================================================================== --- llvm-toolchain-14-14.0.6.orig/llvm/cmake/modules/FindGRPC.cmake +++ llvm-toolchain-14-14.0.6/llvm/cmake/modules/FindGRPC.cmake -@@ -73,10 +73,27 @@ else() +@@ -73,10 +73,29 @@ else() endif() endif() endif() @@ -23,19 +23,29 @@ Index: llvm-toolchain-14-14.0.6/llvm/cmake/modules/FindGRPC.cmake + set_target_properties(grpc PROPERTIES IMPORTED_LOCATION ${GRPC2_LIBRARY}) + + find_library(ABSL_SYNCHRONIZATION_LIBRARY absl_synchronization $GRPC_OPTS REQUIRED) -+ add_library(absl_synchronization UNKNOWN IMPORTED GLOBAL) -+ message(STATUS "Using absl_synchronization: " ${ABSL_SYNCHRONIZATION_LIBRARY}) -+ set_target_properties(absl_synchronization PROPERTIES IMPORTED_LOCATION ${ABSL_SYNCHRONIZATION_LIBRARY}) ++ if (ABSL_SYNCHRONIZATION_LIBRARY) ++ add_library(absl_synchronization UNKNOWN IMPORTED GLOBAL) ++ message(STATUS "Using absl_synchronization: " ${ABSL_SYNCHRONIZATION_LIBRARY}) ++ set_target_properties(absl_synchronization PROPERTIES IMPORTED_LOCATION ${ABSL_SYNCHRONIZATION_LIBRARY}) ++ endif() + if (ENABLE_GRPC_REFLECTION) find_library(GRPC_REFLECTION_LIBRARY grpc++_reflection $GRPC_OPTS REQUIRED) add_library(grpc++_reflection UNKNOWN IMPORTED GLOBAL) -@@ -123,7 +140,7 @@ function(generate_protos LibraryName Pro +@@ -121,9 +140,15 @@ function(generate_protos LibraryName Pro + ARGS ${Flags} "${ProtoSourceAbsolutePath}" + DEPENDS "${ProtoSourceAbsolutePath}") ++ set(LINKED_GRPC_LIBRARIES protobuf gpr grpc grpc++) ++ ++ if (ABSL_SYNCHRONIZATION_LIBRARY) ++ list(APPEND LINKED_GRPC_LIBRARIES absl_synchronization) ++ endif() ++ add_clang_library(${LibraryName} ${GeneratedProtoSource} PARTIAL_SOURCES_INTENDED - LINK_LIBS PUBLIC grpc++ protobuf) -+ LINK_LIBS PUBLIC protobuf gpr grpc absl_synchronization grpc++) ++ LINK_LIBS PUBLIC ${LINKED_GRPC_LIBRARIES}) # Ensure dependency headers are generated before dependent protos are built. # DEPENDS arg is a list of "Foo.proto". While they're logically relative to From f2231f3342ec37539de80b50720b138047e64adc Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 1 Jan 2023 12:10:14 +0100 Subject: [PATCH 38/38] Move libPolly in libpolly-X.Y-dev for real --- debian/changelog | 6 ++++++ debian/control | 4 ++-- debian/control.in | 4 ++-- debian/libclang-rt-X.Y-dev.install.in | 4 ---- debian/libpolly-X.Y-dev.install.in | 3 +++ debian/libpolly-X.Y-dev.lintian-overrides.in | 1 + debian/rules | 2 +- 7 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 debian/libpolly-X.Y-dev.install.in create mode 100644 debian/libpolly-X.Y-dev.lintian-overrides.in diff --git a/debian/changelog b/debian/changelog index 8782fb89..fcd3e7ba 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-14 (1:14.0.6-10~exp6) UNRELEASED; urgency=medium + + * Move libPolly in libpolly-X.Y-dev for real + + -- Sylvestre Ledru Sun, 01 Jan 2023 11:42:14 +0100 + llvm-toolchain-14 (1:14.0.6-10~exp5) experimental; urgency=medium * Create a libpolly-X.Y-dev package diff --git a/debian/control b/debian/control index 95b20791..271ebbcb 100644 --- a/debian/control +++ b/debian/control @@ -229,8 +229,8 @@ Package: libpolly-14-dev Architecture: any Multi-Arch: same Section: libdevel -Breaks: libclang-rt-14-dev (<< 14.0.6-10~exp5), libclang-common-14-dev (<< 14.0.6-10~exp5) -Replaces: libclang-rt-14-dev (<< 14.0.6-10~exp5), libclang-common-14-dev (<< 14.0.6-10~exp5) +Breaks: libclang-rt-14-dev (<< 14.0.6-10~exp6), libclang-common-14-dev (<< 14.0.6-10~exp6) +Replaces: libclang-rt-14-dev (<< 14.0.6-10~exp6), libclang-common-14-dev (<< 14.0.6-10~exp6) Depends: ${shlibs:Depends}, ${misc:Depends} Description: High-level loop and data-locality optimizer Uses an abstract mathematical representation based on integer polyhedra diff --git a/debian/control.in b/debian/control.in index 9f19c5ad..c324ea2d 100644 --- a/debian/control.in +++ b/debian/control.in @@ -229,8 +229,8 @@ Package: libpolly-@LLVM_VERSION@-dev Architecture: any Multi-Arch: same Section: libdevel -Breaks: libclang-rt-@LLVM_VERSION@-dev (<< 14.0.6-10~exp5), libclang-common-@LLVM_VERSION@-dev (<< 14.0.6-10~exp5) -Replaces: libclang-rt-@LLVM_VERSION@-dev (<< 14.0.6-10~exp5), libclang-common-@LLVM_VERSION@-dev (<< 14.0.6-10~exp5) +Breaks: libclang-rt-@LLVM_VERSION@-dev (<< 14.0.6-10~exp6), libclang-common-@LLVM_VERSION@-dev (<< 14.0.6-10~exp5) +Replaces: libclang-rt-@LLVM_VERSION@-dev (<< 14.0.6-10~exp6), libclang-common-@LLVM_VERSION@-dev (<< 14.0.6-10~exp5) Depends: ${shlibs:Depends}, ${misc:Depends} Description: High-level loop and data-locality optimizer Uses an abstract mathematical representation based on integer polyhedra diff --git a/debian/libclang-rt-X.Y-dev.install.in b/debian/libclang-rt-X.Y-dev.install.in index 2116c799..49a9d2f8 100644 --- a/debian/libclang-rt-X.Y-dev.install.in +++ b/debian/libclang-rt-X.Y-dev.install.in @@ -1,9 +1,5 @@ -#!/usr/bin/dh-exec - usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/share/*.txt usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/include/sanitizer/ usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/lib/linux/*clang_rt* usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/README.txt usr/lib/llvm-@LLVM_VERSION@/lib/clang/@LLVM_VERSION@*/include/fuzzer/ - -[!powerpc !powerpcspe] usr/lib/llvm-@LLVM_VERSION@/lib/libPolly*.a diff --git a/debian/libpolly-X.Y-dev.install.in b/debian/libpolly-X.Y-dev.install.in new file mode 100644 index 00000000..12c1309d --- /dev/null +++ b/debian/libpolly-X.Y-dev.install.in @@ -0,0 +1,3 @@ +#!/usr/bin/dh-exec + +[!powerpc !powerpcspe] usr/lib/llvm-@LLVM_VERSION@/lib/libPolly*.a diff --git a/debian/libpolly-X.Y-dev.lintian-overrides.in b/debian/libpolly-X.Y-dev.lintian-overrides.in new file mode 100644 index 00000000..0e12e159 --- /dev/null +++ b/debian/libpolly-X.Y-dev.lintian-overrides.in @@ -0,0 +1 @@ +libpolly-@LLVM_VERSION@-dev: arch-dependent-file-not-in-arch-specific-directory *usr/lib/llvm-@LLVM_VERSION@/lib/libPolly*.a* diff --git a/debian/rules b/debian/rules index ca5b96d2..09fc3b79 100755 --- a/debian/rules +++ b/debian/rules @@ -490,7 +490,7 @@ preconfigure: chmod +x \ debian/clang-tools-$(LLVM_VERSION).install \ debian/libclang-$(LLVM_VERSION)-dev.install \ - debian/libclang-rt-$(LLVM_VERSION)-dev.install \ + debian/libpolly-$(LLVM_VERSION)-dev.install \ debian/libomp-$(LLVM_VERSION)-dev.install \ debian/llvm-$(LLVM_VERSION)-dev.install \ debian/llvm-$(LLVM_VERSION)-linker-tools.install \