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 Original file line number Diff line number Diff line change @@ -955,24 +955,7 @@ pub(crate) fn bitcode_section_name(cgcx: &CodegenContext<LlvmCodegenBackend>) ->
955
955
}
956
956
}
957
957
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.
976
959
unsafe fn embed_bitcode (
977
960
cgcx : & CodegenContext < LlvmCodegenBackend > ,
978
961
llcx : & llvm:: Context ,
Original file line number Diff line number Diff line change @@ -119,10 +119,8 @@ files. It takes one of the following values:
119
119
* ` n ` , ` no ` , ` off ` or ` false ` : omit bitcode from rlibs.
120
120
121
121
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 ` .
126
124
127
125
The use of ` -C embed-bitcode=no ` can significantly improve compile times and
128
126
reduce generated file sizes if your compilation does not actually need bitcode
You can’t perform that action at this time.
0 commit comments