Merge remote-tracking branch 'origin/7' into 7-bootstrap

This commit is contained in:
Sylvestre Ledru 2018-11-01 20:56:14 +01:00
commit f213248be1
6 changed files with 284 additions and 29 deletions

11
debian/changelog vendored
View File

@ -11,6 +11,17 @@ llvm-toolchain-7 (1:7-7~exp2) experimental; urgency=medium
* Declare some variables (-Wno-*) for all platforms (was failing on mips)
* Update the watch file to display the right version
(even if the download will fail)
* clang-7 suggests libomp-7-dev instead of libomp-dev
* Make sure that we don't conflict openmp & libc++ with llvm-defaults's
(Closes: #912544)
* Handle better the non coinstability of openmp & libc++ (like we are doing
with python-clang-*)
* Backport upstream fix D51749 to address a rust aarch64 issues
(Closes: #909705)
* Add tests from old bugs to make sure they don't come back
(Closes: #889832, #827866)
* The sanitizers use the versionned llvm-symbolizer provided by the
llvm-X package (Closes: #753572)
-- Sylvestre Ledru <sylvestre@debian.org> Sun, 21 Oct 2018 18:34:20 +0200

59
debian/control vendored
View File

@ -31,7 +31,7 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${dep:devlibs},
${dep:devlibs-objc}, libclang-common-7-dev (= ${binary:Version}),
libclang1-7 (= ${binary:Version}), libc6-dev, binutils
Provides: c-compiler, objc-compiler, c++-compiler
Recommends: llvm-7-dev, python, libomp-dev
Recommends: llvm-7-dev, python, libomp-7-dev
Suggests: clang-7-doc
Description: C, C++ and Objective-C compiler
Clang project is a C, C++, Objective C and Objective C++ front-end
@ -293,7 +293,7 @@ Description: Modular compiler and toolchain technologies, libraries and headers
Package: llvm-7-tools
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, python,
Depends: ${shlibs:Depends}, ${misc:Depends}, python,
python-pygments, python-yaml,
llvm-7-dev (= ${binary:Version})
Description: Modular compiler and toolchain technologies, tools
@ -476,16 +476,18 @@ Description: Next generation, high-performance debugger, header files
# ------------- openmp -------------
# 44 because it was the first version in which openmp & libc++ have been
# managed in llvm-defaults
Package: libomp-7-dev
Section: libdevel
Architecture: amd64 arm64 armhf i386 mips64el ppc64el ppc64
Depends: libomp5-7 (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends}
Suggests: libomp-7-doc
Breaks: libiomp-dev (<< 3.7-1), libomp-dev (<< 7~+rc1-1~exp1)
Conflicts: libomp-dev
Replaces: libomp-dev
Provides: libomp-dev
Breaks: libiomp-dev (<< 3.7-1), libomp-dev (<< 44)
Provides: libomp-x.y-dev
Conflicts: libomp-x.y-dev
Replaces: libomp-x.y-dev
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
@ -495,11 +497,10 @@ Package: libomp5-7
Multi-Arch: same
Architecture: amd64 arm64 armhf i386 mips64el ppc64el ppc64
Depends: ${shlibs:Depends}, ${misc:Depends}
Breaks: libomp5 (<< 7~+rc1-1~exp1)
Conflicts: libomp5
Replaces: libomp5
Provides: libomp5
# TODO add the break 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
@ -509,8 +510,8 @@ Package: libomp-7-doc
Section: doc
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, libjs-jquery
Replaces: libiomp-doc
Breaks: libiomp-doc
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
@ -527,10 +528,10 @@ Multi-Arch: same
Pre-Depends: ${misc:Pre-Depends}
Depends: ${shlibs:Depends}, ${misc:Depends}
Suggests: clang
Breaks: libc++1 (<< 7~+rc1-1~exp1)
Conflicts: libc++1
Replaces: libc++1
Provides: libc++1
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.
.
@ -549,10 +550,10 @@ Section: libdevel
Architecture: any
Multi-Arch: same
Depends: libc++1-7 (= ${binary:Version}), ${misc:Depends}
Breaks: libc++-dev (<< 7~+rc1-1~exp1)
Conflicts: libc++-dev
Provides: libc++-dev
Replaces: libc++-dev
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
.
@ -574,10 +575,10 @@ Architecture: any
Multi-Arch: same
Pre-Depends: ${misc:Pre-Depends}
Depends: ${shlibs:Depends}, ${misc:Depends}
Breaks: libc++abi1 (<< 7~+rc1-1~exp1)
Conflicts: libc++abi1
Provides: libc++abi1
Replaces: libc++abi1
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.
@ -592,10 +593,10 @@ Section: libdevel
Architecture: any
Multi-Arch: same
Depends: libc++abi1-7 (= ${binary:Version}), ${misc:Depends}
Breaks: libc++abi-dev (<= 6.0.1-1),
Conflicts: libc++abi-dev
Provides: libc++abi-dev
Replaces: libc++abi-dev
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.

View File

@ -0,0 +1,152 @@
From 1c34cd56bc59b1540e0a814d2f80ade77daa9248 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Tue, 11 Sep 2018 17:52:01 +0000
Subject: [PATCH] [GlobalISel] Lower dbg.declare into indirect DBG_VALUE
Summary:
D31439 changed the semantics of dbg.declare to take the address of a
variable as the first argument, making it indirect. It specifically
updated FastISel for this change here:
https://reviews.llvm.org/D31439#change-WVArzi177jPl
GlobalISel needs to follow suit, or else it will be missing a level of
indirection in the generated debuginfo. This problem was seen in a Rust
debuginfo test on aarch64, since GlobalISel is used at -O0 for aarch64.
https://github.com/rust-lang/rust/issues/49807
https://bugzilla.redhat.com/show_bug.cgi?id=1611597
https://bugzilla.redhat.com/show_bug.cgi?id=1625768
Reviewers: dblaikie, aprantl, t.p.northover, javed.absar, rnk
Reviewed By: rnk
Subscribers: #debug-info, rovka, kristof.beyls, JDevlieghere, llvm-commits, tstellar
Differential Revision: https://reviews.llvm.org/D51749
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@341969 91177308-0d34-0410-b5e6-96231b3b80d8
---
lib/CodeGen/GlobalISel/IRTranslator.cpp | 9 ++-
test/CodeGen/AArch64/GlobalISel/debug-cpp.ll | 67 +++++++++++++++++++
.../CodeGen/AArch64/GlobalISel/debug-insts.ll | 4 +-
3 files changed, 74 insertions(+), 6 deletions(-)
create mode 100644 test/CodeGen/AArch64/GlobalISel/debug-cpp.ll
Index: llvm-toolchain-7-7/lib/CodeGen/GlobalISel/IRTranslator.cpp
===================================================================
--- llvm-toolchain-7-7.orig/lib/CodeGen/GlobalISel/IRTranslator.cpp
+++ llvm-toolchain-7-7/lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -763,9 +763,12 @@ bool IRTranslator::translateKnownIntrins
// instructions (in fact, they get ignored if they *do* exist).
MF->setVariableDbgInfo(DI.getVariable(), DI.getExpression(),
getOrCreateFrameIndex(*AI), DI.getDebugLoc());
- } else
- MIRBuilder.buildDirectDbgValue(getOrCreateVReg(*Address),
- DI.getVariable(), DI.getExpression());
+ } else {
+ // A dbg.declare describes the address of a source variable, so lower it
+ // into an indirect DBG_VALUE.
+ MIRBuilder.buildIndirectDbgValue(getOrCreateVReg(*Address),
+ DI.getVariable(), DI.getExpression());
+ }
return true;
}
case Intrinsic::vaend:
Index: llvm-toolchain-7-7/test/CodeGen/AArch64/GlobalISel/debug-cpp.ll
===================================================================
--- /dev/null
+++ llvm-toolchain-7-7/test/CodeGen/AArch64/GlobalISel/debug-cpp.ll
@@ -0,0 +1,67 @@
+; RUN: llc -global-isel -mtriple=aarch64 %s -stop-after=irtranslator -o - | FileCheck %s
+; RUN: llc -mtriple=aarch64 -global-isel --global-isel-abort=0 -o /dev/null
+
+; struct NTCopy {
+; NTCopy();
+; NTCopy(const NTCopy &);
+; int x;
+; };
+; int foo(NTCopy o) {
+; return o.x;
+; }
+
+; ModuleID = 'ntcopy.cpp'
+source_filename = "ntcopy.cpp"
+target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
+target triple = "aarch64-unknown-linux-gnu"
+
+%struct.NTCopy = type { i32 }
+
+; CHECK-LABEL: name: _Z3foo6NTCopy
+; CHECK: DBG_VALUE debug-use %{{[0-9]+}}(p0), 0, !23, !DIExpression(), debug-location !24
+; Function Attrs: noinline nounwind optnone
+define dso_local i32 @_Z3foo6NTCopy(%struct.NTCopy* %o) #0 !dbg !7 {
+entry:
+ call void @llvm.dbg.declare(metadata %struct.NTCopy* %o, metadata !23, metadata !DIExpression()), !dbg !24
+ %x = getelementptr inbounds %struct.NTCopy, %struct.NTCopy* %o, i32 0, i32 0, !dbg !25
+ %0 = load i32, i32* %x, align 4, !dbg !25
+ ret i32 %0, !dbg !26
+}
+
+; Function Attrs: nounwind readnone speculatable
+declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
+
+attributes #0 = { noinline nounwind optnone }
+attributes #1 = { nounwind readnone speculatable }
+
+!llvm.dbg.cu = !{!0}
+!llvm.module.flags = !{!3, !4, !5}
+!llvm.ident = !{!6}
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 8.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
+!1 = !DIFile(filename: "ntcopy.cpp", directory: "/tmp")
+!2 = !{}
+!3 = !{i32 2, !"Dwarf Version", i32 4}
+!4 = !{i32 2, !"Debug Info Version", i32 3}
+!5 = !{i32 1, !"wchar_size", i32 4}
+!6 = !{!"clang version 8.0.0 "}
+!7 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foo6NTCopy", scope: !1, file: !1, line: 6, type: !8, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
+!8 = !DISubroutineType(types: !9)
+!9 = !{!10, !11}
+!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "NTCopy", file: !1, line: 1, size: 32, flags: DIFlagTypePassByReference, elements: !12, identifier: "_ZTS6NTCopy")
+!12 = !{!13, !14, !18}
+!13 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !11, file: !1, line: 4, baseType: !10, size: 32)
+!14 = !DISubprogram(name: "NTCopy", scope: !11, file: !1, line: 2, type: !15, isLocal: false, isDefinition: false, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false)
+!15 = !DISubroutineType(types: !16)
+!16 = !{null, !17}
+!17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!18 = !DISubprogram(name: "NTCopy", scope: !11, file: !1, line: 3, type: !19, isLocal: false, isDefinition: false, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false)
+!19 = !DISubroutineType(types: !20)
+!20 = !{null, !17, !21}
+!21 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !22, size: 64)
+!22 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !11)
+!23 = !DILocalVariable(name: "o", arg: 1, scope: !7, file: !1, line: 6, type: !11)
+!24 = !DILocation(line: 6, column: 16, scope: !7)
+!25 = !DILocation(line: 7, column: 12, scope: !7)
+!26 = !DILocation(line: 7, column: 3, scope: !7)
Index: llvm-toolchain-7-7/test/CodeGen/AArch64/GlobalISel/debug-insts.ll
===================================================================
--- llvm-toolchain-7-7.orig/test/CodeGen/AArch64/GlobalISel/debug-insts.ll
+++ llvm-toolchain-7-7/test/CodeGen/AArch64/GlobalISel/debug-insts.ll
@@ -6,18 +6,16 @@
; CHECK: - { id: {{.*}}, name: in.addr, type: default, offset: 0, size: {{.*}}, alignment: {{.*}},
; CHECK-NEXT: callee-saved-register: '', callee-saved-restored: true,
; CHECK-NEXT: debug-info-variable: '!11', debug-info-expression: '!DIExpression()',
-; CHECK: DBG_VALUE debug-use %0(s32), debug-use $noreg, !11, !DIExpression(), debug-location !12
define void @debug_declare(i32 %in) #0 !dbg !7 {
entry:
%in.addr = alloca i32, align 4
store i32 %in, i32* %in.addr, align 4
call void @llvm.dbg.declare(metadata i32* %in.addr, metadata !11, metadata !DIExpression()), !dbg !12
- call void @llvm.dbg.declare(metadata i32 %in, metadata !11, metadata !DIExpression()), !dbg !12
ret void, !dbg !12
}
; CHECK-LABEL: name: debug_declare_vla
-; CHECK: DBG_VALUE debug-use %{{[0-9]+}}(p0), debug-use $noreg, !14, !DIExpression(), debug-location !15
+; CHECK: DBG_VALUE debug-use %{{[0-9]+}}(p0), 0, !14, !DIExpression(), debug-location !15
define void @debug_declare_vla(i32 %in) #0 !dbg !13 {
entry:
%vla.addr = alloca i32, i32 %in

