From 18f70bf18ea978858d973dd1c7e4791d23ea5479 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 9 Oct 2022 20:34:54 +0200 Subject: [PATCH 1/4] fix the cmake detection with libmlir --- debian/changelog | 6 ++++++ debian/rules | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 1af59750..0723ec17 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-14 (1:14.0.6-4) UNRELEASED; urgency=medium + + * fix the cmake detection with libmlir + + -- Sylvestre Ledru Sun, 09 Oct 2022 20:33:54 +0200 + llvm-toolchain-14 (1:14.0.6-3) unstable; urgency=medium * Fix a typo to silent lintian (Closes: #1018770) diff --git a/debian/rules b/debian/rules index fe14e2c0..41ff3c5b 100755 --- a/debian/rules +++ b/debian/rules @@ -897,7 +897,8 @@ endif # Also disable mlir-* checks in the cmake sed -i '/_IMPORT_CHECK_TARGETS \(mlir-\|MLIR\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake - sed -i '/_cmake_import_check_files_for_mli/ {s|^|#|}' /usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-release.cmake + sed -i '/_cmake_import_check_files_for_mli/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-release.cmake + sed -i '/_cmake_import_check_files_for_MLIR/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-release.cmake # Disable CMake's package validation checks for binaries that may not be installed sed -i 's|.*_IMPORT_CHECK_FILES_FOR_.*/bin/.*)|#&|' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake From ca9dbba24d5170e0454c0678f37003eb2cf08482 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 10 Oct 2022 13:47:36 +0200 Subject: [PATCH 2/4] Don't build wasm target on arm64 armel mips64el mipsel ppc64el armhf for now --- debian/changelog | 6 ++++-- debian/rules | 13 ++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0723ec17..a4e992ef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,10 @@ -llvm-toolchain-14 (1:14.0.6-4) UNRELEASED; urgency=medium +llvm-toolchain-14 (1:14.0.6-4) unstable; urgency=medium * fix the cmake detection with libmlir + * Don't build wasm target on arm64 armel mips64el mipsel ppc64el armhf + for now - -- Sylvestre Ledru Sun, 09 Oct 2022 20:33:54 +0200 + -- Sylvestre Ledru Mon, 10 Oct 2022 13:47:25 +0200 llvm-toolchain-14 (1:14.0.6-3) unstable; urgency=medium diff --git a/debian/rules b/debian/rules index 41ff3c5b..4ebc5495 100755 --- a/debian/rules +++ b/debian/rules @@ -291,6 +291,12 @@ 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 @@ -680,6 +686,7 @@ 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; \ @@ -708,6 +715,9 @@ debian-rtlib-wasm-build: -DCOMPILER_RT_OS_DIR=wasi; \ ninja -C build-compiler-rt-$$build $(NJOBS) $(VERBOSE); \ done +else + echo "Skip on this arch" +endif touch $@ override_dh_auto_build: debian-full-build debian-libfuzzer-build debian-libclc-build debian-rtlib-wasm-build @@ -849,9 +859,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 # Rename binaries mkdir -p $(DEB_INST)/usr/bin/ From 6d0f0bba3679cee162110a5e15d2436e7e5d6c84 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 10 Oct 2022 13:49:21 +0200 Subject: [PATCH 3/4] fix a test when running from a symlinked dir --- 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 79a7908b..a87e59df 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -67,7 +67,7 @@ void test() { scan-build-$VERSION -o scan-build gcc -c foo.c &> /dev/null || true scan-build-$VERSION -o scan-build clang-$VERSION -c foo.c &> /dev/null scan-build-$VERSION --exclude non-existing/ --exclude /tmp/ -v clang-$VERSION -c foo.c &> /dev/null -scan-build-$VERSION --exclude $(pwd) -v clang-$VERSION -c foo.c &> foo.log +scan-build-$VERSION --exclude $(realpath $(pwd)) -v clang-$VERSION -c foo.c &> foo.log if ! grep -q -E "scan-build: 0 bugs found." foo.log; then echo "scan-build --exclude didn't ignore the defect" exit 42 From a62bbeb4253789ffb5f200550a0c748e029c649d Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 10 Oct 2022 14:55:48 +0200 Subject: [PATCH 4/4] remove artifact --- debian/qualify-clang.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index a87e59df..d96ed9a7 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -993,6 +993,7 @@ extern "C" void plugin() { EOF clang++-$VERSION -shared -o plugin.so -fvisibility=hidden foo.cpp -static-libstdc++ || true clang++-$VERSION -shared -o plugin.so -fvisibility=hidden foo.cpp -stdlib=libc++ -static-libstdc++ ||true +rm -f plugin.so # Bug 889832 echo '#include