From 20fb963ab68e086d38a51f419ed41c83dfa39333 Mon Sep 17 00:00:00 2001 From: Amanieu d'Antras Date: Fri, 10 Mar 2023 19:59:23 +0000 Subject: [PATCH] Add emutls.c for OpenHarmony --- library/compiler-builtins/build.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/compiler-builtins/build.rs b/library/compiler-builtins/build.rs index 3f5dbd3ab274..766dec05d9b3 100644 --- a/library/compiler-builtins/build.rs +++ b/library/compiler-builtins/build.rs @@ -508,6 +508,11 @@ mod c { cfg.define("LONG_BIT", "(8 * sizeof(long))"); } + // OpenHarmony also uses emulated TLS. + if target_env == "ohos" { + sources.extend(&[("__emutls_get_address", "emutls.c")]); + } + // When compiling the C code we require the user to tell us where the // source code is, and this is largely done so when we're compiling as // part of rust-lang/rust we can use the same llvm-project repository as