View File

@ -82,3 +82,6 @@ bootstrap-with-openmp-version-export-missing.diff
hurd-lib_Support_Unix_Path.inc.diff
hurd-tools_llvm-shlib_CMakeLists.txt.diff
clangd-atomic-cmake.patch
rustc-aarch64-test-failure.diff
symbolizer-path.diff

24
debian/patches/symbolizer-path.diff vendored Normal file
View File

@ -0,0 +1,24 @@
Index: llvm-toolchain-7-7/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
===================================================================
--- llvm-toolchain-7-7.orig/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
+++ llvm-toolchain-7-7/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
@@ -26,6 +26,10 @@
#include "sanitizer_symbolizer_internal.h"
#include "sanitizer_symbolizer_libbacktrace.h"
#include "sanitizer_symbolizer_mac.h"
+#include "llvm/Config/llvm-config.h" // for LLVM_VERSION_MAJOR
+
+#define TOSTR2(X) #X
+#define TOSTR(X) TOSTR2(X)
#include <dlfcn.h> // for dlsym()
#include <errno.h>
@@ -481,7 +485,7 @@ static SymbolizerTool *ChooseExternalSym
return new(*allocator) AtosSymbolizer(found_path, allocator);
}
#endif // SANITIZER_MAC
- if (const char *found_path = FindPathToBinary("llvm-symbolizer")) {
+ if (const char *found_path = "/usr/bin/llvm-symbolizer-" TOSTR(LLVM_VERSION_MAJOR)) {
VReport(2, "Using llvm-symbolizer found at: %s\n", found_path);
return new(*allocator) LLVMSymbolizer(found_path, allocator);
}

View File

@ -76,6 +76,15 @@ fi
echo '#include <emmintrin.h>' > foo.cc
clang++-$VERSION -c foo.cc
# bug 827866
echo 'bool testAndSet(void *atomic) {
return __atomic_test_and_set(atomic, __ATOMIC_SEQ_CST);
}'> foo.cpp
clang++-$VERSION -c -target aarch64-linux-gnu foo.cpp
if ! file foo.o 2>&1 | grep -q "aarch64"; then
echo "Could not find the string 'aarch64' in the output of file"
exit 42
fi
echo '
#include <string.h>
int
@ -167,6 +176,56 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
}
EOF
echo 'int main(int argc, char **argv) {
int *array = new int[100];
delete [] array;
return array[argc]; // BOOM
}' > foo.cpp
clang++-$VERSION -O1 -g -fsanitize=address -fno-omit-frame-pointer foo.cpp
ASAN_OPTIONS=verbosity=1 ./a.out &> foo.log || true
if ! grep "Init done" foo.log; then
echo "asan verbose mode failed"
cat foo.log
exit 42
fi
if test ! -f /usr/lib/llvm-$VERSION/bin/llvm-symbolizer; then
echo "Install llvm-$VERSION"
exit 1
fi
# See also https://bugs.llvm.org/show_bug.cgi?id=39514 why
# /usr/bin/llvm-symbolizer-7 doesn't work
ASAN_OPTIONS=verbosity=2:external_symbolizer_path=/usr/lib/llvm-$VERSION/bin/llvm-symbolizer ./a.out &> foo.log || true
if ! grep "Using llvm-symbolizer" foo.log; then
echo "could not find llvm-symbolizer path"
cat foo.log
exit 42
fi
if ! grep "new\[\](unsigned long)" foo.log; then
echo "could not symbolize correctly"
cat foo.log
exit 42
fi
if ! grep "foo.cpp:3:3" foo.log; then
echo "could not symbolize correctly"
cat foo.log
exit 42
fi
./a.out &> foo.log || true
if ! grep "new\[\](unsigned long)" foo.log; then
echo "could not symbolize correctly"
cat foo.log
exit 42
fi
if ! grep "foo.cpp:3:3" foo.log; then
echo "could not symbolize correctly"
cat foo.log
exit 42
fi
if test ! -f /usr/lib/llvm-$VERSION/lib/libFuzzer.a; then
echo "Install libfuzzer-$VERSION-dev";
exit -1;
@ -179,6 +238,7 @@ if ! ./a.out 2>&1 | grep -q -E "(Test unit written|PreferSmall)"; then
fi
# fails on 32 bit, seems a real BUG in the package, using 64bit static libs?
LANG=C clang-$VERSION -fsanitize=fuzzer test_fuzzer.cc &> foo.log
if ! grep "No such file or directory" foo.log; then
@ -255,6 +315,10 @@ clang++-$VERSION -std=c++11 -stdlib=libc++ foo.cpp -o o
clang++-$VERSION -std=c++14 -stdlib=libc++ foo.cpp -lc++experimental -o o
./o > /dev/null
# Bug 889832
echo '#include <iostream>
int main() {}' | clang++-$VERSION -std=c++1z -x c++ -stdlib=libc++ -
if test ! -f /usr/lib/llvm-$VERSION/include/cxxabi.h; then
echo "Install libc++abi-$VERSION-dev";
exit -1;