Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions src/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,17 +209,6 @@ impl<'this> RustcCodegenFlags<'this> {
push_if_supported(format!("-mguard={cc_val}").into());
}
}
// https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-flto
if let Some(value) = self.lto {
let cc_val = match value {
"y" | "yes" | "on" | "true" | "fat" => Some("full"),
"thin" => Some("thin"),
_ => None,
};
if let Some(cc_val) = cc_val {
push_if_supported(format!("-flto={cc_val}").into());
}
}
// https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fPIC
// https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fPIE
// https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mdynamic-no-pic
Expand All @@ -234,11 +223,6 @@ impl<'this> RustcCodegenFlags<'this> {
push_if_supported(cc_flag.into());
}
}
// https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fembed-bitcode
if let Some(value) = self.embed_bitcode {
let cc_val = if value { "all" } else { "off" };
push_if_supported(format!("-fembed-bitcode={cc_val}").into());
}
// https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fno-omit-frame-pointer
// https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fomit-frame-pointer
if let Some(value) = self.force_frame_pointers {
Expand Down Expand Up @@ -285,6 +269,24 @@ impl<'this> RustcCodegenFlags<'this> {
if let Some(value) = self.profile_use {
push_if_supported(format!("-fprofile-use={value}").into());
}

// https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fembed-bitcode
if let Some(value) = self.embed_bitcode {
let cc_val = if value { "all" } else { "off" };
push_if_supported(format!("-fembed-bitcode={cc_val}").into());
}

// https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-flto
if let Some(value) = self.lto {
let cc_val = match value {
"y" | "yes" | "on" | "true" | "fat" => Some("full"),
"thin" => Some("thin"),
_ => None,
};
if let Some(cc_val) = cc_val {
push_if_supported(format!("-flto={cc_val}").into());
}
}
}
ToolFamily::Gnu { .. } => {}
ToolFamily::Msvc { .. } => {
Expand Down