]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_llvm/build.rs
rustc_llvm: use cc::Build::define
[rust.git] / src / librustc_llvm / build.rs
index 676bbc87b6cdbd57ca98f5c9e895b44f11cde5d5..d860c6c44f024f7a269d7830936abaa39335a498 100644 (file)
@@ -88,7 +88,7 @@ fn main() {
     let is_crossed = target != host;
 
     let mut optional_components =
-        vec!["x86", "arm", "aarch64", "mips", "powerpc", "pnacl",
+        vec!["x86", "arm", "aarch64", "mips", "powerpc",
              "systemz", "jsbackend", "webassembly", "msp430", "sparc", "nvptx"];
 
     let mut version_cmd = Command::new(&llvm_config);
@@ -154,13 +154,13 @@ fn main() {
     }
 
     for component in &components {
-        let mut flag = String::from("-DLLVM_COMPONENT_");
+        let mut flag = String::from("LLVM_COMPONENT_");
         flag.push_str(&component.to_uppercase());
-        cfg.flag(&flag);
+        cfg.define(&flag, None);
     }
 
     if env::var_os("LLVM_RUSTLLVM").is_some() {
-        cfg.flag("-DLLVM_RUSTLLVM");
+        cfg.define("LLVM_RUSTLLVM", None);
     }
 
     build_helper::rerun_if_changed_anything_in_dir(Path::new("../rustllvm"));
@@ -252,8 +252,8 @@ fn main() {
     let llvm_static_stdcpp = env::var_os("LLVM_STATIC_STDCPP");
 
     let stdcppname = if target.contains("openbsd") {
-        // OpenBSD has a particular C++ runtime library name
-        "estdc++"
+        // llvm-config on OpenBSD doesn't mention stdlib=libc++
+        "c++"
     } else if target.contains("netbsd") && llvm_static_stdcpp.is_some() {
         // NetBSD uses a separate library when relocation is required
         "stdc++_pic"