mirror of
https://github.com/termux-pacman/termux-packages.git
synced 2026-02-13 21:30:52 +00:00
42 lines
2.1 KiB
Diff
42 lines
2.1 KiB
Diff
diff -u -r ../cache/rustc-1.93.0-src/compiler/rustc_codegen_ssa/src/back/linker.rs ./compiler/rustc_codegen_ssa/src/back/linker.rs
|
|
--- ../cache/rustc-1.93.0-src/compiler/rustc_codegen_ssa/src/back/linker.rs 2026-01-19 16:34:28.000000000 +0000
|
|
+++ ./compiler/rustc_codegen_ssa/src/back/linker.rs 2026-01-25 21:16:31.635516508 +0000
|
|
@@ -18,7 +18,7 @@
|
|
use rustc_middle::ty::TyCtxt;
|
|
use rustc_session::Session;
|
|
use rustc_session::config::{self, CrateType, DebugInfo, LinkerPluginLto, Lto, OptLevel, Strip};
|
|
-use rustc_target::spec::{Abi, Arch, Cc, LinkOutputKind, LinkerFlavor, Lld, Os};
|
|
+use rustc_target::spec::{Abi, Arch, Cc, LinkOutputKind, LinkerFlavor, Lld, Os, TlsModel};
|
|
use tracing::{debug, warn};
|
|
|
|
use super::command::Command;
|
|
@@ -870,6 +870,14 @@
|
|
writeln!(f, " {sym};")?;
|
|
}
|
|
}
|
|
+ if matches!(self.sess.target.tls_model, TlsModel::Emulated) {
|
|
+ // always export the symbol from compiler-builtins
|
|
+ if symbols.is_empty() {
|
|
+ writeln!(f, " global:")?;
|
|
+ }
|
|
+ debug!(" __emutls_get_address;");
|
|
+ writeln!(f, " __emutls_get_address;")?;
|
|
+ }
|
|
writeln!(f, "\n local:\n *;\n}};")?;
|
|
};
|
|
if let Err(error) = res {
|
|
@@ -877,6 +885,13 @@
|
|
}
|
|
if self.sess.target.is_like_solaris {
|
|
self.link_arg("-M").link_arg(path);
|
|
+ } else if matches!(self.sess.target.tls_model, TlsModel::Emulated) {
|
|
+ // https://github.com/rust-lang/rustc_codegen_cranelift/issues/1296
|
|
+ // nightly rustc_codegen_cranelift does not support emutls
|
|
+ // so --undefined-version is used
|
|
+ let mut arg = OsString::from("--version-script=");
|
|
+ arg.push(path);
|
|
+ self.link_arg(arg).link_arg("--undefined-version");
|
|
} else {
|
|
let mut arg = OsString::from("--version-script=");
|
|
arg.push(path);
|