Skip to content

Commit 1c87af2

Browse files
committed
Auto merge of #21646 - dotdash:default_target_cpu, r=Aatch
Using `generic` as the target cpu limits the generated code to the bare basics for the arch, while we can probably assume that we'll actually be running on somewhat modern hardware. This updates the default target CPUs for the x86 and x86_64 archs to match clang's behaviour. Refs #20777
2 parents a6a6fad + 296c74d commit 1c87af2

File tree

5 files changed

+5
-1
lines changed

5 files changed

+5
-1
lines changed

src/librustc_back/target/i686_apple_darwin.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use target::Target;
1212

1313
pub fn target() -> Target {
1414
let mut base = super::apple_base::opts();
15+
base.cpu = "yonah".to_string();
1516
base.pre_link_args.push("-m32".to_string());
1617

1718
Target {

src/librustc_back/target/i686_pc_windows_gnu.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use target::Target;
1212

1313
pub fn target() -> Target {
1414
let mut options = super::windows_base::opts();
15+
options.cpu = "pentium4".to_string();
1516

1617
// Mark all dynamic libraries and executables as compatible with the larger 4GiB address
1718
// space available to x86 Windows binaries on x86_64.

src/librustc_back/target/i686_unknown_dragonfly.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use target::Target;
1212

1313
pub fn target() -> Target {
1414
let mut base = super::dragonfly_base::opts();
15+
base.cpu = "pentium4".to_string();
1516
base.pre_link_args.push("-m32".to_string());
1617

1718
Target {

src/librustc_back/target/i686_unknown_linux_gnu.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use target::Target;
1212

1313
pub fn target() -> Target {
1414
let mut base = super::linux_base::opts();
15+
base.cpu = "pentium4".to_string();
1516
base.pre_link_args.push("-m32".to_string());
1617

1718
Target {

src/librustc_back/target/x86_64_apple_darwin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use target::Target;
1212

1313
pub fn target() -> Target {
1414
let mut base = super::apple_base::opts();
15-
base.cpu = "x86-64".to_string();
15+
base.cpu = "core2".to_string();
1616
base.eliminate_frame_pointer = false;
1717
base.pre_link_args.push("-m64".to_string());
1818

0 commit comments

Comments
 (0)