Skip to content

Commit 28bc742

Browse files
committed
embed-bitcode is no longer used in iOS
1 parent 0b1bf71 commit 28bc742

File tree

2 files changed

+3
-22
lines changed
  • compiler/rustc_codegen_llvm/src/back
  • src/doc/rustc/src/codegen-options

2 files changed

+3
-22
lines changed

compiler/rustc_codegen_llvm/src/back/write.rs

+1-18
Original file line numberDiff line numberDiff line change
@@ -955,24 +955,7 @@ pub(crate) fn bitcode_section_name(cgcx: &CodegenContext<LlvmCodegenBackend>) ->
955955
}
956956
}
957957

958-
/// Embed the bitcode of an LLVM module in the LLVM module itself.
959-
///
960-
/// This is done primarily for iOS where it appears to be standard to compile C
961-
/// code at least with `-fembed-bitcode` which creates two sections in the
962-
/// executable:
963-
///
964-
/// * __LLVM,__bitcode
965-
/// * __LLVM,__cmdline
966-
///
967-
/// It appears *both* of these sections are necessary to get the linker to
968-
/// recognize what's going on. A suitable cmdline value is taken from the
969-
/// target spec.
970-
///
971-
/// Furthermore debug/O1 builds don't actually embed bitcode but rather just
972-
/// embed an empty section.
973-
///
974-
/// Basically all of this is us attempting to follow in the footsteps of clang
975-
/// on iOS. See #35968 for lots more info.
958+
/// Embed the bitcode of an LLVM module for LTO in the LLVM module itself.
976959
unsafe fn embed_bitcode(
977960
cgcx: &CodegenContext<LlvmCodegenBackend>,
978961
llcx: &llvm::Context,

src/doc/rustc/src/codegen-options/index.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,8 @@ files. It takes one of the following values:
119119
* `n`, `no`, `off` or `false`: omit bitcode from rlibs.
120120

121121
LLVM bitcode is required when rustc is performing link-time optimization (LTO).
122-
It is also required on some targets like iOS ones where vendors look for LLVM
123-
bitcode. Embedded bitcode will appear in rustc-generated object files inside of
124-
a section whose name is defined by the target platform. Most of the time this is
125-
`.llvmbc`.
122+
Embedded bitcode will appear in rustc-generated object files inside of a section
123+
whose name is defined by the target platform. Most of the time this is `.llvmbc`.
126124

127125
The use of `-C embed-bitcode=no` can significantly improve compile times and
128126
reduce generated file sizes if your compilation does not actually need bitcode

0 commit comments

Comments
 (0)