* New snapshot release

* d/p/0011-SimplifyCFG-Hoisting-invalidates-metadata.patch: Also apply bug 29163
  to fix some issues in rust (Closes: #842956)
  Many thanks to Ximin Luo for the investigation
* libclang-common-4.0-dev: missing multilib binaries for the sanitizer
  libraries (Closes: #841923)
  Many thanks to Norbert Lange for the changes
* d/p/clang-fix-cmpxchg8-detection-on-i386.patch:
  libcxx atomic tests for old i386 fail with wrong Atomic inline width.
  Needed for libc++
  (See https://llvm.org/bugs/show_bug.cgi?id=19355)
* d/p lldb-addversion-suffix-to-llvm-server-exec.patch:
  Fix the lldb-server call in some cases
* LLVMConfig.cmake was installed into wrong location
  Install a symlink from lib/cmake/llvm to share/llvm/cmake
  (Closes: #839234)
* Fix a path issue in scan-view. Thanks Riccardo Magliocchetti
  (Closes: #838572)
* The libstdc++-6-dev & libobjc-6-dev are only install with clang-X.Y
  and libclang-X.Y-dev and no longer with libclang1-X.Y
  (Closes: #841309)
* Team upload
* d/p/drop-wrong-hack-arm64.patch:
  - drop hack that was preventing the package from building on
    non-amd64 64bit architectures:
This commit is contained in:
Sylvestre Ledru 2016-11-11 17:45:18 +00:00
commit 18c9c055a5
13 changed files with 318 additions and 7 deletions

52
debian/changelog vendored
View File

@ -1,5 +1,8 @@
llvm-toolchain-snapshot (1:4.0~svn285794-1~exp0.1) UNRELEASED; urgency=medium
llvm-toolchain-snapshot (1:4.0~svn286225-1) unstable; urgency=medium
* New snapshot release
[ Kai Wasserbäch ]
* debian/patches/{0003-Debian-version-info-and-bugreport.patch,
0044-soname.diff,23-strlcpy_strlcat_warning_removed.diff,
26-set-correct-float-abi.diff,atomic_library_[12].diff,
@ -8,7 +11,7 @@ llvm-toolchain-snapshot (1:4.0~svn285794-1~exp0.1) UNRELEASED; urgency=medium
Refreshed.
* debian/patches/{silent-gold-utils,kfreebsd-support}.diff: Updated.
-- Kai Wasserbäch <curan@debian.org> Wed, 02 Nov 2016 18:12:12 +0100
-- Sylvestre Ledru <sylvestre@debian.org> Tue, 08 Nov 2016 12:19:55 +0100
llvm-toolchain-snapshot (1:4.0~svn282142-1~exp1) experimental; urgency=medium
@ -26,6 +29,51 @@ llvm-toolchain-snapshot (1:4.0~svn282142-1~exp1) experimental; urgency=medium
-- Sylvestre Ledru <sylvestre@debian.org> Mon, 24 Oct 2016 10:45:07 +0200
llvm-toolchain-3.9 (1:3.9-5) unstable; urgency=medium
* d/p/0011-SimplifyCFG-Hoisting-invalidates-metadata.patch: Also apply bug 29163
to fix some issues in rust (Closes: #842956)
Many thanks to Ximin Luo for the investigation
* libclang-common-4.0-dev: missing multilib binaries for the sanitizer
libraries (Closes: #841923)
Many thanks to Norbert Lange for the changes
[ Pauli ]
* d/p/clang-fix-cmpxchg8-detection-on-i386.patch:
libcxx atomic tests for old i386 fail with wrong Atomic inline width.
Needed for libc++
(See https://llvm.org/bugs/show_bug.cgi?id=19355)
* d/p lldb-addversion-suffix-to-llvm-server-exec.patch:
Fix the lldb-server call in some cases
-- Sylvestre Ledru <sylvestre@debian.org> Fri, 04 Nov 2016 17:18:07 +0100
llvm-toolchain-3.9 (1:3.9-4) unstable; urgency=medium
* LLVMConfig.cmake was installed into wrong location
Install a symlink from lib/cmake/llvm to share/llvm/cmake
(Closes: #839234)
* Fix a path issue in scan-view. Thanks Riccardo Magliocchetti
(Closes: #838572)
-- Sylvestre Ledru <sylvestre@debian.org> Mon, 31 Oct 2016 10:47:52 +0100
llvm-toolchain-3.9 (1:3.9-3) unstable; urgency=medium
[ Sylvestre Ledru ]
* The libstdc++-6-dev & libobjc-6-dev are only install with clang-X.Y
and libclang-X.Y-dev and no longer with libclang1-X.Y
(Closes: #841309)
[ Gianfranco Costamagna ]
* Team upload
* d/p/drop-wrong-hack-arm64.patch:
- drop hack that was preventing the package from building on
non-amd64 64bit architectures:
-- Gianfranco Costamagna <locutusofborg@debian.org> Thu, 27 Oct 2016 11:45:28 +0200
llvm-toolchain-snapshot (1:4.0~svn280796-1~exp1) experimental; urgency=medium
* Merge clang-include-fixer-4.0 into clang-4.0. Don't think

3
debian/control vendored
View File

@ -8,7 +8,8 @@ Build-Depends: debhelper (>= 9.0), flex, bison, dejagnu, tcl, expect,
lsb-release, patchutils, diffstat, xz-utils, python-dev,
libedit-dev, swig, python-six, python-sphinx, ocaml-nox, binutils-dev,
libjsoncpp-dev,
lcov, procps, help2man, dh-ocaml, zlib1g-dev
lcov, procps, help2man, dh-ocaml, zlib1g-dev,
g++-multilib [amd64 i386 kfreebsd-amd64 mips mips64 mips64el mipsel powerpc ppc64 s390 s390x sparc sparc64 x32] <!cross>
Build-Conflicts: oprofile, ocaml, libllvm-3.4-ocaml-dev, libllvm-3.5-ocaml-dev,
libllvm-3.8-ocaml-dev, libllvm-3.9-ocaml-dev
Standards-Version: 3.9.8

View File

@ -15,4 +15,5 @@ usr/lib/llvm-@LLVM_VERSION@/share/ usr/lib/llvm-@LLVM_VERSION@/build/share
usr/lib/llvm-@LLVM_VERSION@/ usr/lib/llvm-@LLVM_VERSION@/build/Release
usr/lib/llvm-@LLVM_VERSION@/ usr/lib/llvm-@LLVM_VERSION@/build/Debug+Asserts
usr/lib/llvm-@LLVM_VERSION@/lib/llvm/cmake usr/lib/llvm-@LLVM_VERSION@/cmake
usr/lib/llvm-@LLVM_VERSION@/lib/cmake/llvm usr/lib/llvm-@LLVM_VERSION@/cmake
usr/lib/llvm-@LLVM_VERSION@/lib/cmake/llvm usr/lib/llvm-@LLVM_VERSION@/share/llvm/cmake

View File

@ -0,0 +1,84 @@
From eee68eafa7e8e4ce996b49f5551636639a6c331a Mon Sep 17 00:00:00 2001
From: David Majnemer <david.majnemer@gmail.com>
Date: Mon, 29 Aug 2016 17:14:08 +0000
Subject: [PATCH 11/17] [SimplifyCFG] Hoisting invalidates metadata
We forgot to remove optimization metadata when performing hosting during
FoldTwoEntryPHINode.
This fixes PR29163.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279980 91177308-0d34-0410-b5e6-96231b3b80d8
---
lib/Transforms/Utils/SimplifyCFG.cpp | 10 ++++++++--
test/Transforms/SimplifyCFG/PR29163.ll | 31 +++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+), 2 deletions(-)
create mode 100644 test/Transforms/SimplifyCFG/PR29163.ll
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp
index 0504646..c197317 100644
--- a/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -2024,14 +2024,20 @@ static bool FoldTwoEntryPHINode(PHINode *PN, const TargetTransformInfo &TTI,
// Move all 'aggressive' instructions, which are defined in the
// conditional parts of the if's up to the dominating block.
- if (IfBlock1)
+ if (IfBlock1) {
+ for (auto &I : *IfBlock1)
+ I.dropUnknownNonDebugMetadata();
DomBlock->getInstList().splice(InsertPt->getIterator(),
IfBlock1->getInstList(), IfBlock1->begin(),
IfBlock1->getTerminator()->getIterator());
- if (IfBlock2)
+ }
+ if (IfBlock2) {
+ for (auto &I : *IfBlock2)
+ I.dropUnknownNonDebugMetadata();
DomBlock->getInstList().splice(InsertPt->getIterator(),
IfBlock2->getInstList(), IfBlock2->begin(),
IfBlock2->getTerminator()->getIterator());
+ }
while (PHINode *PN = dyn_cast<PHINode>(BB->begin())) {
// Change the PHI node into a select instruction.
diff --git a/test/Transforms/SimplifyCFG/PR29163.ll b/test/Transforms/SimplifyCFG/PR29163.ll
new file mode 100644
index 0000000..65f9090
--- /dev/null
+++ b/test/Transforms/SimplifyCFG/PR29163.ll
@@ -0,0 +1,31 @@
+; RUN: opt -S -simplifycfg < %s | FileCheck %s
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+@GV = external constant i64*
+
+define i64* @test1(i1 %cond, i8* %P) {
+entry:
+ br i1 %cond, label %if, label %then
+
+then:
+ %bc = bitcast i8* %P to i64*
+ br label %join
+
+if:
+ %load = load i64*, i64** @GV, align 8, !dereferenceable !0
+ br label %join
+
+join:
+ %phi = phi i64* [ %bc, %then ], [ %load, %if ]
+ ret i64* %phi
+}
+
+; CHECK-LABEL: define i64* @test1(
+; CHECK: %[[bc:.*]] = bitcast i8* %P to i64*
+; CHECK: %[[load:.*]] = load i64*, i64** @GV, align 8{{$}}
+; CHECK: %[[phi:.*]] = select i1 %cond, i64* %[[load]], i64* %[[bc]]
+; CHECK: ret i64* %[[phi]]
+
+
+!0 = !{i64 8}
--
2.10.1

0
debian/patches/bug-30342.diff vendored Normal file
View File

View File

@ -0,0 +1,15 @@
Set i386 default target CPU to be i686 (same as gcc)
Closes: #812803
Index: llvm-toolchain-3.9-3.9/clang/lib/Driver/Tools.cpp
===================================================================
--- llvm-toolchain-3.9-3.9.orig/clang/lib/Driver/Tools.cpp
+++ llvm-toolchain-3.9-3.9/clang/lib/Driver/Tools.cpp
@@ -1898,6 +1898,7 @@ static const char *getX86TargetCPU(const
case llvm::Triple::Haiku:
return "i586";
case llvm::Triple::Bitrig:
+ case llvm::Triple::Linux:
return "i686";
default:
// Fallback to p4.

View File

@ -0,0 +1,67 @@
libcxx atomic tests for old i386 fail with wrong Atomic inline width.
cmpxchg8b instruction is required for 8 byte atomics that clang was
assuming.
Too bad _GCC_ATOMIC_LLONG_LOCK_FREE 2 isn't supported even with this change
because llvm doesn't support unaligned atomic compare and exchange operation.
Fallback calls to libatomic.so should handle long long lock free but clang
can't tell program if libatomic is always lock free.
Related bug: https://llvm.org/bugs/show_bug.cgi?id=19355
Index: llvm-toolchain-3.9-3.9/clang/lib/Basic/Targets.cpp
===================================================================
--- llvm-toolchain-3.9-3.9.orig/clang/lib/Basic/Targets.cpp
+++ llvm-toolchain-3.9-3.9/clang/lib/Basic/Targets.cpp
@@ -2609,7 +2609,10 @@ class X86TargetInfo : public TargetInfo
FP_SSE,
FP_387
} FPMath = FP_Default;
-
+protected:
+ bool isCmpXChg8Supported() const {
+ return CPU >= CK_i586;
+ }
public:
X86TargetInfo(const llvm::Triple &Triple, const TargetOptions &)
: TargetInfo(Triple) {
@@ -2701,6 +2704,8 @@ public:
// acceptable.
// FIXME: This results in terrible diagnostics. Clang just says the CPU is
// invalid without explaining *why*.
+ if (!isCmpXChg8Supported())
+ MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 32;
switch (CPU) {
case CK_Generic:
// No processor selected!
@@ -3730,7 +3735,7 @@ void X86TargetInfo::getTargetDefines(con
Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2");
Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4");
}
- if (CPU >= CK_i586)
+ if (isCmpXChg8Supported())
Builder.defineMacro("__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8");
}
@@ -4009,8 +4014,6 @@ public:
(1 << TargetInfo::LongDouble));
// x86-32 has atomics up to 8 bytes
- // FIXME: Check that we actually have cmpxchg8b before setting
- // MaxAtomicInlineWidth. (cmpxchg8b is an i586 instruction.)
MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
}
BuiltinVaListKind getBuiltinVaListKind() const override {
Index: llvm-toolchain-3.9-3.9/clang/test/Sema/atomic-ops.c
===================================================================
--- llvm-toolchain-3.9-3.9.orig/clang/test/Sema/atomic-ops.c
+++ llvm-toolchain-3.9-3.9/clang/test/Sema/atomic-ops.c
@@ -14,7 +14,7 @@ _Static_assert(__GCC_ATOMIC_WCHAR_T_LOCK
_Static_assert(__GCC_ATOMIC_SHORT_LOCK_FREE == 2, "");
_Static_assert(__GCC_ATOMIC_INT_LOCK_FREE == 2, "");
_Static_assert(__GCC_ATOMIC_LONG_LOCK_FREE == 2, "");
-#ifdef __i386__
+#if defined(__i386__)
_Static_assert(__GCC_ATOMIC_LLONG_LOCK_FREE == 1, "");
#else
_Static_assert(__GCC_ATOMIC_LLONG_LOCK_FREE == 2, "");

21
debian/patches/fix-scan-view-path.diff vendored Normal file
View File

@ -0,0 +1,21 @@
Index: llvm-toolchain-3.9-3.9/clang/tools/scan-view/bin/scan-view
===================================================================
--- llvm-toolchain-3.9-3.9.orig/clang/tools/scan-view/bin/scan-view
+++ llvm-toolchain-3.9-3.9/clang/tools/scan-view/bin/scan-view
@@ -23,6 +23,7 @@ kDefaultPort = 8181
kMaxPortsToTry = 100
###
+BASE_DIR = '/usr/share/clang/scan-view-3.9'
def url_is_up(url):
@@ -61,7 +62,7 @@ def start_browser(port, options):
def run(port, options, root):
# Prefer to look relative to the installed binary
- share = os.path.dirname(__file__) + "/../share/"
+ share = os.path.join(BASE_DIR, 'share')
if not os.path.isdir(share):
# Otherwise look relative to the source
share = os.path.dirname(__file__) + "/../../scan-view/share"

View File

@ -0,0 +1,49 @@
lldb-server exec users always /usr/bin/lldb-server. Server is required
for any debugging with lldb which makes it unusable unless default version
package has been installed. Small changes to code and debian/rules allows
a workaround for lldb-server start up.
To use this one needs to add cmake defination during configure. eg
-DDEBIAN_VERSION_SUFFIX=-$(LLVM_VERSION)
Better implementation would be to use /usr/share/llvm-$(VERSION)/bin but
that change seems to require a big change to the path handling code
which could then break something else.
This probably should have upstream bug but I couldn't find any existing report.
Index: llvm-toolchain-snapshot_4.0~svn286225/CMakeLists.txt
===================================================================
--- llvm-toolchain-snapshot_4.0~svn286225.orig/CMakeLists.txt
+++ llvm-toolchain-snapshot_4.0~svn286225/CMakeLists.txt
@@ -49,6 +49,10 @@ project(LLVM
${cmake_3_0_LANGUAGES}
C CXX ASM)
+set(DEBIAN_VERSION_SUFFIX "" CACHE STRING "Versioned program suffix that is required to exec correct subtool.")
+
+add_definitions( -DDEBIAN_VERSION_SUFFIX=\"${DEBIAN_VERSION_SUFFIX}\")
+
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "No build type selected, default to Debug")
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type (default Debug)" FORCE)
Index: llvm-toolchain-snapshot_4.0~svn286225/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
===================================================================
--- llvm-toolchain-snapshot_4.0~svn286225.orig/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ llvm-toolchain-snapshot_4.0~svn286225/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -36,10 +36,14 @@
// Project includes
#include "ProcessGDBRemoteLog.h"
+#ifndef DEBIAN_VERSION_SUFFIX
+#define DEBIAN_VERSION_SUFFIX ""
+#endif
+
#if defined(__APPLE__)
#define DEBUGSERVER_BASENAME "debugserver"
#else
-#define DEBUGSERVER_BASENAME "lldb-server"
+# define DEBUGSERVER_BASENAME "lldb-server" DEBIAN_VERSION_SUFFIX
#endif
#if defined(HAVE_LIBCOMPRESSION)

View File

@ -20,7 +20,7 @@ do-not-fail-on-unexpected-pass.diff
silent-more-tests.diff
disable-display-PASS-UNSUPPORTED-XFAIL.diff
fix-llvm-config-obj-src-root.patch
0044-soname.diff
0044-soname.diff
lldb-soname.diff
lldb-libname.diff
hurd-EIEIO-undef.diff
@ -37,3 +37,9 @@ disable-llvm-symbolizer-test.diff
kfreebsd-support.diff
fix-lldb-server-build
clang-tidy-run-bin.diff
#bug-30342.diff
fix-scan-view-path.diff
#0011-SimplifyCFG-Hoisting-invalidates-metadata.patch
clang-fix-cmpxchg8-detection-on-i386.patch
lldb-addversion-suffix-to-llvm-server-exec.patch

View File

@ -0,0 +1,12 @@
Index: llvm-toolchain-3.8-3.8.1/test/tools/llvm-symbolizer/print_context.c
===================================================================
--- llvm-toolchain-3.8-3.8.1.orig/test/tools/llvm-symbolizer/print_context.c
+++ llvm-toolchain-3.8-3.8.1/test/tools/llvm-symbolizer/print_context.c
@@ -1,6 +1,7 @@
// REQUIRES: x86_64-linux
// RUN: %host_cc -O0 -g %s -o %t 2>&1
// RUN: %t 2>&1 | llvm-symbolizer -print-source-context-lines=5 -obj=%t | FileCheck %s --check-prefix=CHECK
+// XFAIL: *
#include <stdio.h>

View File

@ -4,7 +4,12 @@ TARGET_VERSION=4.0
ORIG_VERSION_2=3_9
TARGET_VERSION_2=4_0
LIST=`ls debian/control debian/orig-tar.sh debian/rules debian/patches/clang-analyzer-force-version.diff debian/patches/clang-format-version.diff debian/patches/python-clangpath.diff debian/patches/scan-build-clang-path.diff debian/patches/lldb-libname.diff`
LIST=`ls debian/*$ORIG_VERSION*`
for F in $LIST; do
TARGET=`echo $F|sed -e "s|$ORIG_VERSION|$TARGET_VERSION|g"`
svn mv $F $TARGET
done
LIST=`ls debian/*$TARGET_VERSION* debian/control debian/*.install debian/*.links debian/orig-tar.sh debian/rules debian/patches/clang-analyzer-force-version.diff debian/patches/clang-format-version.diff debian/patches/python-clangpath.diff debian/patches/scan-build-clang-path.diff debian/patches/lldb-libname.diff debian/patches/fix-scan-view-path.diff`
for F in $LIST; do
sed -i -e "s|$ORIG_VERSION_2|$TARGET_VERSION_2|g" $F
sed -i -e "s|$ORIG_VERSION|$TARGET_VERSION|g" $F

4
debian/rules vendored
View File

@ -8,6 +8,7 @@ DEB_INST := $(CURDIR)/debian/tmp/
GCC_VERSION := $(shell dpkg-query -W -f '$${Version}' g++ | sed -rne 's,^([0-9]+:)?(5|6|[0-9]+\.[0-9]+|[0-9]+).*$$,\2,p')
LLVM_VERSION := 4.0
LLVM_VERSION_FULL := $(LLVM_VERSION).0
SONAME_EXT := 1
# Manage the case when the version is 1:3.5~svn213052-1~exp1 or 1:3.4.2-1
DEBIAN_REVISION := $(shell dpkg-parsechangelog | sed -rne "s,^Version: 1:([0-9.]+)(~|-)(.*),\3,p")
@ -420,7 +421,8 @@ override_dh_auto_install:
override_dh_shlibdeps:
LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/ dh_shlibdeps
# Ignore asan libraries. They would trigger dependencies to multiarch libraries
dh_shlibdeps -l$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/ -Xlibclang_rt.asan -Xlibclang_rt.asan
override_dh_installman:
dh_installman