diff --git a/debian/changelog b/debian/changelog index 3527200d..c27fa96d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,3 @@ -llvm-toolchain-11 (1:11.0.0-5) unstable; urgency=medium - - * qualify-clang.sh: skip a fuzzer test in i386 because of - https://bugs.llvm.org/show_bug.cgi?id=43677 - - -- Sylvestre Ledru Mon, 02 Nov 2020 12:44:42 +0100 - llvm-toolchain-11 (1:11.0.0-4) unstable; urgency=medium * Cherry-pick some fixes from diff --git a/debian/patches/disable-fuzzer-compiler-rt-x86.diff b/debian/patches/disable-fuzzer-compiler-rt-x86.diff deleted file mode 100644 index ba7a32b6..00000000 --- a/debian/patches/disable-fuzzer-compiler-rt-x86.diff +++ /dev/null @@ -1,32 +0,0 @@ -Index: llvm-toolchain-snapshot_11~++20200418115741+8e0c5f72005/compiler-rt/lib/CMakeLists.txt -=================================================================== ---- llvm-toolchain-snapshot_11~++20200418115741+8e0c5f72005.orig/compiler-rt/lib/CMakeLists.txt -+++ llvm-toolchain-snapshot_11~++20200418115741+8e0c5f72005/compiler-rt/lib/CMakeLists.txt -@@ -57,7 +57,10 @@ if(COMPILER_RT_BUILD_XRAY) - endif() - - if(COMPILER_RT_BUILD_LIBFUZZER) -- compiler_rt_build_runtime(fuzzer) -+ if(NOT(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i386" OR CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i686")) -+ # Disabled because of https://bugs.llvm.org/show_bug.cgi?id=43677 -+ compiler_rt_build_runtime(fuzzer) -+ endif() - endif() - - # It doesn't normally make sense to build runtimes when a sanitizer is enabled, -Index: llvm-toolchain-snapshot_11~++20200418115741+8e0c5f72005/compiler-rt/test/CMakeLists.txt -=================================================================== ---- llvm-toolchain-snapshot_11~++20200418115741+8e0c5f72005.orig/compiler-rt/test/CMakeLists.txt -+++ llvm-toolchain-snapshot_11~++20200418115741+8e0c5f72005/compiler-rt/test/CMakeLists.txt -@@ -55,7 +55,10 @@ if(COMPILER_RT_CAN_EXECUTE_TESTS) - - # OpenBSD not supporting asan, cannot run the tests - if(COMPILER_RT_BUILD_LIBFUZZER AND NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD" AND NOT ANDROID) -- compiler_rt_test_runtime(fuzzer) -+ if(NOT(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i386" OR CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i686")) -+ # Disabled because of https://bugs.llvm.org/show_bug.cgi?id=43677 -+ compiler_rt_test_runtime(fuzzer) -+ endif() - endif() - - foreach(sanitizer ${COMPILER_RT_SANITIZERS_TO_BUILD}) diff --git a/debian/patches/series b/debian/patches/series index ea1fb4a9..0e5c040f 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -133,7 +133,8 @@ workaround-bug-42994-use-linker.diff # bug 939472 #try-to-unbreak-thinlto.diff D67877.patch -disable-fuzzer-compiler-rt-x86.diff + +x86-fuzzer.patch python3-shebang.patch print-lldb-path.patch diff --git a/debian/patches/x86-fuzzer.patch b/debian/patches/x86-fuzzer.patch new file mode 100644 index 00000000..1e1895e8 --- /dev/null +++ b/debian/patches/x86-fuzzer.patch @@ -0,0 +1,14 @@ +Description: fuzzer: EMULATION_ARGUMENT is also required when building on i386 for x86_64 +Author: Adrian Bunk + +--- llvm-toolchain-11-11.0.0.orig/compiler-rt/lib/fuzzer/CMakeLists.txt ++++ llvm-toolchain-11-11.0.0/compiler-rt/lib/fuzzer/CMakeLists.txt +@@ -121,6 +121,8 @@ if(OS_NAME MATCHES "Linux|Fuchsia" AND + macro(partially_link_libcxx name dir arch) + if(${arch} MATCHES "i386") + set(EMULATION_ARGUMENT "-m" "elf_i386") ++ elseif(${arch} MATCHES "x86_64") ++ set(EMULATION_ARGUMENT "-m" "elf_x86_64") + else() + set(EMULATION_ARGUMENT "") + endif() diff --git a/debian/qualify-clang.sh b/debian/qualify-clang.sh index 7b1f9f3b..82389f68 100755 --- a/debian/qualify-clang.sh +++ b/debian/qualify-clang.sh @@ -592,14 +592,9 @@ if ! ./a.out 2>&1 | grep -q -E "(Test unit written|PreferSmall)"; then exit 42 fi -# do not fail on i386 because of: -# https://bugs.llvm.org/show_bug.cgi?id=43677 -# https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/commit/9d4d39eef90f5106080ab7f4394a5a4d743cac05 -if [ $DEB_HOST_ARCH != "i386" ]; then - clang++-$VERSION -fsanitize=address,fuzzer test_fuzzer.cc - if ! ./a.out 2>&1 | grep -q "libFuzzer: deadly signal"; then - echo "fuzzer failed" - fi +clang++-$VERSION -fsanitize=address,fuzzer test_fuzzer.cc +if ! ./a.out 2>&1 | grep -q "libFuzzer: deadly signal"; then + echo "fuzzer failed" fi echo 'int main(int argc, char **argv) {