From 76285610895dd705c4b1f9bfb6915f5984d13319 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 23 Dec 2016 16:45:47 +0100 Subject: [PATCH] rebase of the patches --- debian/patches/dynamic-link-llvm.patch | 35 ++++++++++++------- .../fix-configure-for-deb-arches.patch | 10 +++--- .../ignore-stdcall-test-on-arm64.patch | 21 +---------- debian/patches/use-system-jquery.patch | 10 +++--- 4 files changed, 34 insertions(+), 42 deletions(-) diff --git a/debian/patches/dynamic-link-llvm.patch b/debian/patches/dynamic-link-llvm.patch index 0b1018351c..7f25da799a 100644 --- a/debian/patches/dynamic-link-llvm.patch +++ b/debian/patches/dynamic-link-llvm.patch @@ -13,23 +13,31 @@ Index: rust/src/librustc_llvm/build.rs =================================================================== --- rust.orig/src/librustc_llvm/build.rs +++ rust/src/librustc_llvm/build.rs -@@ -122,52 +122,11 @@ fn main() { - .cpp(true) +@@ -123,63 +123,10 @@ fn main() { .cpp_link_stdlib(None) // we handle this below .compile("librustllvm.a"); -- + - // 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"); -+ // Link in all LLVM libraries -+ // Link in Debian full LLVM shared library. -+ // TODO: not sure what to do in the cross-compiling case. -+ println!("cargo:rustc-link-lib={}={}", "dylib", "LLVM-3.9"); - } +- } - cmd.args(&components[..]); - - for lib in output(&mut cmd).split_whitespace() { @@ -47,7 +55,7 @@ Index: rust/src/librustc_llvm/build.rs - // that off - lib.trim_right_matches(".lib") - } else { -- continue +- continue; - }; - - // Don't need or want this library, but LLVM's CMake build system @@ -56,7 +64,7 @@ Index: rust/src/librustc_llvm/build.rs - // 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") { @@ -66,10 +74,13 @@ Index: rust/src/librustc_llvm/build.rs - }; - println!("cargo:rustc-link-lib={}={}", kind, name); - } -- ++ // Link in all LLVM libraries ++ // Link in Debian full LLVM shared library. ++ // TODO: not sure what to do in the cross-compiling case. ++ println!("cargo:rustc-link-lib={}={}", "dylib", "LLVM-3.9"); + // LLVM ldflags // - // If we're a cross-compile of LLVM then unfortunately we can't trust these Index: rust/src/etc/mklldeps.py =================================================================== --- rust.orig/src/etc/mklldeps.py diff --git a/debian/patches/fix-configure-for-deb-arches.patch b/debian/patches/fix-configure-for-deb-arches.patch index de1072c07a..b2be610946 100644 --- a/debian/patches/fix-configure-for-deb-arches.patch +++ b/debian/patches/fix-configure-for-deb-arches.patch @@ -10,15 +10,15 @@ Author: Ximin Luo Forwarded: not-needed --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ -Index: rustc.git/configure +Index: rust/configure =================================================================== ---- rustc.git.orig/configure -+++ rustc.git/configure -@@ -508,8 +508,19 @@ case $CFG_CPUTYPE in +--- rust.orig/configure ++++ rust/configure +@@ -513,8 +513,19 @@ case $CFG_CPUTYPE in ;; armv7l) -- CFG_CPUTYPE=arm +- CFG_CPUTYPE=armv7 - CFG_OSTYPE="${CFG_OSTYPE}eabihf" + case $DEB_HOST_ARCH in + armhf) diff --git a/debian/patches/ignore-stdcall-test-on-arm64.patch b/debian/patches/ignore-stdcall-test-on-arm64.patch index e1aa17b3d0..6232b22f10 100644 --- a/debian/patches/ignore-stdcall-test-on-arm64.patch +++ b/debian/patches/ignore-stdcall-test-on-arm64.patch @@ -10,26 +10,7 @@ Index: rust/src/test/debuginfo/type-names.rs =================================================================== --- rust.orig/src/test/debuginfo/type-names.rs +++ rust/src/test/debuginfo/type-names.rs -@@ -155,9 +155,6 @@ - // gdb-command:whatis unsafe_fn_with_return_value - // gdb-check:type = struct (unsafe fn(type_names::GenericStruct) -> type_names::mod1::Struct2, usize) - --// gdb-command:whatis extern_stdcall_fn_with_return_value --// gdb-check:type = struct (extern "stdcall" fn(Box) -> usize, usize) -- - // gdb-command:whatis generic_function_int - // gdb-check:type = struct (fn(isize) -> isize, usize) - -@@ -226,7 +223,7 @@ extern "stdcall" fn extern_stdcall_fn() - fn rust_fn_with_return_value(_: f64) -> usize { 4 } - extern "C" fn extern_c_fn_with_return_value() -> Struct1 { Struct1 } - unsafe fn unsafe_fn_with_return_value(_: GenericStruct) -> mod1::Struct2 { mod1::Struct2 } --extern "stdcall" fn extern_stdcall_fn_with_return_value(_: Box) -> usize { 0 } -+//extern "stdcall" fn extern_stdcall_fn_with_return_value(_: Box) -> usize { 0 } - - fn generic_function(x: T) -> T { x } - -@@ -317,7 +314,7 @@ fn main() { +@@ -363,7 +363,7 @@ fn main() { let rust_fn_with_return_value = (rust_fn_with_return_value, 0_usize); let extern_c_fn_with_return_value = (extern_c_fn_with_return_value, 0_usize); let unsafe_fn_with_return_value = (unsafe_fn_with_return_value, 0_usize); diff --git a/debian/patches/use-system-jquery.patch b/debian/patches/use-system-jquery.patch index 148d48e4d6..e470cff570 100644 --- a/debian/patches/use-system-jquery.patch +++ b/debian/patches/use-system-jquery.patch @@ -1,8 +1,8 @@ -Index: rustc.git/src/librustdoc/html/render.rs +Index: rust/src/librustdoc/html/render.rs =================================================================== ---- rustc.git.orig/src/librustdoc/html/render.rs -+++ rustc.git/src/librustdoc/html/render.rs -@@ -659,8 +659,16 @@ fn write_shared(cx: &Context, +--- rust.orig/src/librustdoc/html/render.rs ++++ rust/src/librustdoc/html/render.rs +@@ -653,8 +653,16 @@ fn write_shared(cx: &Context, // Add all the static files. These may already exist, but we just // overwrite them anyway to make sure that they're fresh and up-to-date. @@ -20,4 +20,4 @@ Index: rustc.git/src/librustdoc/html/render.rs + } write(cx.dst.join("main.js"), include_bytes!("static/main.js"))?; - write(cx.dst.join("playpen.js"), + write(cx.dst.join("rustdoc.css"), -- 2.39.5