From b5febe72bbe10e3a327fa983b06d64354a0954e0 Mon Sep 17 00:00:00 2001 From: chandde Date: Tue, 14 May 2019 17:00:48 -0700 Subject: [PATCH 1/4] Update lib.rs --- src/libtest/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 26612964c308f..765ee12a1d673 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -37,12 +37,12 @@ extern crate libc; use term; // FIXME(#54291): rustc and/or LLVM don't yet support building with panic-unwind -// on aarch64-pc-windows-msvc, so we don't link libtest against +// on aarch64-pc-windows-msvc, or thumbv7a-pc-windows-msvc, so we don't link libtest against // libunwind (for the time being), even though it means that -// libtest won't be fully functional on this platform. +// libtest won't be fully functional on these platforms. // // See also: https://github.com/rust-lang/rust/issues/54190#issuecomment-422904437 -#[cfg(not(all(windows, target_arch = "aarch64")))] +#[cfg(not(any(all(windows, target_arch = "aarch64"), all(windows, target_arch = "arm"))))] extern crate panic_unwind; pub use self::ColorConfig::*; From ba3785ec0a959b074450686dca7bb16182cf8d1a Mon Sep 17 00:00:00 2001 From: Chandler Deng Date: Thu, 16 May 2019 15:05:56 -0700 Subject: [PATCH 2/4] add targetarch for CodegenContext --- src/librustc_codegen_llvm/back/write.rs | 4 ++-- src/librustc_codegen_ssa/back/write.rs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/librustc_codegen_llvm/back/write.rs b/src/librustc_codegen_llvm/back/write.rs index cb59cf41a3ca5..66ba95810a625 100644 --- a/src/librustc_codegen_llvm/back/write.rs +++ b/src/librustc_codegen_llvm/back/write.rs @@ -795,10 +795,10 @@ fn create_msvc_imps( return } // The x86 ABI seems to require that leading underscores are added to symbol - // names, so we need an extra underscore on 32-bit. There's also a leading + // names, so we need an extra underscore on x86. There's also a leading // '\x01' here which disables LLVM's symbol mangling (e.g., no extra // underscores added in front). - let prefix = if cgcx.target_pointer_width == "32" { + let prefix = if cgcx.target_arch == "x86" { "\x01__imp__" } else { "\x01__imp_" diff --git a/src/librustc_codegen_ssa/back/write.rs b/src/librustc_codegen_ssa/back/write.rs index 6320d8a671ddb..1c793996c83db 100644 --- a/src/librustc_codegen_ssa/back/write.rs +++ b/src/librustc_codegen_ssa/back/write.rs @@ -248,6 +248,7 @@ pub struct CodegenContext { pub tm_factory: TargetMachineFactory, pub msvc_imps_needed: bool, pub target_pointer_width: String, + pub target_arch: String, pub debuginfo: config::DebugInfo, // Number of cgus excluding the allocator/metadata modules @@ -1103,6 +1104,7 @@ fn start_executing_work( total_cgus, msvc_imps_needed: msvc_imps_needed(tcx), target_pointer_width: tcx.sess.target.target.target_pointer_width.clone(), + target_arch: tcx.sess.target.target.arch.clone(), debuginfo: tcx.sess.opts.debuginfo, assembler_cmd, }; From 70f78b3f8cd1a1cc7324bbae6b559315e423b2af Mon Sep 17 00:00:00 2001 From: chandde Date: Fri, 17 May 2019 20:45:25 -0700 Subject: [PATCH 3/4] optimize the arm64 OR arm32 check --- src/libtest/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 765ee12a1d673..b64973573c018 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -42,7 +42,7 @@ use term; // libtest won't be fully functional on these platforms. // // See also: https://github.com/rust-lang/rust/issues/54190#issuecomment-422904437 -#[cfg(not(any(all(windows, target_arch = "aarch64"), all(windows, target_arch = "arm"))))] +#[cfg(not(all(windows, any(target_arch = "aarch64", target_arch = "arm"))))] extern crate panic_unwind; pub use self::ColorConfig::*; From 759921e2a0ec87211a0a54ab628f5ba5fbe6e578 Mon Sep 17 00:00:00 2001 From: chandde Date: Sat, 18 May 2019 00:49:54 -0700 Subject: [PATCH 4/4] fix line length --- src/libtest/lib.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index b64973573c018..6c57581a6c250 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -37,9 +37,10 @@ extern crate libc; use term; // FIXME(#54291): rustc and/or LLVM don't yet support building with panic-unwind -// on aarch64-pc-windows-msvc, or thumbv7a-pc-windows-msvc, so we don't link libtest against -// libunwind (for the time being), even though it means that -// libtest won't be fully functional on these platforms. +// on aarch64-pc-windows-msvc, or thumbv7a-pc-windows-msvc +// so we don't link libtest against libunwind (for the time being) +// even though it means that libtest won't be fully functional on +// these platforms. // // See also: https://github.com/rust-lang/rust/issues/54190#issuecomment-422904437 #[cfg(not(all(windows, any(target_arch = "aarch64", target_arch = "arm"))))]