Skip to content

Commit 6a667ef

Browse files
Use correct section name for embedded LLVM bitcode on OSX.
1 parent acf4fe7 commit 6a667ef

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/librustc_trans/back/write.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,11 @@ unsafe fn embed_bitcode(cgcx: &CodegenContext,
863863
"rustc.embedded.module\0".as_ptr() as *const _,
864864
);
865865
llvm::LLVMSetInitializer(llglobal, llconst);
866-
let section = if cgcx.opts.target_triple.triple().contains("-ios") {
866+
867+
let is_apple = cgcx.opts.target_triple.triple().contains("-ios") ||
868+
cgcx.opts.target_triple.triple().contains("-darwin");
869+
870+
let section = if is_apple {
867871
"__LLVM,__bitcode\0"
868872
} else {
869873
".llvmbc\0"
@@ -879,7 +883,7 @@ unsafe fn embed_bitcode(cgcx: &CodegenContext,
879883
"rustc.embedded.cmdline\0".as_ptr() as *const _,
880884
);
881885
llvm::LLVMSetInitializer(llglobal, llconst);
882-
let section = if cgcx.opts.target_triple.triple().contains("-ios") {
886+
let section = if is_apple {
883887
"__LLVM,__cmdline\0"
884888
} else {
885889
".llvmcmd\0"

0 commit comments

Comments
 (0)