Skip to content

Commit d58ab3d

Browse files
Use correct section name for embedded LLVM bitcode on OSX.
1 parent 54b0e07 commit d58ab3d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/librustc_trans/back/write.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,11 @@ unsafe fn embed_bitcode(cgcx: &CodegenContext,
842842
"rustc.embedded.module\0".as_ptr() as *const _,
843843
);
844844
llvm::LLVMSetInitializer(llglobal, llconst);
845-
let section = if cgcx.opts.target_triple.triple().contains("-ios") {
845+
846+
let is_apple = cgcx.opts.target_triple.triple().contains("-ios") ||
847+
cgcx.opts.target_triple.triple().contains("-darwin");
848+
849+
let section = if is_apple {
846850
"__LLVM,__bitcode\0"
847851
} else {
848852
".llvmbc\0"
@@ -858,7 +862,7 @@ unsafe fn embed_bitcode(cgcx: &CodegenContext,
858862
"rustc.embedded.cmdline\0".as_ptr() as *const _,
859863
);
860864
llvm::LLVMSetInitializer(llglobal, llconst);
861-
let section = if cgcx.opts.target_triple.triple().contains("-ios") {
865+
let section = if is_apple {
862866
"__LLVM,__cmdline\0"
863867
} else {
864868
".llvmcmd\0"

0 commit comments

Comments
 (0)