1 // Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 //! Compilation of native dependencies like LLVM.
13 //! Native projects like LLVM unfortunately aren't suited just yet for
14 //! compilation in build scripts that Cargo has. This is because the
15 //! compilation takes a *very* long time but also because we don't want to
16 //! compile LLVM 3 times as part of a normal bootstrap (we want it cached).
18 //! LLVM and compiler-rt are essentially just wired up to everything else to
19 //! ensure that they're always in place if needed.
22 use std::ffi::OsString;
23 use std::fs::{self, File};
24 use std::io::{Read, Write};
25 use std::path::{Path, PathBuf};
26 use std::process::Command;
28 use build_helper::output;
32 use util::{self, exe};
33 use build_helper::up_to_date;
34 use builder::{Builder, RunConfig, ShouldRun, Step};
37 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
39 pub target: Interned<String>,
44 type Output = PathBuf; // path to llvm-config
46 const ONLY_HOSTS: bool = true;
48 fn should_run(run: ShouldRun) -> ShouldRun {
49 run.path("src/llvm").path("src/llvm-emscripten")
52 fn make_run(run: RunConfig) {
53 let emscripten = run.path.ends_with("llvm-emscripten");
54 run.builder.ensure(Llvm {
60 /// Compile LLVM for `target`.
61 fn run(self, builder: &Builder) -> PathBuf {
62 let target = self.target;
63 let emscripten = self.emscripten;
65 // If we're using a custom LLVM bail out here, but we can only use a
66 // custom LLVM for the build triple.
68 if let Some(config) = builder.config.target_config.get(&target) {
69 if let Some(ref s) = config.llvm_config {
70 check_llvm_version(builder, s);
71 return s.to_path_buf()
76 let rebuild_trigger = builder.src.join("src/rustllvm/llvm-rebuild-trigger");
77 let mut rebuild_trigger_contents = String::new();
78 t!(t!(File::open(&rebuild_trigger)).read_to_string(&mut rebuild_trigger_contents));
80 let (out_dir, llvm_config_ret_dir) = if emscripten {
81 let dir = builder.emscripten_llvm_out(target);
82 let config_dir = dir.join("bin");
85 let mut dir = builder.llvm_out(builder.config.build);
86 if !builder.config.build.contains("msvc") || builder.config.ninja {
89 (builder.llvm_out(target), dir.join("bin"))
91 let done_stamp = out_dir.join("llvm-finished-building");
92 let build_llvm_config = llvm_config_ret_dir
93 .join(exe("llvm-config", &*builder.config.build));
94 if done_stamp.exists() {
95 let mut done_contents = String::new();
96 t!(t!(File::open(&done_stamp)).read_to_string(&mut done_contents));
98 // If LLVM was already built previously and contents of the rebuild-trigger file
99 // didn't change from the previous build, then no action is required.
100 if done_contents == rebuild_trigger_contents {
101 return build_llvm_config
105 let _folder = builder.fold_output(|| "llvm");
106 let descriptor = if emscripten { "Emscripten " } else { "" };
107 builder.info(&format!("Building {}LLVM for {}", descriptor, target));
108 let _time = util::timeit(&builder);
109 t!(fs::create_dir_all(&out_dir));
111 // http://llvm.org/docs/CMake.html
112 let root = if self.emscripten { "src/llvm-emscripten" } else { "src/llvm" };
113 let mut cfg = cmake::Config::new(builder.src.join(root));
115 let profile = match (builder.config.llvm_optimize, builder.config.llvm_release_debuginfo) {
116 (false, _) => "Debug",
117 (true, false) => "Release",
118 (true, true) => "RelWithDebInfo",
121 // NOTE: remember to also update `config.toml.example` when changing the
123 let llvm_targets = if self.emscripten {
126 match builder.config.llvm_targets {
128 None => "X86;ARM;AArch64;Mips;PowerPC;SystemZ;MSP430;Sparc;NVPTX;Hexagon",
132 let llvm_exp_targets = if self.emscripten {
135 &builder.config.llvm_experimental_targets[..]
138 let assertions = if builder.config.llvm_assertions {"ON"} else {"OFF"};
140 cfg.out_dir(&out_dir)
142 .define("LLVM_ENABLE_ASSERTIONS", assertions)
143 .define("LLVM_TARGETS_TO_BUILD", llvm_targets)
144 .define("LLVM_EXPERIMENTAL_TARGETS_TO_BUILD", llvm_exp_targets)
145 .define("LLVM_INCLUDE_EXAMPLES", "OFF")
146 .define("LLVM_INCLUDE_TESTS", "OFF")
147 .define("LLVM_INCLUDE_DOCS", "OFF")
148 .define("LLVM_ENABLE_ZLIB", "OFF")
149 .define("WITH_POLLY", "OFF")
150 .define("LLVM_ENABLE_TERMINFO", "OFF")
151 .define("LLVM_ENABLE_LIBEDIT", "OFF")
152 .define("LLVM_ENABLE_LIBXML2", "OFF")
153 .define("LLVM_PARALLEL_COMPILE_JOBS", builder.jobs().to_string())
154 .define("LLVM_TARGET_ARCH", target.split('-').next().unwrap())
155 .define("LLVM_DEFAULT_TARGET_TRIPLE", target);
157 // By default, LLVM will automatically find OCaml and, if it finds it,
158 // install the LLVM bindings in LLVM_OCAML_INSTALL_PATH, which defaults
159 // to /usr/bin/ocaml.
160 // This causes problem for non-root builds of Rust. Side-step the issue
161 // by setting LLVM_OCAML_INSTALL_PATH to a relative path, so it installs
163 cfg.define("LLVM_OCAML_INSTALL_PATH",
164 env::var_os("LLVM_OCAML_INSTALL_PATH").unwrap_or_else(|| "usr/lib/ocaml".into()));
166 // This setting makes the LLVM tools link to the dynamic LLVM library,
167 // which saves both memory during parallel links and overall disk space
168 // for the tools. We don't distribute any of those tools, so this is
169 // just a local concern. However, it doesn't work well everywhere.
171 // If we are shipping llvm tools then we statically link them LLVM
172 if (target.contains("linux-gnu") || target.contains("apple-darwin")) &&
173 !builder.config.llvm_tools_enabled {
174 cfg.define("LLVM_LINK_LLVM_DYLIB", "ON");
177 // For distribution we want the LLVM tools to be *statically* linked to libstdc++
178 if builder.config.llvm_tools_enabled {
179 if !target.contains("windows") {
180 if target.contains("apple") {
181 cfg.define("CMAKE_EXE_LINKER_FLAGS", "-static-libstdc++");
183 cfg.define("CMAKE_EXE_LINKER_FLAGS", "-Wl,-Bsymbolic -static-libstdc++");
188 if target.contains("msvc") {
189 cfg.define("LLVM_USE_CRT_DEBUG", "MT");
190 cfg.define("LLVM_USE_CRT_RELEASE", "MT");
191 cfg.define("LLVM_USE_CRT_RELWITHDEBINFO", "MT");
192 cfg.static_crt(true);
195 if target.starts_with("i686") {
196 cfg.define("LLVM_BUILD_32_BITS", "ON");
199 if let Some(num_linkers) = builder.config.llvm_link_jobs {
201 cfg.define("LLVM_PARALLEL_LINK_JOBS", num_linkers.to_string());
205 // http://llvm.org/docs/HowToCrossCompileLLVM.html
206 if target != builder.config.build && !emscripten {
207 builder.ensure(Llvm {
208 target: builder.config.build,
211 // FIXME: if the llvm root for the build triple is overridden then we
212 // should use llvm-tblgen from there, also should verify that it
213 // actually exists most of the time in normal installs of LLVM.
214 let host = builder.llvm_out(builder.config.build).join("bin/llvm-tblgen");
215 cfg.define("CMAKE_CROSSCOMPILING", "True")
216 .define("LLVM_TABLEGEN", &host);
218 if target.contains("netbsd") {
219 cfg.define("CMAKE_SYSTEM_NAME", "NetBSD");
220 } else if target.contains("freebsd") {
221 cfg.define("CMAKE_SYSTEM_NAME", "FreeBSD");
224 cfg.define("LLVM_NATIVE_BUILD", builder.llvm_out(builder.config.build).join("build"));
227 configure_cmake(builder, target, &mut cfg, false);
229 // FIXME: we don't actually need to build all LLVM tools and all LLVM
230 // libraries here, e.g. we just want a few components and a few
231 // tools. Figure out how to filter them down and only build the right
232 // tools and libs on all platforms.
234 if builder.config.dry_run {
235 return build_llvm_config;
240 t!(t!(File::create(&done_stamp)).write_all(rebuild_trigger_contents.as_bytes()));
246 fn check_llvm_version(builder: &Builder, llvm_config: &Path) {
247 if !builder.config.llvm_version_check {
251 if builder.config.dry_run {
255 let mut cmd = Command::new(llvm_config);
256 let version = output(cmd.arg("--version"));
257 let mut parts = version.split('.').take(2)
258 .filter_map(|s| s.parse::<u32>().ok());
259 if let (Some(major), Some(_minor)) = (parts.next(), parts.next()) {
264 panic!("\n\nbad LLVM version: {}, need >=5.0\n\n", version)
267 fn configure_cmake(builder: &Builder,
268 target: Interned<String>,
269 cfg: &mut cmake::Config,
270 building_dist_binaries: bool) {
271 if builder.config.ninja {
272 cfg.generator("Ninja");
275 .host(&builder.config.build);
277 let sanitize_cc = |cc: &Path| {
278 if target.contains("msvc") {
279 OsString::from(cc.to_str().unwrap().replace("\\", "/"))
281 cc.as_os_str().to_owned()
285 // MSVC with CMake uses msbuild by default which doesn't respect these
286 // vars that we'd otherwise configure. In that case we just skip this
288 if target.contains("msvc") && !builder.config.ninja {
292 let (cc, cxx) = match builder.config.llvm_clang_cl {
293 Some(ref cl) => (cl.as_ref(), cl.as_ref()),
294 None => (builder.cc(target), builder.cxx(target).unwrap()),
297 // Handle msvc + ninja + ccache specially (this is what the bots use)
298 if target.contains("msvc") &&
299 builder.config.ninja &&
300 builder.config.ccache.is_some()
302 let mut wrap_cc = env::current_exe().expect("failed to get cwd");
303 wrap_cc.set_file_name("sccache-plus-cl.exe");
305 cfg.define("CMAKE_C_COMPILER", sanitize_cc(&wrap_cc))
306 .define("CMAKE_CXX_COMPILER", sanitize_cc(&wrap_cc));
307 cfg.env("SCCACHE_PATH",
308 builder.config.ccache.as_ref().unwrap())
309 .env("SCCACHE_TARGET", target)
310 .env("SCCACHE_CC", &cc)
311 .env("SCCACHE_CXX", &cxx);
313 // Building LLVM on MSVC can be a little ludicrous at times. We're so far
314 // off the beaten path here that I'm not really sure this is even half
315 // supported any more. Here we're trying to:
317 // * Build LLVM on MSVC
318 // * Build LLVM with `clang-cl` instead of `cl.exe`
319 // * Build a project with `sccache`
320 // * Build for 32-bit as well
321 // * Build with Ninja
323 // For `cl.exe` there are different binaries to compile 32/64 bit which
324 // we use but for `clang-cl` there's only one which internally
325 // multiplexes via flags. As a result it appears that CMake's detection
326 // of a compiler's architecture and such on MSVC **doesn't** pass any
327 // custom flags we pass in CMAKE_CXX_FLAGS below. This means that if we
328 // use `clang-cl.exe` it's always diagnosed as a 64-bit compiler which
329 // definitely causes problems since all the env vars are pointing to
332 // To hack aroudn this... again... we pass an argument that's
333 // unconditionally passed in the sccache shim. This'll get CMake to
334 // correctly diagnose it's doing a 32-bit compilation and LLVM will
335 // internally configure itself appropriately.
336 if builder.config.llvm_clang_cl.is_some() && target.contains("i686") {
337 cfg.env("SCCACHE_EXTRA_ARGS", "-m32");
340 // If ccache is configured we inform the build a little differently hwo
341 // to invoke ccache while also invoking our compilers.
342 } else if let Some(ref ccache) = builder.config.ccache {
343 cfg.define("CMAKE_C_COMPILER", ccache)
344 .define("CMAKE_C_COMPILER_ARG1", sanitize_cc(cc))
345 .define("CMAKE_CXX_COMPILER", ccache)
346 .define("CMAKE_CXX_COMPILER_ARG1", sanitize_cc(cxx));
348 cfg.define("CMAKE_C_COMPILER", sanitize_cc(cc))
349 .define("CMAKE_CXX_COMPILER", sanitize_cc(cxx));
352 cfg.build_arg("-j").build_arg(builder.jobs().to_string());
353 cfg.define("CMAKE_C_FLAGS", builder.cflags(target).join(" "));
354 let mut cxxflags = builder.cflags(target).join(" ");
355 if building_dist_binaries {
356 if builder.config.llvm_static_stdcpp && !target.contains("windows") {
357 cxxflags.push_str(" -static-libstdc++");
360 cfg.define("CMAKE_CXX_FLAGS", cxxflags);
361 if let Some(ar) = builder.ar(target) {
362 if ar.is_absolute() {
363 // LLVM build breaks if `CMAKE_AR` is a relative path, for some reason it
364 // tries to resolve this path in the LLVM build directory.
365 cfg.define("CMAKE_AR", sanitize_cc(ar));
369 if env::var_os("SCCACHE_ERROR_LOG").is_some() {
370 cfg.env("RUST_LOG", "sccache=warn");
374 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
376 pub target: Interned<String>,
380 type Output = PathBuf;
381 const ONLY_HOSTS: bool = true;
383 fn should_run(run: ShouldRun) -> ShouldRun {
384 run.path("src/tools/lld")
387 fn make_run(run: RunConfig) {
388 run.builder.ensure(Lld { target: run.target });
391 /// Compile LLVM for `target`.
392 fn run(self, builder: &Builder) -> PathBuf {
393 if builder.config.dry_run {
394 return PathBuf::from("lld-out-dir-test-gen");
396 let target = self.target;
398 let llvm_config = builder.ensure(Llvm {
403 let out_dir = builder.lld_out(target);
404 let done_stamp = out_dir.join("lld-finished-building");
405 if done_stamp.exists() {
409 let _folder = builder.fold_output(|| "lld");
410 builder.info(&format!("Building LLD for {}", target));
411 let _time = util::timeit(&builder);
412 t!(fs::create_dir_all(&out_dir));
414 let mut cfg = cmake::Config::new(builder.src.join("src/tools/lld"));
415 configure_cmake(builder, target, &mut cfg, true);
417 // This is an awful, awful hack. Discovered when we migrated to using
418 // clang-cl to compile LLVM/LLD it turns out that LLD, when built out of
419 // tree, will execute `llvm-config --cmakedir` and then tell CMake about
420 // that directory for later processing. Unfortunately if this path has
421 // forward slashes in it (which it basically always does on Windows)
422 // then CMake will hit a syntax error later on as... something isn't
425 // Instead of attempting to fix this problem in upstream CMake and/or
426 // LLVM/LLD we just hack around it here. This thin wrapper will take the
427 // output from llvm-config and replace all instances of `\` with `/` to
428 // ensure we don't hit the same bugs with escaping. It means that you
429 // can't build on a system where your paths require `\` on Windows, but
430 // there's probably a lot of reasons you can't do that other than this.
431 let llvm_config_shim = env::current_exe()
433 .with_file_name("llvm-config-wrapper");
434 cfg.out_dir(&out_dir)
436 .env("LLVM_CONFIG_REAL", llvm_config)
437 .define("LLVM_CONFIG_PATH", llvm_config_shim)
438 .define("LLVM_INCLUDE_TESTS", "OFF");
442 t!(File::create(&done_stamp));
447 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
448 pub struct TestHelpers {
449 pub target: Interned<String>,
452 impl Step for TestHelpers {
455 fn should_run(run: ShouldRun) -> ShouldRun {
456 run.path("src/test/auxiliary/rust_test_helpers.c")
459 fn make_run(run: RunConfig) {
460 run.builder.ensure(TestHelpers { target: run.target })
463 /// Compiles the `rust_test_helpers.c` library which we used in various
464 /// `run-pass` test suites for ABI testing.
465 fn run(self, builder: &Builder) {
466 if builder.config.dry_run {
469 let target = self.target;
470 let dst = builder.test_helpers_out(target);
471 let src = builder.src.join("src/test/auxiliary/rust_test_helpers.c");
472 if up_to_date(&src, &dst.join("librust_test_helpers.a")) {
476 let _folder = builder.fold_output(|| "build_test_helpers");
477 builder.info("Building test helpers");
478 t!(fs::create_dir_all(&dst));
479 let mut cfg = cc::Build::new();
481 // We may have found various cross-compilers a little differently due to our
482 // extra configuration, so inform gcc of these compilers. Note, though, that
483 // on MSVC we still need gcc's detection of env vars (ugh).
484 if !target.contains("msvc") {
485 if let Some(ar) = builder.ar(target) {
488 cfg.compiler(builder.cc(target));
491 cfg.cargo_metadata(false)
494 .host(&builder.config.build)
498 .file(builder.src.join("src/test/auxiliary/rust_test_helpers.c"))
499 .compile("rust_test_helpers");
503 const OPENSSL_VERS: &'static str = "1.0.2n";
504 const OPENSSL_SHA256: &'static str =
505 "370babb75f278c39e0c50e8c4e7493bc0f18db6867478341a832a982fd15a8fe";
507 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
509 pub target: Interned<String>,
512 impl Step for Openssl {
515 fn should_run(run: ShouldRun) -> ShouldRun {
519 fn run(self, builder: &Builder) {
520 if builder.config.dry_run {
523 let target = self.target;
524 let out = match builder.openssl_dir(target) {
529 let stamp = out.join(".stamp");
530 let mut contents = String::new();
531 drop(File::open(&stamp).and_then(|mut f| f.read_to_string(&mut contents)));
532 if contents == OPENSSL_VERS {
535 t!(fs::create_dir_all(&out));
537 let name = format!("openssl-{}.tar.gz", OPENSSL_VERS);
538 let tarball = out.join(&name);
539 if !tarball.exists() {
540 let tmp = tarball.with_extension("tmp");
541 // originally from https://www.openssl.org/source/...
542 let url = format!("https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/{}",
544 let mut last_error = None;
546 let status = Command::new("curl")
548 .arg("-f") // make curl fail if the URL does not return HTTP 200
551 .expect("failed to spawn curl");
553 // Retry if download failed.
554 if !status.success() {
555 last_error = Some(status.to_string());
559 // Ensure the hash is correct.
560 let mut shasum = if target.contains("apple") ||
561 builder.config.build.contains("netbsd") {
562 let mut cmd = Command::new("shasum");
563 cmd.arg("-a").arg("256");
566 Command::new("sha256sum")
568 let output = output(&mut shasum.arg(&tmp));
569 let found = output.split_whitespace().next().unwrap();
571 // If the hash is wrong, probably the download is incomplete or S3 served an error
572 // page. In any case, retry.
573 if found != OPENSSL_SHA256 {
574 last_error = Some(format!(
575 "downloaded openssl sha256 different\n\
584 // Everything is fine, so exit the retry loop.
588 if let Some(error) = last_error {
589 panic!("failed to download openssl source: {}", error);
591 t!(fs::rename(&tmp, &tarball));
593 let obj = out.join(format!("openssl-{}", OPENSSL_VERS));
594 let dst = builder.openssl_install_dir(target).unwrap();
595 drop(fs::remove_dir_all(&obj));
596 drop(fs::remove_dir_all(&dst));
597 builder.run(Command::new("tar").arg("zxf").arg(&tarball).current_dir(&out));
599 let mut configure = Command::new("perl");
600 configure.arg(obj.join("Configure"));
601 configure.arg(format!("--prefix={}", dst.display()));
602 configure.arg("no-dso");
603 configure.arg("no-ssl2");
604 configure.arg("no-ssl3");
606 let os = match &*target {
607 "aarch64-linux-android" => "linux-aarch64",
608 "aarch64-unknown-linux-gnu" => "linux-aarch64",
609 "aarch64-unknown-linux-musl" => "linux-aarch64",
610 "arm-linux-androideabi" => "android",
611 "arm-unknown-linux-gnueabi" => "linux-armv4",
612 "arm-unknown-linux-gnueabihf" => "linux-armv4",
613 "armv6-unknown-netbsd-eabihf" => "BSD-generic32",
614 "armv7-linux-androideabi" => "android-armv7",
615 "armv7-unknown-linux-gnueabihf" => "linux-armv4",
616 "armv7-unknown-netbsd-eabihf" => "BSD-generic32",
617 "i586-unknown-linux-gnu" => "linux-elf",
618 "i586-unknown-linux-musl" => "linux-elf",
619 "i686-apple-darwin" => "darwin-i386-cc",
620 "i686-linux-android" => "android-x86",
621 "i686-unknown-freebsd" => "BSD-x86-elf",
622 "i686-unknown-linux-gnu" => "linux-elf",
623 "i686-unknown-linux-musl" => "linux-elf",
624 "i686-unknown-netbsd" => "BSD-x86-elf",
625 "mips-unknown-linux-gnu" => "linux-mips32",
626 "mips64-unknown-linux-gnuabi64" => "linux64-mips64",
627 "mips64el-unknown-linux-gnuabi64" => "linux64-mips64",
628 "mipsel-unknown-linux-gnu" => "linux-mips32",
629 "powerpc-unknown-linux-gnu" => "linux-ppc",
630 "powerpc-unknown-linux-gnuspe" => "linux-ppc",
631 "powerpc-unknown-netbsd" => "BSD-generic32",
632 "powerpc64-unknown-linux-gnu" => "linux-ppc64",
633 "powerpc64le-unknown-linux-gnu" => "linux-ppc64le",
634 "powerpc64le-unknown-linux-musl" => "linux-ppc64le",
635 "s390x-unknown-linux-gnu" => "linux64-s390x",
636 "sparc-unknown-linux-gnu" => "linux-sparcv9",
637 "sparc64-unknown-linux-gnu" => "linux64-sparcv9",
638 "sparc64-unknown-netbsd" => "BSD-sparc64",
639 "x86_64-apple-darwin" => "darwin64-x86_64-cc",
640 "x86_64-linux-android" => "linux-x86_64",
641 "x86_64-unknown-freebsd" => "BSD-x86_64",
642 "x86_64-unknown-dragonfly" => "BSD-x86_64",
643 "x86_64-unknown-linux-gnu" => "linux-x86_64",
644 "x86_64-unknown-linux-gnux32" => "linux-x32",
645 "x86_64-unknown-linux-musl" => "linux-x86_64",
646 "x86_64-unknown-netbsd" => "BSD-x86_64",
647 _ => panic!("don't know how to configure OpenSSL for {}", target),
650 configure.env("CC", builder.cc(target));
651 for flag in builder.cflags(target) {
654 // There is no specific os target for android aarch64 or x86_64,
655 // so we need to pass some extra cflags
656 if target == "aarch64-linux-android" || target == "x86_64-linux-android" {
657 configure.arg("-mandroid");
658 configure.arg("-fomit-frame-pointer");
660 if target == "sparc64-unknown-netbsd" {
661 // Need -m64 to get assembly generated correctly for sparc64.
662 configure.arg("-m64");
663 if builder.config.build.contains("netbsd") {
664 // Disable sparc64 asm on NetBSD builders, it uses
665 // m4(1)'s -B flag, which NetBSD m4 does not support.
666 configure.arg("no-asm");
670 // Non-PIE linker support was removed in Lollipop
671 // https://source.android.com/security/enhancements/enhancements50
672 if target == "i686-linux-android" {
673 configure.arg("no-asm");
675 configure.current_dir(&obj);
676 builder.info(&format!("Configuring openssl for {}", target));
677 builder.run_quiet(&mut configure);
678 builder.info(&format!("Building openssl for {}", target));
679 builder.run_quiet(Command::new("make").arg("-j1").current_dir(&obj));
680 builder.info(&format!("Installing openssl for {}", target));
681 builder.run_quiet(Command::new("make").arg("install").arg("-j1").current_dir(&obj));
683 let mut f = t!(File::create(&stamp));
684 t!(f.write_all(OPENSSL_VERS.as_bytes()));