Skip to content

Commit f3a3d2b

Browse files
committed
automatically set hotpatch for aarch64 as it already fulfils the conditions
1 parent 2283847 commit f3a3d2b

File tree

1 file changed

+4
-3
lines changed
  • compiler/rustc_codegen_llvm/src/back

1 file changed

+4
-3
lines changed

compiler/rustc_codegen_llvm/src/back/write.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,10 @@ pub(crate) fn target_machine_factory(
225225
let use_init_array =
226226
!sess.opts.unstable_opts.use_ctors_section.unwrap_or(sess.target.use_ctors_section);
227227

228-
// this annotes in the debug file that code is hotpatchable. In addtion without it -functionpadmin will be ignored.
229-
// See: https://github.com/llvm/llvm-project/blob/d703b922961e0d02a5effdd4bfbb23ad50a3cc9f/lld/COFF/Writer.cpp#L1298
230-
let use_hotpatch = sess.opts.unstable_opts.hotpatch && sess.target.is_x86();
228+
// this makes LLVM add a hotpatch flag in the codeview S_COMPILE3 record,
229+
// which is required by linkers for the functionpadmin option
230+
// aarch64 is always hotpatchable
231+
let use_hotpatch = sess.opts.unstable_opts.hotpatch || sess.target.arch.contains("aarch64");
231232

232233
let path_mapping = sess.source_map().path_mapping().clone();
233234

0 commit comments

Comments
 (0)