From c1e98235466ae9eaa5e0958614e6a25b623f9980 Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Sat, 25 May 2019 12:08:21 +0200 Subject: [PATCH 1/8] Use dh-exec to exclude lib/LLVM*.so on powerpc and powerpcspe --- debian/changelog | 8 ++++++++ debian/control | 2 +- debian/llvm-X.Y-dev.install.in | 4 +++- debian/rules | 3 +++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8fdf7a32..cfee09e0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +llvm-toolchain-8 (1:8.0.1~+rc1-1~exp3) UNRELEASED; urgency=medium + + [ John Paul Adrian Glaubitz ] + * Use dh-exec to exclude lib/LLVM*.so on powerpc and + powerpcspe from llvm-X.Y-dev.install.in + + -- John Paul Adrian Glaubitz Sat, 25 May 2019 12:05:51 +0200 + llvm-toolchain-8 (1:8.0.1~+rc1-1~exp2) experimental; urgency=medium * Build using thinlto on non stretch, xenial and trusty diff --git a/debian/control b/debian/control index 3c2eeeb8..8c48a816 100644 --- a/debian/control +++ b/debian/control @@ -17,7 +17,7 @@ Build-Depends: debhelper (>= 9.0), cmake, chrpath, texinfo, sharutils, ocaml-nox [amd64 arm64 armhf i386 ppc64el s390x], ocaml-findlib [amd64 arm64 armhf i386 ppc64el s390x], libctypes-ocaml-dev [amd64 arm64 armhf i386 ppc64el s390x], - dh-ocaml [amd64 arm64 armhf i386 ppc64el s390x], + dh-exec, dh-ocaml [amd64 arm64 armhf i386 ppc64el s390x], Build-Conflicts: oprofile, ocaml, libllvm-3.8-ocaml-dev, libllvm-3.9-ocaml-dev Standards-Version: 4.2.1 Homepage: https://www.llvm.org/ diff --git a/debian/llvm-X.Y-dev.install.in b/debian/llvm-X.Y-dev.install.in index c08465de..9a4ca55a 100644 --- a/debian/llvm-X.Y-dev.install.in +++ b/debian/llvm-X.Y-dev.install.in @@ -1,6 +1,8 @@ +#!/usr/bin/dh-exec + usr/lib/llvm-@LLVM_VERSION@/lib/libLLVM*.a #usr/lib/llvm-@LLVM_VERSION@/lib/libllvm*.a -usr/lib/llvm-@LLVM_VERSION@/lib/LLVM*.so +[!powerpc !powerpcspe] usr/lib/llvm-@LLVM_VERSION@/lib/LLVM*.so usr/lib/llvm-@LLVM_VERSION@/lib/libLLVM.so usr/lib/llvm-@LLVM_VERSION@/lib/libLLVM-@LLVM_VERSION@.so usr/lib/llvm-@LLVM_VERSION@/lib/libLLVM-@LLVM_VERSION_FULL@.so diff --git a/debian/rules b/debian/rules index de5370f2..58b3d0a4 100755 --- a/debian/rules +++ b/debian/rules @@ -275,6 +275,9 @@ preconfigure: -e "s|@LLVM_VERSION@|$(LLVM_VERSION)|g" $$f > $$f2; \ done + # Make install file executable for dh-exec + chmod +x debian/llvm-$(LLVM_VERSION)-dev.install + # Override this two targets. They are trying to manage the .in conversion for me override_dh_ocamlinit: override_dh_ocamlclean: From 8a8a9b0b93344c36bea542742c66eca8a8e00716 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 25 May 2019 23:31:01 +0200 Subject: [PATCH 2/8] add one more check --- debian/qualify-clang.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 47470dff..df45237d 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -450,6 +450,12 @@ if test ! -f /usr/lib/llvm-$VERSION/include/c++/v1/vector; then exit -1; fi +if test ! -f /usr/lib/llvm-$VERSION/lib/libc++abi.so; then + echo "Install libc++abi-$VERSION-dev"; + exit -1; +fi + + # libc++ echo ' #include From b9959b334d67482daff3ef297b04fbeb9a912478 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 25 May 2019 23:35:55 +0200 Subject: [PATCH 3/8] add a check for compiler-rt --- debian/qualify-clang.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index df45237d..646572b5 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -779,6 +779,15 @@ int main () } EOF +F=$(clang-$VERSION --target=x86_64-unknown-linux-gnu --rtlib=compiler-rt --print-libgcc-file-name) +if test ! $F; then + echo "Cannot find $F" + echo "TODO check if the exit1 can be put back" +# exit 1 +else + echo "$F is one of the compiler-rt file" +fi + # only for AMD64 for now # many sanitizers only work on AMD64 # x32 programs need to be enabled in the kernel bootparams for debian From f85933a30e6c97a053770bd796159bb933bd6a15 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 31 May 2019 20:10:07 +0200 Subject: [PATCH 4/8] remove patch applied upstream --- debian/patches/series | 3 --- 1 file changed, 3 deletions(-) diff --git a/debian/patches/series b/debian/patches/series index b10c1f35..1e9a453a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -133,6 +133,3 @@ OpenCL-Change-type-of-block-pointer-for-OpenCL.patch OpenCL-Simplify-LLVM-IR-generated-for-OpenCL-blocks.patch OpenCL-Fix-assertion-due-to-blocks.patch ubuntu-eoan-distro.patch - -# Mipsel -D59702-mips64el-fix.diff From af4e69bf41c3b265d180841b750baeca8b90d2f7 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 5 Jun 2019 09:38:27 +0200 Subject: [PATCH 5/8] exp2 hasn't been uploaded --- debian/changelog | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/debian/changelog b/debian/changelog index cfee09e0..a16621a7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,3 @@ -llvm-toolchain-8 (1:8.0.1~+rc1-1~exp3) UNRELEASED; urgency=medium - - [ John Paul Adrian Glaubitz ] - * Use dh-exec to exclude lib/LLVM*.so on powerpc and - powerpcspe from llvm-X.Y-dev.install.in - - -- John Paul Adrian Glaubitz Sat, 25 May 2019 12:05:51 +0200 - llvm-toolchain-8 (1:8.0.1~+rc1-1~exp2) experimental; urgency=medium * Build using thinlto on non stretch, xenial and trusty @@ -15,6 +7,10 @@ llvm-toolchain-8 (1:8.0.1~+rc1-1~exp2) experimental; urgency=medium experimental list * check-polly was executed twice + [ John Paul Adrian Glaubitz ] + * Use dh-exec to exclude lib/LLVM*.so on powerpc and + powerpcspe from llvm-X.Y-dev.install.in + -- Sylvestre Ledru Sun, 19 May 2019 13:31:37 +0200 llvm-toolchain-8 (1:8.0.1~+rc1-1~exp1) experimental; urgency=medium From 2322e06906fe8bd8354509ef611e0c8ce0b01602 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 6 Jun 2019 12:48:37 +0200 Subject: [PATCH 6/8] Move the default ARM arch from arm1176jzf-s (armv6) to cortex-a7 (Closes: #930008) --- debian/changelog | 2 ++ debian/patches/930008-arm.diff | 13 +++++++++++++ debian/patches/series | 1 + debian/qualify-clang.sh | 9 +++++++++ 4 files changed, 25 insertions(+) create mode 100644 debian/patches/930008-arm.diff diff --git a/debian/changelog b/debian/changelog index 8fdf7a32..f8e81e70 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ llvm-toolchain-8 (1:8.0.1~+rc1-1~exp2) experimental; urgency=medium * WebAssembly is now build by default, remove it from the experimental list * check-polly was executed twice + * Move the default ARM arch from arm1176jzf-s (armv6) to cortex-a7 + (Closes: #930008) -- Sylvestre Ledru Sun, 19 May 2019 13:31:37 +0200 diff --git a/debian/patches/930008-arm.diff b/debian/patches/930008-arm.diff new file mode 100644 index 00000000..d2ea156a --- /dev/null +++ b/debian/patches/930008-arm.diff @@ -0,0 +1,13 @@ +Index: llvm-toolchain-8-8.0.1~+rc1/lib/Support/Triple.cpp +=================================================================== +--- llvm-toolchain-8-8.0.1~+rc1.orig/lib/Support/Triple.cpp ++++ llvm-toolchain-8-8.0.1~+rc1/lib/Support/Triple.cpp +@@ -1620,7 +1620,7 @@ StringRef Triple::getARMCPUForArch(Strin + case llvm::Triple::EABIHF: + case llvm::Triple::GNUEABIHF: + case llvm::Triple::MuslEABIHF: +- return "arm1176jzf-s"; ++ return "cortex-a7"; + default: + return "arm7tdmi"; + } diff --git a/debian/patches/series b/debian/patches/series index b10c1f35..50b52989 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -136,3 +136,4 @@ ubuntu-eoan-distro.patch # Mipsel D59702-mips64el-fix.diff +930008-arm.diff diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 47470dff..3028e97a 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -142,6 +142,15 @@ if ! file foo.o 2>&1 | grep -i -q "aarch64"; then file foo.o exit 42 fi + +clang-$VERSION --target=arm-linux-gnueabihf -dM -E -xc - < /dev/null &> foo.log +if grep -v -q "#define __ARM_ARCH 7" foo.log; then + # bug 930008 + echo "The target arch for arm should v7" + cat foo.log + exit 42 +fi + echo ' #include int From cf0e4bdea0fabb36158d25866cb8136a83cc9a0b Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 6 Jun 2019 13:09:20 +0200 Subject: [PATCH 7/8] fix the changelog --- debian/changelog | 9 --------- 1 file changed, 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7151246e..1c6785bd 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,5 @@ llvm-toolchain-8 (1:8.0.1~+rc1-1~exp2) experimental; urgency=medium -<<<<<<< * Build using thinlto on non stretch, xenial and trusty (fails with some undef symbols) Option -DLLVM_ENABLE_LTO="Thin" added @@ -9,18 +8,10 @@ llvm-toolchain-8 (1:8.0.1~+rc1-1~exp2) experimental; urgency=medium * check-polly was executed twice * Move the default ARM arch from arm1176jzf-s (armv6) to cortex-a7 (Closes: #930008) -======= - * Build using thinlto on non stretch, xenial and trusty - (fails with some undef symbols) - Option -DLLVM_ENABLE_LTO="Thin" added - * WebAssembly is now build by default, remove it from the - experimental list - * check-polly was executed twice [ John Paul Adrian Glaubitz ] * Use dh-exec to exclude lib/LLVM*.so on powerpc and powerpcspe from llvm-X.Y-dev.install.in ->>>>>>> -- Sylvestre Ledru Sun, 19 May 2019 13:31:37 +0200 From 33d118531132dcb9386fb3b225e00982b1ea5884 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 7 Jun 2019 17:54:52 +0200 Subject: [PATCH 8/8] fix the test --- 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 59c95472..22cd6584 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -144,7 +144,7 @@ if ! file foo.o 2>&1 | grep -i -q "aarch64"; then fi clang-$VERSION --target=arm-linux-gnueabihf -dM -E -xc - < /dev/null &> foo.log -if grep -v -q "#define __ARM_ARCH 7" foo.log; then +if ! grep -q "#define __ARM_ARCH 7" foo.log; then # bug 930008 echo "The target arch for arm should v7" cat foo.log