]> git.lizzy.rs Git - rust.git/commitdiff
specify the cpu type for LLVM for OpenBSD target
authorSébastien Marie <semarie@users.noreply.github.com>
Wed, 17 Feb 2016 10:30:42 +0000 (11:30 +0100)
committerSébastien Marie <semarie@users.noreply.github.com>
Wed, 17 Feb 2016 10:30:42 +0000 (11:30 +0100)
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 #20777, "x86-64" is the right thing to do for x86_64
builds.

Closes: #31363
src/librustc_back/target/x86_64_unknown_openbsd.rs

index 07a1e137b4196b798c8fd50dd16ced5a3529e460..8c995113c217564fbb16c0a5c847ce9ca8d5cde6 100644 (file)
@@ -12,6 +12,7 @@
 
 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 {