Add comment explanining unstable_target_features

This commit is contained in:
Gary Guo 2023-08-02 19:21:19 +01:00
parent aaf1b1bc93
commit 5ed556e84a

View File

@ -275,6 +275,7 @@ pub(crate) fn create_object_file(sess: &Session) -> Option<write::Object<'static
let mut e_flags: u32 = 0x0; let mut e_flags: u32 = 0x0;
// Check if compressed is enabled // Check if compressed is enabled
// `unstable_target_features` is used here because "c" is gated behind riscv_target_feature.
if sess.unstable_target_features.contains(&sym::c) { if sess.unstable_target_features.contains(&sym::c) {
e_flags |= elf::EF_RISCV_RVC; e_flags |= elf::EF_RISCV_RVC;
} }