Skip to content
/ rust Public
forked from rust-lang/rust

Commit

Permalink
specify the cpu type for LLVM for OpenBSD target
Browse files Browse the repository at this point in the history
The initial purpose is to workaround the LLVM bug
https://llvm.org/bugs/show_bug.cgi?id=26554 for OpenBSD.

By default, the `cpu' is defined to `generic`. But with a 64bit
processor, the optimization for `generic` will use invalid asm code as
NOP (the generated code for NOP isn't a NOP).

According to rust-lang#20777, "x86-64" is the right thing to do for x86_64
builds.

Closes: rust-lang#31363
  • Loading branch information
semarie committed Feb 17, 2016
1 parent 82f30d2 commit 6cb41e2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/librustc_back/target/x86_64_unknown_openbsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use target::Target;

pub fn target() -> Target {
let mut base = super::openbsd_base::opts();
base.cpu = "x86-64".to_string();
base.pre_link_args.push("-m64".to_string());

Target {
Expand Down

0 comments on commit 6cb41e2

Please sign in to comment.