From d31f21bfd507a6186895db4e15acbb5fca765688 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 16 Mar 2013 11:09:03 +0000 Subject: [PATCH] * Build using binutls-gold to improve the quality of the binaries. See: http://allievi.sssup.it/techblog/?p=791 * Detect the vendor (Debian or Ubuntu) and update the configuration * Port to powerpcspe. Thanks to Roland Stigge (Closes: #701587) See: 31-powerpcspe.diff * Fix the path detection of scan-build (Closes: #698352) See: 32-scan-build-path.diff --- debian/changelog | 12 +++++++++ debian/control | 2 +- debian/patches/31-powerpcspe.diff | 36 ++++++++++++++++++++++++++ debian/patches/32-scan-build-path.diff | 13 ++++++++++ debian/patches/series | 2 ++ debian/rules | 6 +++-- 6 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 debian/patches/31-powerpcspe.diff create mode 100644 debian/patches/32-scan-build-path.diff diff --git a/debian/changelog b/debian/changelog index 0d1c9ea8..a4101940 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +llvm-toolchain-3.2 (1:3.2repack-1~exp4) UNRELEASED; urgency=low + + * Build using binutls-gold to improve the quality of the binaries. + See: http://allievi.sssup.it/techblog/?p=791 + * Detect the vendor (Debian or Ubuntu) and update the configuration + * Port to powerpcspe. Thanks to Roland Stigge (Closes: #701587) + See: 31-powerpcspe.diff + * Fix the path detection of scan-build (Closes: #698352) + See: 32-scan-build-path.diff + + -- Sylvestre Ledru Thu, 14 Mar 2013 17:47:12 +0100 + llvm-toolchain-3.2 (1:3.2repack-1~exp3) experimental; urgency=low * Remove package "clang". It is now provided by llvm-defaults. diff --git a/debian/control b/debian/control index e8eea3c2..63ba740d 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Build-Depends: debhelper (>= 9.0), flex, bison, dejagnu, tcl8.5, expect, sharutils, autotools-dev (>= 20060702.1), libffi-dev (>= 3.0.9), lsb-release, patchutils, diffstat, xz-utils, chrpath, python-dev, libedit-dev, swig, python-sphinx, ocaml-nox, binutils-dev, libcloog-isl-dev, - libisl-dev (>= 0.11.1) + libisl-dev (>= 0.11.1), binutils-gold Build-Conflicts: oprofile, ocaml Standards-Version: 3.9.3 Homepage: http://www.llvm.org/ diff --git a/debian/patches/31-powerpcspe.diff b/debian/patches/31-powerpcspe.diff new file mode 100644 index 00000000..2b1da544 --- /dev/null +++ b/debian/patches/31-powerpcspe.diff @@ -0,0 +1,36 @@ +Index: clang-3.2/tools/clang/lib/Driver/ToolChains.cpp +=================================================================== +--- clang-3.2.orig/tools/clang/lib/Driver/ToolChains.cpp 2013-03-15 14:54:26.000000000 +0100 ++++ clang-3.2/tools/clang/lib/Driver/ToolChains.cpp 2013-03-15 14:55:53.000000000 +0100 +@@ -1103,6 +1103,7 @@ + static const char *const PPCTriples[] = { + "powerpc-linux-gnu", + "powerpc-unknown-linux-gnu", ++ "powerpc-linux-gnuspe", + "powerpc-suse-linux", + "powerpc-montavista-linuxspe" + }; +@@ -2003,6 +2004,8 @@ + return "mipsel-linux-gnu"; + return TargetTriple.str(); + case llvm::Triple::ppc: ++ if (llvm::sys::fs::exists(SysRoot + "/lib/powerpc-linux-gnuspe")) ++ return "powerpc-linux-gnuspe"; + if (llvm::sys::fs::exists(SysRoot + "/lib/powerpc-linux-gnu")) + return "powerpc-linux-gnu"; + return TargetTriple.str(); +Index: clang-3.2/tools/clang/lib/Lex/Makefile +=================================================================== +--- clang-3.2.orig/tools/clang/lib/Lex/Makefile 2013-03-15 14:54:26.000000000 +0100 ++++ clang-3.2/tools/clang/lib/Lex/Makefile 2013-03-15 14:54:55.000000000 +0100 +@@ -17,8 +17,10 @@ + LIBRARYNAME := clangLex + + ifeq ($(ARCH),PowerPC) ++ifneq ($(shell dpkg-architecture -qDEB_HOST_ARCH),powerpcspe) + CXX.Flags += -maltivec + endif ++endif + + include $(CLANG_LEVEL)/Makefile + diff --git a/debian/patches/32-scan-build-path.diff b/debian/patches/32-scan-build-path.diff new file mode 100644 index 00000000..7bc565c9 --- /dev/null +++ b/debian/patches/32-scan-build-path.diff @@ -0,0 +1,13 @@ +Index: clang-3.2/tools/clang/tools/scan-build/scan-build +=================================================================== +--- clang-3.2.orig/tools/clang/tools/scan-build/scan-build 2012-09-15 07:51:10.000000000 +0200 ++++ clang-3.2/tools/clang/tools/scan-build/scan-build 2013-03-15 15:00:05.000000000 +0100 +@@ -1459,7 +1459,7 @@ + + # Find 'clang' + if (!defined $AnalyzerDiscoveryMethod) { +- $Clang = Cwd::realpath("$RealBin/bin/clang"); ++ $Clang = Cwd::realpath("/usr/bin/clang"); + if (!defined $Clang || ! -x $Clang) { + $Clang = Cwd::realpath("$RealBin/clang"); + } diff --git a/debian/patches/series b/debian/patches/series index 73b9853d..86a831b2 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -29,3 +29,5 @@ scan-build-clang-path.diff polly-c++0x.diff declare_clear_cache.diff #r600-snapshot.diff +31-powerpcspe.diff +32-scan-build-path.diff diff --git a/debian/rules b/debian/rules index 3de3f04a..a083b871 100755 --- a/debian/rules +++ b/debian/rules @@ -9,6 +9,8 @@ ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) endif +VENDOR=$(lsb_release -is) + DEB_HOST_MULTIARCH = $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_HOST_ARCH_BITS = $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS) @@ -89,13 +91,13 @@ override_dh_auto_configure: debian/lldb-$(LLVM_VERSION).install debian/lldb-$(LL --with-cloog --with-isl \ --with-bug-report-url=http://bugs.debian.org/ \ --enable-shared \ - CLANG_VENDOR=Debian || { cat config.log tools/polly/config.log; exit 1; } + CLANG_VENDOR=$(VENDOR) || { cat config.log tools/polly/config.log; exit 1; } # cd $(TARGET_BUILD) && cmake ../ -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON # mkdir build-compiler-rt && cd build-compiler-rt && cmake ../compiler-rt # --enable-experimental-targets=R600 override_dh_auto_build: - $(MAKE) $(NJOBS) -C $(TARGET_BUILD) VERBOSE=1 CLANG_VENDOR=Debian CXXFLAGS=-std=c++0x REQUIRES_RTTI=1 + $(MAKE) $(NJOBS) -C $(TARGET_BUILD) VERBOSE=1 CLANG_VENDOR=$(VENDOR) CXXFLAGS=-std=c++0x REQUIRES_RTTI=1 cd $(CURDIR)/docs && make -f Makefile.sphinx && make -f Makefile.sphinx man # $(MAKE) $(NJOBS) -C build-compiler-rt VERBOSE=1 # Only available in clang 3.3