From 5c2afe5871a2e312aea926e22ab73877d4f5fcbe Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 6 Jan 2017 16:19:45 +0000 Subject: [PATCH] * Build lld - d/p/lld-arg-cmake-issue.diff fixes upstream bug #27685 --- debian/changelog | 7 ++ debian/control | 92 ++++++++-------- debian/patches/lld-arg-cmake-issue.diff | 141 ++++++++++++++++++++++++ debian/patches/series | 1 + debian/rules | 2 +- 5 files changed, 196 insertions(+), 47 deletions(-) create mode 100644 debian/patches/lld-arg-cmake-issue.diff diff --git a/debian/changelog b/debian/changelog index fc1dafbb..ba10ed5f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +llvm-toolchain-snapshot (1:4.0~svn291233-1~exp1) experimental; urgency=medium + + * Build lld + - d/p/lld-arg-cmake-issue.diff fixes upstream bug #27685 + + -- Sylvestre Ledru Fri, 06 Jan 2017 14:10:39 +0100 + llvm-toolchain-snapshot (1:4.0~svn290810-1) unstable; urgency=medium * New snapshot release diff --git a/debian/control b/debian/control index a920681b..d959f2b7 100644 --- a/debian/control +++ b/debian/control @@ -394,56 +394,56 @@ Description: Modular compiler and toolchain technologies, examples # ------------- lld ------------- -# Package: lld-4.0 -# Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32 mips mipsel -# # ia64 mips mipsel hurd powerpc ppc64el have been removed -# Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm4.0 (= ${binary:Version}), llvm-4.0-dev -# Pre-Depends: ${misc:Pre-Depends} -# Description: LLVM-based linker -# LLD is a new, high-performance linker. It is built as a set of reusable -# components which highly leverage existing libraries in the larger LLVM -# Project. +Package: lld-4.0 +Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32 mips mipsel +# ia64 mips mipsel hurd powerpc ppc64el have been removed +Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm4.0 (= ${binary:Version}), llvm-4.0-dev +Pre-Depends: ${misc:Pre-Depends} +Description: LLVM-based linker + LLD is a new, high-performance linker. It is built as a set of reusable + components which highly leverage existing libraries in the larger LLVM + Project. -# Package: liblld-4.0 -# Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32 mips mipsel -# # ia64 mips mipsel hurd powerpc ppc64el have been removed -# Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm4.0 (= ${binary:Version}) -# Pre-Depends: ${misc:Pre-Depends} -# Section: libs -# Description: LLVM-based linker, library -# LLD is a new, high-performance linker. It is built as a set of reusable -# components which highly leverage existing libraries in the larger LLVM -# Project. -# . -# This package contains the LLD runtime library. +Package: liblld-4.0 +Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32 mips mipsel +# ia64 mips mipsel hurd powerpc ppc64el have been removed +Depends: ${shlibs:Depends}, ${misc:Depends}, libllvm4.0 (= ${binary:Version}) +Pre-Depends: ${misc:Pre-Depends} +Section: libs +Description: LLVM-based linker, library + LLD is a new, high-performance linker. It is built as a set of reusable + components which highly leverage existing libraries in the larger LLVM + Project. + . + This package contains the LLD runtime library. -# Package: liblld-4.0-dbg -# Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390 sparc hppa m68k powerpcspe ppc64 sh4 sparc64 x32 mips mipsel -# # ia64 mips mipsel hurd ppc64el alpha s390x powerpc have been removed -# Depends: ${shlibs:Depends}, ${misc:Depends}, liblld-4.0 (= ${binary:Version}) -# Pre-Depends: ${misc:Pre-Depends} -# Section: debug -# Priority: extra -# Description: LLVM-based linker, debugging libraries -# LLD is a new, high-performance linker. It is built as a set of reusable -# components which highly leverage existing libraries in the larger LLVM -# Project. -# . -# This package contains the LLD runtime library debug symbols. +Package: liblld-4.0-dbg +Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390 sparc hppa m68k powerpcspe ppc64 sh4 sparc64 x32 mips mipsel +# ia64 mips mipsel hurd ppc64el alpha s390x powerpc have been removed +Depends: ${shlibs:Depends}, ${misc:Depends}, liblld-4.0 (= ${binary:Version}) +Pre-Depends: ${misc:Pre-Depends} +Section: debug +Priority: extra +Description: LLVM-based linker, debugging libraries + LLD is a new, high-performance linker. It is built as a set of reusable + components which highly leverage existing libraries in the larger LLVM + Project. + . + This package contains the LLD runtime library debug symbols. -# Package: liblld-4.0-dev -# Section: libdevel -# Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32 mips mipsel -# # ia64 mips mipsel hurd powerpc ppc64el have been removed -# Depends: ${shlibs:Depends}, ${misc:Depends}, lld-4.0 (= ${binary:Version}) -# Pre-Depends: ${misc:Pre-Depends} -# Description: LLVM-based linker, header files -# LLD is a new, high-performance linker. It is built as a set of reusable -# components which highly leverage existing libraries in the larger LLVM -# Project. -# . -# This package provides the header files to build extension over lld. +Package: liblld-4.0-dev +Section: libdevel +Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 s390 sparc alpha hppa m68k powerpcspe ppc64 sh4 sparc64 x32 mips mipsel +# ia64 mips mipsel hurd powerpc ppc64el have been removed +Depends: ${shlibs:Depends}, ${misc:Depends}, lld-4.0 (= ${binary:Version}) +Pre-Depends: ${misc:Pre-Depends} +Description: LLVM-based linker, header files + LLD is a new, high-performance linker. It is built as a set of reusable + components which highly leverage existing libraries in the larger LLVM + Project. + . + This package provides the header files to build extension over lld. # ------------- lldb ------------- diff --git a/debian/patches/lld-arg-cmake-issue.diff b/debian/patches/lld-arg-cmake-issue.diff new file mode 100644 index 00000000..40ff8ab1 --- /dev/null +++ b/debian/patches/lld-arg-cmake-issue.diff @@ -0,0 +1,141 @@ +Index: llvm-toolchain-snapshot_4.0~svn290969/lld/cmake/modules/AddLLD.cmake +=================================================================== +--- llvm-toolchain-snapshot_4.0~svn290969.orig/lld/cmake/modules/AddLLD.cmake ++++ llvm-toolchain-snapshot_4.0~svn290969/lld/cmake/modules/AddLLD.cmake +@@ -1,5 +1,5 @@ + macro(add_lld_library name) +- add_llvm_library(${name} ${ARGN}) ++ llvm_add_library(${name} ${ARGN}) + set_target_properties(${name} PROPERTIES FOLDER "lld libraries") + endmacro(add_lld_library) + +Index: llvm-toolchain-snapshot_4.0~svn290969/lld/lib/Config/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_4.0~svn290969.orig/lld/lib/Config/CMakeLists.txt ++++ llvm-toolchain-snapshot_4.0~svn290969/lld/lib/Config/CMakeLists.txt +@@ -4,6 +4,6 @@ + ADDITIONAL_HEADER_DIRS + ${LLD_INCLUDE_DIR}/lld/Config + +- LINK_LIBS +- LLVMSupport ++ LINK_COMPONENTS ++ Support + ) +Index: llvm-toolchain-snapshot_4.0~svn290969/lld/lib/Core/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_4.0~svn290969.orig/lld/lib/Core/CMakeLists.txt ++++ llvm-toolchain-snapshot_4.0~svn290969/lld/lib/Core/CMakeLists.txt +@@ -12,6 +12,6 @@ + ADDITIONAL_HEADER_DIRS + ${LLD_INCLUDE_DIR}/lld/Core + +- LINK_LIBS +- LLVMSupport ++ LINK_COMPONENTS ++ Support + ) +Index: llvm-toolchain-snapshot_4.0~svn290969/lld/lib/Driver/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_4.0~svn290969.orig/lld/lib/Driver/CMakeLists.txt ++++ llvm-toolchain-snapshot_4.0~svn290969/lld/lib/Driver/CMakeLists.txt +@@ -8,15 +8,17 @@ + ADDITIONAL_HEADER_DIRS + ${LLD_INCLUDE_DIR}/lld/Driver + ++ LINK_COMPONENTS ++ Object ++ Option ++ Support ++ + LINK_LIBS + lldConfig + lldMachO + lldCore + lldReaderWriter + lldYAML +- LLVMObject +- LLVMOption +- LLVMSupport + ) + + add_dependencies(lldDriver DriverOptionsTableGen) +Index: llvm-toolchain-snapshot_4.0~svn290969/lld/lib/ReaderWriter/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_4.0~svn290969.orig/lld/lib/ReaderWriter/CMakeLists.txt ++++ llvm-toolchain-snapshot_4.0~svn290969/lld/lib/ReaderWriter/CMakeLists.txt +@@ -11,9 +11,11 @@ + ADDITIONAL_HEADER_DIRS + ${LLD_INCLUDE_DIR}/lld/ReaderWriter + ++ LINK_COMPONENTS ++ Object ++ Support ++ + LINK_LIBS + lldCore + lldYAML +- LLVMObject +- LLVMSupport + ) +Index: llvm-toolchain-snapshot_4.0~svn290969/lld/lib/ReaderWriter/MachO/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_4.0~svn290969.orig/lld/lib/ReaderWriter/MachO/CMakeLists.txt ++++ llvm-toolchain-snapshot_4.0~svn290969/lld/lib/ReaderWriter/MachO/CMakeLists.txt +@@ -18,13 +18,16 @@ + StubsPass.cpp + TLVPass.cpp + WriterMachO.cpp ++ ++ LINK_COMPONENTS ++ DebugInfoDWARF ++ Object ++ Support ++ Demangle ++ + LINK_LIBS + lldCore + lldYAML +- LLVMDebugInfoDWARF +- LLVMObject +- LLVMSupport +- LLVMDemangle + ${PTHREAD_LIB} + ) + +Index: llvm-toolchain-snapshot_4.0~svn290969/lld/lib/ReaderWriter/YAML/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_4.0~svn290969.orig/lld/lib/ReaderWriter/YAML/CMakeLists.txt ++++ llvm-toolchain-snapshot_4.0~svn290969/lld/lib/ReaderWriter/YAML/CMakeLists.txt +@@ -1,6 +1,9 @@ + add_lld_library(lldYAML + ReaderWriterYAML.cpp ++ ++ LINK_COMPONENTS ++ Support ++ + LINK_LIBS + lldCore +- LLVMSupport + ) +Index: llvm-toolchain-snapshot_4.0~svn290969/lld/tools/lld/CMakeLists.txt +=================================================================== +--- llvm-toolchain-snapshot_4.0~svn290969.orig/lld/tools/lld/CMakeLists.txt ++++ llvm-toolchain-snapshot_4.0~svn290969/lld/tools/lld/CMakeLists.txt +@@ -1,12 +1,15 @@ ++set(LLVM_LINK_COMPONENTS ++ Support ++ ) ++ + add_lld_tool(lld + lld.cpp + ) + + target_link_libraries(lld + lldDriver + lldCOFF + lldELF +- LLVMSupport + ) + + install(TARGETS lld diff --git a/debian/patches/series b/debian/patches/series index a2a5d940..9cc7291d 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -43,3 +43,4 @@ clang-fix-cmpxchg8-detection-on-i386.patch lldb-addversion-suffix-to-llvm-server-exec.patch lldb-missing-install.diff silent-test-failing-codeverage.diff +lld-arg-cmake-issue.diff diff --git a/debian/rules b/debian/rules index 77be7708..8df36497 100755 --- a/debian/rules +++ b/debian/rules @@ -136,7 +136,7 @@ ifeq (,$(filter-out $(LLDB_DISABLE_ARCHS), $(DEB_HOST_ARCH))) LLDB_ENABLE=no endif -LLD_ENABLE=no +LLD_ENABLE=yes %: dh $@ --with ocaml