From 89fb5abfa4f145fc7252066ff9bd677a36ea65cc Mon Sep 17 00:00:00 2001 From: Ximin Luo Date: Thu, 8 Dec 2016 02:04:59 +0100 Subject: [PATCH] Update patches for 1.14 and 1.15 --- debian/build-preview-dsc.sh | 4 +- debian/patches/dynamic-link-llvm_1.14.patch | 19 ++++++++-- ....13.patch => dynamic-link-llvm_1.15.patch} | 20 ++++++---- .../fix-configure-for-deb-arches_1.14.patch | 38 +++++++++++++++++++ .../fix-configure-for-deb-arches_1.15.patch | 38 +++++++++++++++++++ 5 files changed, 107 insertions(+), 12 deletions(-) rename debian/patches/{dynamic-link-llvm_1.13.patch => dynamic-link-llvm_1.15.patch} (93%) create mode 100644 debian/patches/fix-configure-for-deb-arches_1.14.patch create mode 100644 debian/patches/fix-configure-for-deb-arches_1.15.patch diff --git a/debian/build-preview-dsc.sh b/debian/build-preview-dsc.sh index 541f69ff70..3d83702af2 100755 --- a/debian/build-preview-dsc.sh +++ b/debian/build-preview-dsc.sh @@ -29,8 +29,8 @@ for f in *; do if test -f "${fb}_${verprefix}"*; then mv "${fb}_${verprefix}"* "$f"; fi done ) case "$1" in -"1.13."*|"1.14."*) - dquilt delete nodoc-for-build-arch.patch +"1.14."*|"1.15."*) + dquilt delete ignore-stdcall-test-on-arm64.patch ;; esac } diff --git a/debian/patches/dynamic-link-llvm_1.14.patch b/debian/patches/dynamic-link-llvm_1.14.patch index 6a068ec4bc..4b5d48df04 100644 --- a/debian/patches/dynamic-link-llvm_1.14.patch +++ b/debian/patches/dynamic-link-llvm_1.14.patch @@ -11,15 +11,28 @@ Forwarded: not-needed This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/src/librustc_llvm/build.rs +++ b/src/librustc_llvm/build.rs -@@ -123,50 +123,10 @@ - .cpp_link_stdlib(None) // we handle this below - .compile("librustllvm.a"); +@@ -157,63 +157,10 @@ + + let (llvm_kind, llvm_link_arg) = detect_llvm_link(&llvm_config); - // Link in all LLVM libraries, if we're uwring the "wrong" llvm-config then - // we don't pick up system libs because unfortunately they're for the host - // of llvm-config, not the target that we're attempting to link. - let mut cmd = Command::new(&llvm_config); - cmd.arg("--libs"); +- +- // Force static linking with "--link-static" if available. +- let mut version_cmd = Command::new(&llvm_config); +- version_cmd.arg("--version"); +- let version_output = output(&mut version_cmd); +- let mut parts = version_output.split('.'); +- if let (Some(major), Some(minor)) = (parts.next().and_then(|s| s.parse::().ok()), +- parts.next().and_then(|s| s.parse::().ok())) { +- if major > 3 || (major == 3 && minor >= 8) { +- cmd.arg("--link-static"); +- } +- } +- - if !is_crossed { - cmd.arg("--system-libs"); - } diff --git a/debian/patches/dynamic-link-llvm_1.13.patch b/debian/patches/dynamic-link-llvm_1.15.patch similarity index 93% rename from debian/patches/dynamic-link-llvm_1.13.patch rename to debian/patches/dynamic-link-llvm_1.15.patch index 9ef5a430f6..d5696f750d 100644 --- a/debian/patches/dynamic-link-llvm_1.13.patch +++ b/debian/patches/dynamic-link-llvm_1.15.patch @@ -11,15 +11,20 @@ Forwarded: not-needed This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/src/librustc_llvm/build.rs +++ b/src/librustc_llvm/build.rs -@@ -123,50 +123,10 @@ - .cpp_link_stdlib(None) // we handle this below - .compile("librustllvm.a"); +@@ -157,55 +157,10 @@ + + let (llvm_kind, llvm_link_arg) = detect_llvm_link(&llvm_config); - // Link in all LLVM libraries, if we're uwring the "wrong" llvm-config then - // we don't pick up system libs because unfortunately they're for the host - // of llvm-config, not the target that we're attempting to link. - let mut cmd = Command::new(&llvm_config); - cmd.arg("--libs"); +- +- if let Some(link_arg) = llvm_link_arg { +- cmd.arg(link_arg); +- } +- - if !is_crossed { - cmd.arg("--system-libs"); - } @@ -40,7 +45,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ - // that off - lib.trim_right_matches(".lib") - } else { -- continue +- continue; - }; - - // Don't need or want this library, but LLVM's CMake build system @@ -49,11 +54,11 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ - // library and it otherwise may just pull in extra dependencies on - // libedit which we don't want - if name == "LLVMLineEditor" { -- continue +- continue; - } - - let kind = if name.starts_with("LLVM") { -- "static" +- llvm_kind - } else { - "dylib" - }; @@ -68,7 +73,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ // --- a/src/etc/mklldeps.py +++ b/src/etc/mklldeps.py -@@ -56,38 +56,12 @@ +@@ -56,38 +56,13 @@ f.write("\n") @@ -108,6 +113,7 @@ This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +# Link in Debian full LLVM shared library. +# TODO: not sure what to do in the cross-compiling case. +f.write("#[link(name = \"LLVM-3.9\")]\n") ++ # LLVM ldflags out = run([llvm_config, '--ldflags']) diff --git a/debian/patches/fix-configure-for-deb-arches_1.14.patch b/debian/patches/fix-configure-for-deb-arches_1.14.patch new file mode 100644 index 0000000000..5699a5efe9 --- /dev/null +++ b/debian/patches/fix-configure-for-deb-arches_1.14.patch @@ -0,0 +1,38 @@ +Description: Fix configure architecture targets for Debian + Rust upstream sometimes builds for multiple triplets depending on the CPU, + since it could be valid for multiple triplets. We don't need to do this for + Debian; each DEB_HOST_ARCH maps to a single triplet. This patch indirectly + achieves this by setting CFG_{OS,CPU}TYPE to more specific values depending + on what DEB_HOST_ARCH is, hopefully preventing a multiple build. + . + Tested on armhf, untested on armel due to missing build-deps. +Author: Ximin Luo +Forwarded: not-needed +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: rustc.git/configure +=================================================================== +--- rustc.git.orig/configure ++++ rustc.git/configure +@@ -508,8 +508,19 @@ case $CFG_CPUTYPE in + ;; + + armv7l) +- CFG_CPUTYPE=armv7 +- CFG_OSTYPE="${CFG_OSTYPE}eabihf" ++ case $DEB_HOST_ARCH in ++ armhf) ++ CFG_CPUTYPE=armv7 ++ CFG_OSTYPE="${CFG_OSTYPE}eabihf" ++ ;; ++ armel) ++ CFG_CPUTYPE=arm ++ CFG_OSTYPE="${CFG_OSTYPE}eabi" ++ ;; ++ *) ++ err "unknown DEB_HOST_ARCH $DEB_HOST_ARCH for armv7l cpu" ++ ;; ++ esac + ;; + + aarch64) diff --git a/debian/patches/fix-configure-for-deb-arches_1.15.patch b/debian/patches/fix-configure-for-deb-arches_1.15.patch new file mode 100644 index 0000000000..5699a5efe9 --- /dev/null +++ b/debian/patches/fix-configure-for-deb-arches_1.15.patch @@ -0,0 +1,38 @@ +Description: Fix configure architecture targets for Debian + Rust upstream sometimes builds for multiple triplets depending on the CPU, + since it could be valid for multiple triplets. We don't need to do this for + Debian; each DEB_HOST_ARCH maps to a single triplet. This patch indirectly + achieves this by setting CFG_{OS,CPU}TYPE to more specific values depending + on what DEB_HOST_ARCH is, hopefully preventing a multiple build. + . + Tested on armhf, untested on armel due to missing build-deps. +Author: Ximin Luo +Forwarded: not-needed +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: rustc.git/configure +=================================================================== +--- rustc.git.orig/configure ++++ rustc.git/configure +@@ -508,8 +508,19 @@ case $CFG_CPUTYPE in + ;; + + armv7l) +- CFG_CPUTYPE=armv7 +- CFG_OSTYPE="${CFG_OSTYPE}eabihf" ++ case $DEB_HOST_ARCH in ++ armhf) ++ CFG_CPUTYPE=armv7 ++ CFG_OSTYPE="${CFG_OSTYPE}eabihf" ++ ;; ++ armel) ++ CFG_CPUTYPE=arm ++ CFG_OSTYPE="${CFG_OSTYPE}eabi" ++ ;; ++ *) ++ err "unknown DEB_HOST_ARCH $DEB_HOST_ARCH for armv7l cpu" ++ ;; ++ esac + ;; + + aarch64)