From 71a5512f39b9b4a84c126df6a1a9ea6d423fd288 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 1 Sep 2016 11:48:01 +0000 Subject: [PATCH 1/8] remove the word final from the tarball generation --- debian/orig-tar.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/orig-tar.sh b/debian/orig-tar.sh index d79ec091..afaf2c90 100755 --- a/debian/orig-tar.sh +++ b/debian/orig-tar.sh @@ -104,8 +104,11 @@ else fi if test -n "$RCRELEASE"; then -# VERSION=$MAJOR_VERSION"+"$REVISION # WAS TAG - VERSION=$MAJOR_VERSION"~+"$TAG + if test "$TAG" = "final"; then + VERSION=$MAJOR_VERSION + else + VERSION=$MAJOR_VERSION"~+"$TAG + fi FULL_VERSION="llvm-toolchain-"$MAJOR_VERSION"_"$VERSION else VERSION=$CURRENT_VERSION"~svn"$REVISION From bc173cfa883f666e573906cb28135bf77a2e1c78 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 4 Sep 2016 12:25:55 +0000 Subject: [PATCH 2/8] Build lldb on arm64. Hopefully, works. --- debian/changelog | 1 + debian/control | 10 +++++----- debian/rules | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 62270c0f..19ea3966 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ llvm-toolchain-3.8 (1:3.8.1-10) UNRELEASED; urgency=medium (Closes: #835606) * Port to kfreebsd. Many thanks to Pino Toscano (Closes: #835665) + * Build lldb on arm64. Hopefully, works. -- Sylvestre Ledru Sat, 27 Aug 2016 17:36:06 +0200 diff --git a/debian/control b/debian/control index 7ad67cbf..13c6abf4 100644 --- a/debian/control +++ b/debian/control @@ -393,7 +393,7 @@ Description: Modular compiler and toolchain technologies, examples # ------------- lldb ------------- Package: lldb-3.8 -Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe sh4 x32 mips mipsel +Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe sh4 x32 mips mipsel arm64 # ia64 hurd powerpc ppc64el sparc64 ppc64 mips64el have been removed Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm3.8 (= ${binary:Version}), llvm-3.8-dev Suggests: python-lldb-3.8 @@ -405,7 +405,7 @@ Description: Next generation, high-performance debugger Project, such as the Clang expression parser and LLVM disassembler. Package: liblldb-3.8 -Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe sh4 x32 mips mipsel +Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe sh4 x32 mips mipsel arm64 # ia64 hurd powerpc ppc64el sparc64 ppc64 mips64el have been removed Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm3.8 (= ${binary:Version}) Pre-Depends: ${misc:Pre-Depends} @@ -420,7 +420,7 @@ Description: Next generation, high-performance debugger, library This package contains the LLDB runtime library. Package: liblldb-3.8-dbg -Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390 sparc hppa m68k powerpcspe sh4 x32 mips mipsel +Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390 sparc hppa m68k powerpcspe sh4 x32 mips mipsel arm64 # ia64 hurd ppc64el alpha s390x powerpc sparc64 ppc64 mips64el have been removed Depends: ${shlibs:Depends}, ${misc:Depends}, liblldb-3.8 (= ${binary:Version}) Pre-Depends: ${misc:Pre-Depends} @@ -436,7 +436,7 @@ Description: Next generation, high-performance debugger, debugging libraries Package: python-lldb-3.8 Section: python -Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe sh4 x32 mips mipsel +Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe sh4 x32 mips mipsel arm64 Depends: ${shlibs:Depends}, ${misc:Depends}, liblldb-3.8-dev, python, python-six Conflicts: python-lldb-3.4, python-lldb-3.5, python-lldb-3.6, python-lldb-3.7 Pre-Depends: ${misc:Pre-Depends} @@ -450,7 +450,7 @@ Description: Next generation, high-performance debugger, python lib Package: liblldb-3.8-dev Section: libdevel -Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe sh4 x32 mips mipsel +Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe sh4 x32 mips mipsel arm64 # ia64 hurd powerpc ppc64el sparc64 ppc64 mips64el have been removed Depends: ${shlibs:Depends}, ${misc:Depends}, lldb-3.8 (= ${binary:Version}) Replaces: lldb-3.8-dev (<= 1:3.8~svn215195-2) diff --git a/debian/rules b/debian/rules index 2776af52..341fd346 100755 --- a/debian/rules +++ b/debian/rules @@ -124,7 +124,7 @@ endif LLDB_ENABLE=yes -LLDB_DISABLE_ARCHS := arm64 hurd-i386 ia64 ppc64el powerpc s390x sparc64 ppc64 mips64el +LLDB_DISABLE_ARCHS := hurd-i386 ia64 ppc64el powerpc s390x sparc64 ppc64 mips64el # hurd has threading issues ifeq (,$(filter-out $(LLDB_DISABLE_ARCHS), $(DEB_HOST_ARCH))) # Disable LLDB for this arch. From 62e62286240e993fce8db2c058cefa9226e5239b Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 4 Sep 2016 12:31:19 +0000 Subject: [PATCH 3/8] Should fix the rust migration --- debian/changelog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 19ea3966..887d525e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,11 @@ -llvm-toolchain-3.8 (1:3.8.1-10) UNRELEASED; urgency=medium +llvm-toolchain-3.8 (1:3.8.1-10) unstable; urgency=medium * Fix the usage of jsoncpp in polly. Thanks to James Clarke for the patch (Closes: #835606) * Port to kfreebsd. Many thanks to Pino Toscano (Closes: #835665) * Build lldb on arm64. Hopefully, works. + Should fix the rust migration -- Sylvestre Ledru Sat, 27 Aug 2016 17:36:06 +0200 From 049d79eff7782e8dc678bc8def4427fe5ab343eb Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 5 Sep 2016 06:59:12 +0000 Subject: [PATCH 4/8] Fix asan with libc6 >= 2.24 (asan-glibc-2.24.diff, backport of 269633) Many thanks to Michael Stapelberg for the great bug report. (Closes: 836723) --- debian/changelog | 8 +++ debian/patches/asan-glibc-2.24.diff | 81 +++++++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 90 insertions(+) create mode 100644 debian/patches/asan-glibc-2.24.diff diff --git a/debian/changelog b/debian/changelog index 887d525e..11797cd4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +llvm-toolchain-3.8 (1:3.8.1-11) UNRELEASED; urgency=medium + + * Fix asan with libc6 >= 2.24 (asan-glibc-2.24.diff, backport of 269633) + Many thanks to Michael Stapelberg for the great bug report. + (Closes: 836723) + + -- Sylvestre Ledru Mon, 05 Sep 2016 08:57:48 +0200 + llvm-toolchain-3.8 (1:3.8.1-10) unstable; urgency=medium * Fix the usage of jsoncpp in polly. Thanks to James Clarke for the patch diff --git a/debian/patches/asan-glibc-2.24.diff b/debian/patches/asan-glibc-2.24.diff new file mode 100644 index 00000000..133406d7 --- /dev/null +++ b/debian/patches/asan-glibc-2.24.diff @@ -0,0 +1,81 @@ +Index: llvm-toolchain-3.8-3.8.1/compiler-rt/lib/asan/asan_malloc_linux.cc +=================================================================== +--- llvm-toolchain-3.8-3.8.1.orig/compiler-rt/lib/asan/asan_malloc_linux.cc ++++ llvm-toolchain-3.8-3.8.1/compiler-rt/lib/asan/asan_malloc_linux.cc +@@ -26,52 +26,58 @@ + // ---------------------- Replacement functions ---------------- {{{1 + using namespace __asan; // NOLINT + +-static const uptr kCallocPoolSize = 1024; +-static uptr calloc_memory_for_dlsym[kCallocPoolSize]; ++static uptr allocated_for_dlsym; ++static const uptr kDlsymAllocPoolSize = 1024; ++static uptr alloc_memory_for_dlsym[kDlsymAllocPoolSize]; ++ ++static bool IsInDlsymAllocPool(const void *ptr) { ++ uptr off = (uptr)ptr - (uptr)alloc_memory_for_dlsym; ++ return off < sizeof(alloc_memory_for_dlsym); ++} + +-static bool IsInCallocPool(const void *ptr) { +- sptr off = (sptr)ptr - (sptr)calloc_memory_for_dlsym; +- return 0 <= off && off < (sptr)kCallocPoolSize; ++static void *AllocateFromLocalPool(uptr size_in_bytes) { ++ uptr size_in_words = RoundUpTo(size_in_bytes, kWordSize) / kWordSize; ++ void *mem = (void*)&alloc_memory_for_dlsym[allocated_for_dlsym]; ++ allocated_for_dlsym += size_in_words; ++ CHECK_LT(allocated_for_dlsym, kDlsymAllocPoolSize); ++ return mem; + } + + INTERCEPTOR(void, free, void *ptr) { + GET_STACK_TRACE_FREE; +- if (UNLIKELY(IsInCallocPool(ptr))) ++ if (UNLIKELY(IsInDlsymAllocPool(ptr))) + return; + asan_free(ptr, &stack, FROM_MALLOC); + } + + INTERCEPTOR(void, cfree, void *ptr) { + GET_STACK_TRACE_FREE; +- if (UNLIKELY(IsInCallocPool(ptr))) ++ if (UNLIKELY(IsInDlsymAllocPool(ptr))) + return; + asan_free(ptr, &stack, FROM_MALLOC); + } + + INTERCEPTOR(void*, malloc, uptr size) { ++ if (UNLIKELY(!asan_inited)) ++ // Hack: dlsym calls malloc before REAL(malloc) is retrieved from dlsym. ++ return AllocateFromLocalPool(size); + GET_STACK_TRACE_MALLOC; + return asan_malloc(size, &stack); + } + + INTERCEPTOR(void*, calloc, uptr nmemb, uptr size) { +- if (UNLIKELY(!asan_inited)) { ++ if (UNLIKELY(!asan_inited)) + // Hack: dlsym calls calloc before REAL(calloc) is retrieved from dlsym. +- static uptr allocated; +- uptr size_in_words = ((nmemb * size) + kWordSize - 1) / kWordSize; +- void *mem = (void*)&calloc_memory_for_dlsym[allocated]; +- allocated += size_in_words; +- CHECK(allocated < kCallocPoolSize); +- return mem; +- } ++ return AllocateFromLocalPool(nmemb * size); + GET_STACK_TRACE_MALLOC; + return asan_calloc(nmemb, size, &stack); + } + + INTERCEPTOR(void*, realloc, void *ptr, uptr size) { + GET_STACK_TRACE_MALLOC; +- if (UNLIKELY(IsInCallocPool(ptr))) { +- uptr offset = (uptr)ptr - (uptr)calloc_memory_for_dlsym; +- uptr copy_size = Min(size, kCallocPoolSize - offset); ++ if (UNLIKELY(IsInDlsymAllocPool(ptr))) { ++ uptr offset = (uptr)ptr - (uptr)alloc_memory_for_dlsym; ++ uptr copy_size = Min(size, kDlsymAllocPoolSize - offset); + void *new_ptr = asan_malloc(size, &stack); + internal_memcpy(new_ptr, ptr, copy_size); + return new_ptr; diff --git a/debian/patches/series b/debian/patches/series index c80f4ef6..763936d6 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -45,3 +45,4 @@ lldb-link-atomic-cmake.patch D17567-PR23529-Sema-part-of-attrbute-abi_tag-support.diff D18035-PR23529-Mangler-part-of-attrbute-abi_tag-support.diff kfreebsd-support.diff +asan-glibc-2.24.diff From d83a531f8c14a3bd34419f6a4cd57d47b602e022 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Wed, 7 Sep 2016 16:25:30 +0000 Subject: [PATCH 5/8] Fix the arm64 lldb build issue. Thanks to Ximin Luo (Closes: #836591) --- debian/changelog | 3 ++- ...t-assume-64bit-systems-are-all-x86-64.patch | 18 ++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 debian/patches/lldb-dont-assume-64bit-systems-are-all-x86-64.patch diff --git a/debian/changelog b/debian/changelog index 11797cd4..9001e46a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ -llvm-toolchain-3.8 (1:3.8.1-11) UNRELEASED; urgency=medium +llvm-toolchain-3.8 (1:3.8.1-11) unstable; urgency=medium + * Fix the arm64 lldb build issue. Thanks to Ximin Luo (Closes: #836591) * Fix asan with libc6 >= 2.24 (asan-glibc-2.24.diff, backport of 269633) Many thanks to Michael Stapelberg for the great bug report. (Closes: 836723) diff --git a/debian/patches/lldb-dont-assume-64bit-systems-are-all-x86-64.patch b/debian/patches/lldb-dont-assume-64bit-systems-are-all-x86-64.patch new file mode 100644 index 00000000..366f5331 --- /dev/null +++ b/debian/patches/lldb-dont-assume-64bit-systems-are-all-x86-64.patch @@ -0,0 +1,18 @@ +Index: llvm-toolchain-3.8-3.8.1/lldb/cmake/modules/LLDBConfig.cmake +=================================================================== +--- llvm-toolchain-3.8-3.8.1.orig/lldb/cmake/modules/LLDBConfig.cmake ++++ llvm-toolchain-3.8-3.8.1/lldb/cmake/modules/LLDBConfig.cmake +@@ -165,13 +165,6 @@ function(find_python_libs_windows) + endfunction(find_python_libs_windows) + + if (NOT LLDB_DISABLE_PYTHON) +- if(UNIX) +- # This is necessary for crosscompile on Ubuntu 14.04 64bit. Need a proper fix. +- if(CMAKE_SIZEOF_VOID_P EQUAL 8) +- set(CMAKE_LIBRARY_ARCHITECTURE "x86_64-linux-gnu") +- endif() +- endif() +- + if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows") + find_python_libs_windows() + diff --git a/debian/patches/series b/debian/patches/series index 763936d6..1d90a2a3 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -46,3 +46,4 @@ D17567-PR23529-Sema-part-of-attrbute-abi_tag-support.diff D18035-PR23529-Mangler-part-of-attrbute-abi_tag-support.diff kfreebsd-support.diff asan-glibc-2.24.diff +lldb-dont-assume-64bit-systems-are-all-x86-64.patch From 37a4ac39bc15029bffefb3ad8554711b8cc27ada Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 8 Sep 2016 08:40:06 +0000 Subject: [PATCH 6/8] Fix a ftbfs on lldb on arm64 (Closes: #836591) Once more, thanks to Ximin Luo for investigating --- debian/changelog | 7 +++++++ debian/patches/lldb-arm64.diff | 12 ++++++++++++ debian/patches/series | 1 + 3 files changed, 20 insertions(+) create mode 100644 debian/patches/lldb-arm64.diff diff --git a/debian/changelog b/debian/changelog index 9001e46a..d4974c1b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +llvm-toolchain-3.8 (1:3.8.1-12) unstable; urgency=medium + + * Fix a ftbfs on lldb on arm64 (Closes: #836591) + Once more, thanks to Ximin Luo for investigating + + -- Sylvestre Ledru Thu, 08 Sep 2016 10:39:51 +0200 + llvm-toolchain-3.8 (1:3.8.1-11) unstable; urgency=medium * Fix the arm64 lldb build issue. Thanks to Ximin Luo (Closes: #836591) diff --git a/debian/patches/lldb-arm64.diff b/debian/patches/lldb-arm64.diff new file mode 100644 index 00000000..f0b75448 --- /dev/null +++ b/debian/patches/lldb-arm64.diff @@ -0,0 +1,12 @@ +Index: llvm-toolchain-3.8-3.8.1/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp +--- llvm-toolchain-3.8-3.8.1.orig/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp 2016/01/11 10:39:09 257322 ++++ llvm-toolchain-3.8-3.8.1/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp 2016/04/12 05:40:51 266042 +@@ -32,6 +32,8 @@ + #include + // NT_PRSTATUS and NT_FPREGSET definition + #include ++// user_hwdebug_state definition ++#include + + #define REG_CONTEXT_SIZE (GetGPRSize() + GetFPRSize()) + diff --git a/debian/patches/series b/debian/patches/series index 1d90a2a3..fe628b0a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -47,3 +47,4 @@ D18035-PR23529-Mangler-part-of-attrbute-abi_tag-support.diff kfreebsd-support.diff asan-glibc-2.24.diff lldb-dont-assume-64bit-systems-are-all-x86-64.patch +lldb-arm64.diff From 4447712dc233d8f55b723cdec0858c97fb4d75b8 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 8 Sep 2016 14:08:31 +0000 Subject: [PATCH 7/8] add another bug number --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d4974c1b..aa5f94c0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,6 @@ llvm-toolchain-3.8 (1:3.8.1-12) unstable; urgency=medium - * Fix a ftbfs on lldb on arm64 (Closes: #836591) + * Fix a ftbfs on lldb on arm64 (Closes: #836591) (Closes: #836335) Once more, thanks to Ximin Luo for investigating -- Sylvestre Ledru Thu, 08 Sep 2016 10:39:51 +0200 From 4f259424b7cfe6e3059f75a40a6a2dd897f892cb Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Mon, 12 Sep 2016 11:57:41 +0000 Subject: [PATCH 8/8] Fix a version issue with run-clang-tidy-4.0.py --- debian/changelog | 6 ++++++ debian/patches/clang-tidy-run-bin.diff | 13 +++++++++++++ debian/patches/series | 2 ++ 3 files changed, 21 insertions(+) create mode 100644 debian/patches/clang-tidy-run-bin.diff diff --git a/debian/changelog b/debian/changelog index aa5f94c0..6bf9c0d7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +llvm-toolchain-3.8 (1:3.8.1-13) UNRELEASED; urgency=medium + + * Fix a version issue with run-clang-tidy-4.0.py + + -- Sylvestre Ledru Mon, 12 Sep 2016 13:57:25 +0200 + llvm-toolchain-3.8 (1:3.8.1-12) unstable; urgency=medium * Fix a ftbfs on lldb on arm64 (Closes: #836591) (Closes: #836335) diff --git a/debian/patches/clang-tidy-run-bin.diff b/debian/patches/clang-tidy-run-bin.diff new file mode 100644 index 00000000..8d92ea6a --- /dev/null +++ b/debian/patches/clang-tidy-run-bin.diff @@ -0,0 +1,13 @@ +Index: llvm-toolchain-3.8-3.8.1/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py +=================================================================== +--- llvm-toolchain-3.8-3.8.1.orig/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py ++++ llvm-toolchain-3.8-3.8.1/clang-tools-extra/clang-tidy/tool/run-clang-tidy.py +@@ -108,7 +108,7 @@ def main(): + 'clang-tidy and clang-apply-replacements in ' + '$PATH.') + parser.add_argument('-clang-tidy-binary', metavar='PATH', +- default='clang-tidy', ++ default='clang-tidy-3.8', + help='path to clang-tidy binary') + parser.add_argument('-clang-apply-replacements-binary', metavar='PATH', + default='clang-apply-replacements', diff --git a/debian/patches/series b/debian/patches/series index fe628b0a..244cb16a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -48,3 +48,5 @@ kfreebsd-support.diff asan-glibc-2.24.diff lldb-dont-assume-64bit-systems-are-all-x86-64.patch lldb-arm64.diff +clang-tidy-run-bin.diff +