about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/common.rs
diff options
context:
space:
mode:
authorThom Chiovoloni <chiovolonit@gmail.com>2023-11-15 07:56:40 +0000
committerThom Chiovoloni <chiovolonit@gmail.com>2023-11-15 07:56:40 +0000
commit268f5c57b9da5111cf10c4807bc7b367914d8f7b (patch)
tree5f4eb0ccd2dc5fc0420f860d30b820186c0fa33a /compiler/rustc_codegen_llvm/src/common.rs
parent1db4b12494f698754b925f55061eb9e6b3241423 (diff)
downloadrust-268f5c57b9da5111cf10c4807bc7b367914d8f7b.tar.gz
rust-268f5c57b9da5111cf10c4807bc7b367914d8f7b.zip
Ensure strings created with `const_str` get the `unnamed_addr` attribute
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/common.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/common.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/common.rs b/compiler/rustc_codegen_llvm/src/common.rs
index 0b0816c27b6..d1b643f4967 100644
--- a/compiler/rustc_codegen_llvm/src/common.rs
+++ b/compiler/rustc_codegen_llvm/src/common.rs
@@ -203,6 +203,7 @@ impl<'ll, 'tcx> ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
                 unsafe {
                     llvm::LLVMSetInitializer(g, sc);
                     llvm::LLVMSetGlobalConstant(g, True);
+                    llvm::LLVMSetUnnamedAddress(g, llvm::UnnamedAddr::Global);
                     llvm::LLVMRustSetLinkage(g, llvm::Linkage::InternalLinkage);
                 }
                 (s.to_owned(), g)