summaryrefslogtreecommitdiff
path: root/lang/rust/files
diff options
context:
space:
mode:
Diffstat (limited to 'lang/rust/files')
-rw-r--r--lang/rust/files/armv6/patch-src_llvm-project_compiler-rt_lib_builtins_atomic.c (renamed from lang/rust/files/extra-patch-arm-compiler-rt)0
-rw-r--r--lang/rust/files/armv7/patch-src_llvm-project_compiler-rt_lib_builtins_atomic.c43
-rw-r--r--lang/rust/files/patch-src_bootstrap_native.rs48
-rw-r--r--lang/rust/files/patch-src_llvm-project_llvm_utils_llvm-build_llvmbuild_main.py4
-rw-r--r--lang/rust/files/patch-vendor_libgit2-sys_lib.rs4
-rw-r--r--lang/rust/files/patch-vendor_openssl-sys_build_main.rs56
-rw-r--r--lang/rust/files/patch-vendor_openssl-sys_src_ssl.rs4
-rw-r--r--lang/rust/files/powerpc64-elfv1/patch-src_bootstrap_native.rs13
-rw-r--r--lang/rust/files/powerpc64-elfv1/patch-src_librustc__llvm_build.rs (renamed from lang/rust/files/patch-src_librustc__llvm_build.rs)4
-rw-r--r--lang/rust/files/powerpc64-elfv2/patch-src_librustc__target_abi_call_powerpc64.rs11
-rw-r--r--lang/rust/files/powerpc64-elfv2/patch-src_llvm-project_clang_lib_Basic_Targets_PPC.h34
-rw-r--r--lang/rust/files/powerpc64-elfv2/patch-src_llvm-project_llvm_lib_Target_PowerPC_PPCTargetMachine.cpp23
12 files changed, 180 insertions, 64 deletions
diff --git a/lang/rust/files/extra-patch-arm-compiler-rt b/lang/rust/files/armv6/patch-src_llvm-project_compiler-rt_lib_builtins_atomic.c
index 48a112abcd57..48a112abcd57 100644
--- a/lang/rust/files/extra-patch-arm-compiler-rt
+++ b/lang/rust/files/armv6/patch-src_llvm-project_compiler-rt_lib_builtins_atomic.c
diff --git a/lang/rust/files/armv7/patch-src_llvm-project_compiler-rt_lib_builtins_atomic.c b/lang/rust/files/armv7/patch-src_llvm-project_compiler-rt_lib_builtins_atomic.c
new file mode 100644
index 000000000000..48a112abcd57
--- /dev/null
+++ b/lang/rust/files/armv7/patch-src_llvm-project_compiler-rt_lib_builtins_atomic.c
@@ -0,0 +1,43 @@
+https://reviews.llvm.org/D68045
+
+--- src/llvm-project/compiler-rt/lib/builtins/atomic.c.orig 2019-09-09 18:30:53 UTC
++++ src/llvm-project/compiler-rt/lib/builtins/atomic.c
+@@ -51,9 +51,11 @@ static const long SPINLOCK_MASK = SPINLOCK_COUNT - 1;
+ ////////////////////////////////////////////////////////////////////////////////
+ #ifdef __FreeBSD__
+ #include <errno.h>
+-#include <machine/atomic.h>
++// clang-format off
+ #include <sys/types.h>
++#include <machine/atomic.h>
+ #include <sys/umtx.h>
++// clang-format on
+ typedef struct _usem Lock;
+ __inline static void unlock(Lock *l) {
+ __c11_atomic_store((_Atomic(uint32_t) *)&l->_count, 1, __ATOMIC_RELEASE);
+--- src/llvm-project/compiler-rt/lib/builtins/clear_cache.c.orig 2019-09-09 18:30:53 UTC
++++ src/llvm-project/compiler-rt/lib/builtins/clear_cache.c
+@@ -23,8 +23,10 @@ uintptr_t GetCurrentProcess(void);
+ #endif
+
+ #if defined(__FreeBSD__) && defined(__arm__)
+-#include <machine/sysarch.h>
++// clang-format off
+ #include <sys/types.h>
++#include <machine/sysarch.h>
++// clang-format on
+ #endif
+
+ #if defined(__NetBSD__) && defined(__arm__)
+@@ -32,8 +34,10 @@ uintptr_t GetCurrentProcess(void);
+ #endif
+
+ #if defined(__OpenBSD__) && defined(__mips__)
+-#include <machine/sysarch.h>
++// clang-format off
+ #include <sys/types.h>
++#include <machine/sysarch.h>
++// clang-format on
+ #endif
+
+ #if defined(__linux__) && defined(__mips__)
diff --git a/lang/rust/files/patch-src_bootstrap_native.rs b/lang/rust/files/patch-src_bootstrap_native.rs
deleted file mode 100644
index ed2de6528b74..000000000000
--- a/lang/rust/files/patch-src_bootstrap_native.rs
+++ /dev/null
@@ -1,48 +0,0 @@
-Avoid unnecessarily restarting the LLVM build and installing it
-into STAGEDIR during the install phase.
-
-https://github.com/rust-lang/rust/issues/61206
-
---- src/bootstrap/native.rs.orig 2019-05-22 05:39:52 UTC
-+++ src/bootstrap/native.rs
-@@ -92,17 +92,9 @@ impl Step for Llvm {
- .join(exe("llvm-config", &*builder.config.build));
- let done_stamp = out_dir.join("llvm-finished-building");
-
-- if let Some(llvm_commit) = llvm_info.sha() {
- if done_stamp.exists() {
-- let done_contents = t!(fs::read(&done_stamp));
--
-- // If LLVM was already built previously and the submodule's commit didn't change
-- // from the previous build, then no action is required.
-- if done_contents == llvm_commit.as_bytes() {
-- return build_llvm_config
-- }
-+ return build_llvm_config
- }
-- }
-
- let _folder = builder.fold_output(|| "llvm");
- let descriptor = if emscripten { "Emscripten " } else { "" };
-@@ -218,6 +210,10 @@ impl Step for Llvm {
- }
- }
-
-+ if target == "powerpc64-unknown-freebsd" {
-+ cfg.define("CMAKE_EXE_LINKER_FLAGS", "-Wl,-rpath=/usr/local/lib/%CC% -L/usr/local/lib/%CC%");
-+ }
-+
- // http://llvm.org/docs/HowToCrossCompileLLVM.html
- if target != builder.config.build && !emscripten {
- builder.ensure(Llvm {
-@@ -283,9 +279,7 @@ impl Step for Llvm {
-
- cfg.build();
-
-- if let Some(llvm_commit) = llvm_info.sha() {
-- t!(fs::write(&done_stamp, llvm_commit));
-- }
-+ t!(fs::write(&done_stamp, "done building LLVM"));
-
- build_llvm_config
- }
diff --git a/lang/rust/files/patch-src_llvm-project_llvm_utils_llvm-build_llvmbuild_main.py b/lang/rust/files/patch-src_llvm-project_llvm_utils_llvm-build_llvmbuild_main.py
index 0b485dbd572f..475d9833a777 100644
--- a/lang/rust/files/patch-src_llvm-project_llvm_utils_llvm-build_llvmbuild_main.py
+++ b/lang/rust/files/patch-src_llvm-project_llvm_utils_llvm-build_llvmbuild_main.py
@@ -1,6 +1,6 @@
---- src/llvm-project/llvm/utils/llvm-build/llvmbuild/main.py.orig 2018-12-13 15:33:50 UTC
+--- src/llvm-project/llvm/utils/llvm-build/llvmbuild/main.py.orig 2019-09-20 16:14:30 UTC
+++ src/llvm-project/llvm/utils/llvm-build/llvmbuild/main.py
-@@ -659,6 +659,8 @@ def add_magic_target_components(parser, project, opts)
+@@ -657,6 +657,8 @@ def add_magic_target_components(parser, project, opts)
# We handle a few special cases of target names here for historical
# reasons, as these are the names configure currently comes up with.
native_target_name = { 'x86' : 'X86',
diff --git a/lang/rust/files/patch-vendor_libgit2-sys_lib.rs b/lang/rust/files/patch-vendor_libgit2-sys_lib.rs
index 3f342b41b922..880de9d35d0e 100644
--- a/lang/rust/files/patch-vendor_libgit2-sys_lib.rs
+++ b/lang/rust/files/patch-vendor_libgit2-sys_lib.rs
@@ -1,6 +1,6 @@
Revert to libgit2 0.28 API per https://github.com/rust-lang/git2-rs/issues/458
---- vendor/libgit2-sys/lib.rs.orig 2019-08-16 20:27:18 UTC
+--- vendor/libgit2-sys/lib.rs.orig 2019-11-04 17:34:46 UTC
+++ vendor/libgit2-sys/lib.rs
@@ -331,7 +331,6 @@ pub struct git_remote_callbacks {
pub push_negotiation: Option<git_push_negotiation>,
@@ -19,7 +19,7 @@ Revert to libgit2 0.28 API per https://github.com/rust-lang/git2-rs/issues/458
#[repr(C)]
pub struct git_push_update {
-@@ -2233,7 +2230,7 @@ extern "C" {
+@@ -2280,7 +2277,7 @@ extern "C" {
source: *const git_tree,
) -> c_int;
pub fn git_treebuilder_clear(bld: *mut git_treebuilder);
diff --git a/lang/rust/files/patch-vendor_openssl-sys_build_main.rs b/lang/rust/files/patch-vendor_openssl-sys_build_main.rs
index d9aeddc25910..0629319631dd 100644
--- a/lang/rust/files/patch-vendor_openssl-sys_build_main.rs
+++ b/lang/rust/files/patch-vendor_openssl-sys_build_main.rs
@@ -1,19 +1,59 @@
---- vendor/openssl-sys/build/main.rs.orig 2019-05-13 21:50:35 UTC
+--- vendor/openssl-sys/build/main.rs.orig 2019-11-04 17:34:46 UTC
+++ vendor/openssl-sys/build/main.rs
-@@ -505,6 +505,7 @@ See rust-openssl README for more information:
- (8, 1) => ('8', '1'),
- (8, _) => ('8', 'x'),
- (9, 0) => ('9', '0'),
-+ (9, _) => ('9', 'x'),
+@@ -183,27 +183,32 @@ See rust-openssl README for more information:
+ if let Some(libressl_version) = libressl_version {
+ println!("cargo:libressl_version_number={:x}", libressl_version);
+
++ let major = (libressl_version >> 28) as u8;
+ let minor = (libressl_version >> 20) as u8;
+ let fix = (libressl_version >> 12) as u8;
+- let (minor, fix) = match (minor, fix) {
+- (5, 0) => ('5', '0'),
+- (5, 1) => ('5', '1'),
+- (5, 2) => ('5', '2'),
+- (5, _) => ('5', 'x'),
+- (6, 0) => ('6', '0'),
+- (6, 1) => ('6', '1'),
+- (6, 2) => ('6', '2'),
+- (6, _) => ('6', 'x'),
+- (7, _) => ('7', 'x'),
+- (8, 0) => ('8', '0'),
+- (8, 1) => ('8', '1'),
+- (8, _) => ('8', 'x'),
+- (9, 0) => ('9', '0'),
++ let (major, minor, fix) = match (major, minor, fix) {
++ (2, 5, 0) => ('2', '5', '0'),
++ (2, 5, 1) => ('2', '5', '1'),
++ (2, 5, 2) => ('2', '5', '2'),
++ (2, 5, _) => ('2', '5', 'x'),
++ (2, 6, 0) => ('2', '6', '0'),
++ (2, 6, 1) => ('2', '6', '1'),
++ (2, 6, 2) => ('2', '6', '2'),
++ (2, 6, _) => ('2', '6', 'x'),
++ (2, 7, _) => ('2', '7', 'x'),
++ (2, 8, 0) => ('2', '8', '0'),
++ (2, 8, 1) => ('2', '8', '1'),
++ (2, 8, _) => ('2', '8', 'x'),
++ (2, 9, 0) => ('2', '9', '0'),
++ (2, 9, _) => ('2', '9', 'x'),
++ (3, 0, 0) => ('3', '0', '0'),
++ (3, 0, 1) => ('3', '0', '1'),
++ (3, 0, _) => ('3', '0', 'x'),
_ => version_error(),
};
-@@ -545,7 +546,7 @@ fn version_error() -> ! {
+ println!("cargo:libressl=true");
+- println!("cargo:libressl_version=2{}{}", minor, fix);
++ println!("cargo:libressl_version={}{}{}", major, minor, fix);
+ println!("cargo:version=101");
+ Version::Libressl
+ } else {
+@@ -239,7 +244,7 @@ fn version_error() -> ! {
"
This crate is only compatible with OpenSSL 1.0.1 through 1.1.1, or LibreSSL 2.5
-through 2.9.0, but a different version of OpenSSL was found. The build is now aborting
-+through 2.9.x, but a different version of OpenSSL was found. The build is now aborting
++through 3.0.x, but a different version of OpenSSL was found. The build is now aborting
due to this version mismatch.
"
diff --git a/lang/rust/files/patch-vendor_openssl-sys_src_ssl.rs b/lang/rust/files/patch-vendor_openssl-sys_src_ssl.rs
index f412c3c469f7..e54f58f9249c 100644
--- a/lang/rust/files/patch-vendor_openssl-sys_src_ssl.rs
+++ b/lang/rust/files/patch-vendor_openssl-sys_src_ssl.rs
@@ -1,6 +1,6 @@
---- vendor/openssl-sys/src/ssl.rs.orig 2019-05-13 21:50:35 UTC
+--- vendor/openssl-sys/src/ssl.rs.orig 2019-11-04 17:34:46 UTC
+++ vendor/openssl-sys/src/ssl.rs
-@@ -1032,7 +1032,7 @@ extern "C" {
+@@ -1057,7 +1057,7 @@ extern "C" {
}
cfg_if! {
diff --git a/lang/rust/files/powerpc64-elfv1/patch-src_bootstrap_native.rs b/lang/rust/files/powerpc64-elfv1/patch-src_bootstrap_native.rs
new file mode 100644
index 000000000000..854b992fcffe
--- /dev/null
+++ b/lang/rust/files/powerpc64-elfv1/patch-src_bootstrap_native.rs
@@ -0,0 +1,13 @@
+--- src/bootstrap/native.rs.orig 2019-11-04 15:45:21 UTC
++++ src/bootstrap/native.rs
+@@ -241,6 +241,10 @@ impl Step for Llvm {
+ }
+ }
+
++ if target == "powerpc64-unknown-freebsd" {
++ cfg.define("CMAKE_EXE_LINKER_FLAGS", "-Wl,-rpath=/usr/local/lib/%CC% -L/usr/local/lib/%CC%");
++ }
++
+ // http://llvm.org/docs/HowToCrossCompileLLVM.html
+ if target != builder.config.build && !emscripten {
+ builder.ensure(Llvm {
diff --git a/lang/rust/files/patch-src_librustc__llvm_build.rs b/lang/rust/files/powerpc64-elfv1/patch-src_librustc__llvm_build.rs
index fa2064382f55..db32de43d8c5 100644
--- a/lang/rust/files/patch-src_librustc__llvm_build.rs
+++ b/lang/rust/files/powerpc64-elfv1/patch-src_librustc__llvm_build.rs
@@ -1,6 +1,6 @@
---- src/librustc_llvm/build.rs.orig 2019-04-08 12:42:31 UTC
+--- src/librustc_llvm/build.rs.orig 2019-11-04 15:45:21 UTC
+++ src/librustc_llvm/build.rs
-@@ -254,7 +254,10 @@ fn main() {
+@@ -273,7 +273,10 @@ fn main() {
};
// C++ runtime library
diff --git a/lang/rust/files/powerpc64-elfv2/patch-src_librustc__target_abi_call_powerpc64.rs b/lang/rust/files/powerpc64-elfv2/patch-src_librustc__target_abi_call_powerpc64.rs
new file mode 100644
index 000000000000..bc48318fa83e
--- /dev/null
+++ b/lang/rust/files/powerpc64-elfv2/patch-src_librustc__target_abi_call_powerpc64.rs
@@ -0,0 +1,11 @@
+--- src/librustc_target/abi/call/powerpc64.rs.orig 2019-09-23 21:15:52 UTC
++++ src/librustc_target/abi/call/powerpc64.rs
+@@ -128,7 +128,7 @@ pub fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut F
+ ELFv2
+ } else {
+ match cx.data_layout().endian {
+- Endian::Big => ELFv1,
++ Endian::Big => ELFv2,
+ Endian::Little => ELFv2
+ }
+ };
diff --git a/lang/rust/files/powerpc64-elfv2/patch-src_llvm-project_clang_lib_Basic_Targets_PPC.h b/lang/rust/files/powerpc64-elfv2/patch-src_llvm-project_clang_lib_Basic_Targets_PPC.h
new file mode 100644
index 000000000000..43e85603791d
--- /dev/null
+++ b/lang/rust/files/powerpc64-elfv2/patch-src_llvm-project_clang_lib_Basic_Targets_PPC.h
@@ -0,0 +1,34 @@
+--- src/llvm-project/clang/lib/Basic/Targets/PPC.h.orig 2019-09-20 16:14:30 UTC
++++ src/llvm-project/clang/lib/Basic/Targets/PPC.h
+@@ -374,12 +374,29 @@ class LLVM_LIBRARY_VISIBILITY PPC64TargetInfo : public
+ IntMaxType = SignedLong;
+ Int64Type = SignedLong;
+
++ if (Triple.getEnvironment() != llvm::Triple::UnknownEnvironment) {
++ switch (Triple.getEnvironment()){
++ case llvm::Triple::ELFv1:
++ ABI = "elfv1";
++ break;
++ default:
++ ABI = "elfv2";
++ break;
++ }
++ } else {
++ if ((Triple.getOS() == llvm::Triple::FreeBSD) &&
++ (Triple.getOSMajorVersion() < 13)) {
++ ABI = "elfv1";
++ } else {
++ ABI = "elfv2";
++ }
++ }
++
++
+ if ((Triple.getArch() == llvm::Triple::ppc64le)) {
+ resetDataLayout("e-m:e-i64:64-n32:64");
+- ABI = "elfv2";
+ } else {
+ resetDataLayout("E-m:e-i64:64-n32:64");
+- ABI = Triple.getEnvironment() == llvm::Triple::ELFv2 ? "elfv2" : "elfv1";
+ }
+
+ if (Triple.getOS() == llvm::Triple::AIX)
diff --git a/lang/rust/files/powerpc64-elfv2/patch-src_llvm-project_llvm_lib_Target_PowerPC_PPCTargetMachine.cpp b/lang/rust/files/powerpc64-elfv2/patch-src_llvm-project_llvm_lib_Target_PowerPC_PPCTargetMachine.cpp
new file mode 100644
index 000000000000..87fff59c8b28
--- /dev/null
+++ b/lang/rust/files/powerpc64-elfv2/patch-src_llvm-project_llvm_lib_Target_PowerPC_PPCTargetMachine.cpp
@@ -0,0 +1,23 @@
+--- src/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp.orig 2019-09-20 16:14:30 UTC
++++ src/llvm-project/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
+@@ -209,6 +209,20 @@ static PPCTargetMachine::PPCABI computeTargetABI(const
+ if (TT.isMacOSX())
+ return PPCTargetMachine::PPC_ABI_UNKNOWN;
+
++ if (TT.isOSFreeBSD()) {
++ switch (TT.getArch()) {
++ case Triple::ppc64le:
++ case Triple::ppc64:
++ if (TT.getOSMajorVersion() >= 13)
++ return PPCTargetMachine::PPC_ABI_ELFv2;
++ else
++ return PPCTargetMachine::PPC_ABI_ELFv1;
++ case Triple::ppc:
++ default:
++ return PPCTargetMachine::PPC_ABI_UNKNOWN;
++ }
++ }
++
+ switch (TT.getArch()) {
+ case Triple::ppc64le:
+ return PPCTargetMachine::PPC_ABI_ELFv2;