diff options
author | A. Wilcox <awilcox@wilcox-tech.com> | 2019-06-01 23:06:05 +0000 |
---|---|---|
committer | A. Wilcox <awilcox@wilcox-tech.com> | 2019-06-01 23:06:05 +0000 |
commit | fc8a8c07a6a2d4497783d92264a2cf2036161867 (patch) | |
tree | 9c51aee789895949855774f104f0bd202a18148d /user/rust/0004-Require-static-native-libraries-when-linking-static-.patch | |
parent | 413cf17ca5808b6f2c897486ac2787580d64dd8e (diff) | |
parent | 7e1cca3044a2ec11b12b1e0004eb59be38950bed (diff) | |
download | packages-fc8a8c07a6a2d4497783d92264a2cf2036161867.tar.gz packages-fc8a8c07a6a2d4497783d92264a2cf2036161867.tar.bz2 packages-fc8a8c07a6a2d4497783d92264a2cf2036161867.tar.xz packages-fc8a8c07a6a2d4497783d92264a2cf2036161867.zip |
Merge branch 'rust' into 'master'
Rust bump
Builds on pmmx/x86_64/ppc64/aarch64. Successfully builds Firefox.
Still fails 17 tests on ppc32, but the ICE has been fixed:
```
[run-make] run-make-fulldeps/exit-code
[run-make] run-make-fulldeps/extern-fn-generic
[run-make] run-make-fulldeps/extern-fn-struct-passing-abi
[run-make] run-make-fulldeps/extern-fn-with-packed-struct
[run-make] run-make-fulldeps/extern-fn-with-union
[run-make] run-make-fulldeps/issue-25581
[run-make] run-make-fulldeps/relocation-model
[run-pass] run-pass/extern/extern-pass-TwoU16s.rs
[run-pass] run-pass/extern/extern-pass-TwoU32s.rs
[run-pass] run-pass/extern/extern-pass-TwoU64s.rs
[run-pass] run-pass/extern/extern-pass-TwoU8s.rs
[run-pass] run-pass/extern/extern-pass-empty.rs
[run-pass] run-pass/foreign/foreign-fn-with-byval.rs
[run-pass] run-pass/issues/issue-28676.rs
[run-pass] run-pass/structs-enums/struct-return.rs
[run-pass] run-pass/threads-sendsync/thread-local-extern-static.rs
[run-pass] run-pass/union/union-c-interop.rs
```
See merge request !232
Diffstat (limited to 'user/rust/0004-Require-static-native-libraries-when-linking-static-.patch')
-rw-r--r-- | user/rust/0004-Require-static-native-libraries-when-linking-static-.patch | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/user/rust/0004-Require-static-native-libraries-when-linking-static-.patch b/user/rust/0004-Require-static-native-libraries-when-linking-static-.patch index 6ec5eb76f..a1ee6c661 100644 --- a/user/rust/0004-Require-static-native-libraries-when-linking-static-.patch +++ b/user/rust/0004-Require-static-native-libraries-when-linking-static-.patch @@ -1,42 +1,48 @@ -From 46e6ead56b2899d9041fe73c1530b7f02df2ca40 Mon Sep 17 00:00:00 2001 +From 7f7ea1cba86a15510de2410529c8460fc5b7018b Mon Sep 17 00:00:00 2001 From: Samuel Holland <samuel@sholland.org> Date: Fri, 8 Sep 2017 00:05:18 -0500 -Subject: [PATCH 04/14] Require static native libraries when linking static +Subject: [PATCH 04/13] Require static native libraries when linking static executables -gcc/ld will create a dynamically-linked executable without warning, even -when passed `-static`, when asked to link to a `.so`. Avoid this -confusing and unintended behavior by always using the static version of -libraries when trying to link static executables. +On ELF targets like Linux, gcc/ld will create a dynamically-linked +executable without warning, even when passed `-static`, when asked to +link to a `.so`. Avoid this confusing and unintended behavior by always +using the static version of libraries when trying to link static +executables. Fixes #54243 --- - src/librustc_codegen_llvm/back/link.rs | 13 ++++++++++--- - 1 file changed, 10 insertions(+), 3 deletions(-) + src/librustc_codegen_llvm/back/link.rs | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/librustc_codegen_llvm/back/link.rs b/src/librustc_codegen_llvm/back/link.rs -index fc744201a3..bae8b6ed75 100644 +index 19419a72b9..9d26dd0b35 100644 --- a/src/librustc_codegen_llvm/back/link.rs +++ b/src/librustc_codegen_llvm/back/link.rs -@@ -1413,8 +1413,8 @@ fn add_upstream_rust_crates(cmd: &mut dyn Linker, +@@ -1408,9 +1408,7 @@ fn add_upstream_rust_crates(cmd: &mut dyn Linker, } } -// Link in all of our upstream crates' native dependencies. Remember that -// all of these upstream native dependencies are all non-static -+// Link in all of our upstream crates' native dependencies. Remember that when -+// linking libraries, these upstream native dependencies are all non-static - // dependencies. We've got two cases then: +-// dependencies. We've got two cases then: ++// Link in all of our upstream crates' native dependencies. We have two cases: // // 1. The upstream crate is an rlib. In this case we *must* link in the -@@ -1458,7 +1458,14 @@ fn add_upstream_native_libraries(cmd: &mut dyn Linker, + // native dependency because the rlib is just an archive. +@@ -1453,7 +1451,19 @@ fn add_upstream_native_libraries(cmd: &mut dyn Linker, continue } match lib.kind { - NativeLibraryKind::NativeUnknown => cmd.link_dylib(&name.as_str()), + NativeLibraryKind::NativeUnknown => { -+ // When creating executables, match library linkage to that of the executable. -+ if crate_type == config::CrateType::Executable && sess.crt_static() { ++ // On some targets, like Linux, linking a static executable inhibits using ++ // dylibs at all. Force native libraries to be static, even if for example ++ // an upstream rlib was originally linked against a native shared library. ++ if crate_type == config::CrateType::Executable ++ && sess.crt_static() ++ && !sess.target.target.options.crt_static_allows_dylibs ++ { + cmd.link_staticlib(&name.as_str()) + } else { + cmd.link_dylib(&name.as_str()) |