Add workarounds for slow memcpy

This commit is contained in:
Zhang Junyang
2024-05-28 13:16:50 +00:00
committed by Tate, Hongliang Tian
parent 56a4909211
commit f581ebdd03

View File

@ -208,6 +208,13 @@ fn build_kernel_elf(
"-C panic=unwind", "-C panic=unwind",
]); ]);
if matches!(arch, Arch::X86_64) {
// This is a workaround for <https://github.com/asterinas/asterinas/issues/839>.
// It makes running on Intel CPUs after Ivy Bridge (2012) faster, but much slower
// on older CPUs.
rustflags.push("-C target-feature=+ermsb");
}
let mut command = cargo(); let mut command = cargo();
command.env_remove("RUSTUP_TOOLCHAIN"); command.env_remove("RUSTUP_TOOLCHAIN");
command.env("RUSTFLAGS", rustflags.join(" ")); command.env("RUSTFLAGS", rustflags.join(" "));