From 81719c74bcd48fac9f6e558a4f5ae6c04c3e9136 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Thu, 10 Nov 2022 10:06:34 +0000 Subject: [PATCH] Add OpenHarmony targets - `aarch64-unknown-linux-ohos` - `armv7-unknown-linux-ohos` --- compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 4 ++++ src/bootstrap/lib.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index c43a02724773a..b066296ead737 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -421,6 +421,10 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine( } Options.RelaxELFRelocations = RelaxELFRelocations; Options.UseInitArray = UseInitArray; + if (ForceEmulatedTls) { + Options.ExplicitEmulatedTLS = true; + Options.EmulatedTLS = true; + } #if LLVM_VERSION_LT(17, 0) if (ForceEmulatedTls) { diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 0a7aff62257a5..c0bed736eb55c 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -153,6 +153,8 @@ const EXTRA_CHECK_CFGS: &[(Option, &'static str, Option<&[&'static str]>)] // Needed to avoid the need to copy windows.lib into the sysroot. (Some(Mode::Rustc), "windows_raw_dylib", None), (Some(Mode::ToolRustc), "windows_raw_dylib", None), + // #[cfg(bootstrap)] ohos + (Some(Mode::Std), "target_env", Some(&["ohos"])), ]; /// A structure representing a Rust compiler.