about summary refs log tree commit diff
path: root/src/bootstrap/native.rs
AgeCommit message (Collapse)AuthorLines
2020-08-22bootstrap: fix a couple of clippy lint warningsMatthias Krüger-2/+2
clippy::print_literal clippy::clone_on_copy clippy::single_char_pattern clippy::into_iter_on_ref clippy::match_like_matches_macro
2020-08-18Fix asm compiler flags change from cmake 0.1.44Tomasz Miąsko-1/+2
cmake-rs@8141f0e changed the logic for handling asm compiler flags. This change was pulled in with the cmake 0.1.42 -> 0.1.44 update. This introduced two new flags to the LLVM build, breaking it: "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" This patch should resolve the breakage by handling it in bootstrap.
2020-08-15Auto merge of #74576 - myfreeweb:freebsd-sanitizers, r=oli-obkbors-0/+1
Add sanitizer support on FreeBSD Restarting #47337. Everything is better now, no more weird llvm problems, well not everything: Unfortunately, the sanitizers don't have proper support for versioned symbols (https://github.com/google/sanitizers/issues/628), so `libc`'s usage of `stat@FBSD_1.0` and so on explodes, e.g. in calling `std::fs::metadata`. Building std (now easy thanks to cargo `-Zbuild-std`) and libc with `freebsd12/13` config via the `LIBC_CI=1` env variable is a good workaround… ``` LIBC_CI=1 RUSTFLAGS="-Z sanitizer=address" cargo +san-test -Zbuild-std run --target x86_64-unknown-freebsd --verbose ``` …*except* std won't build because there's no `st_lspare` in the ino64 version of the struct, so an std patch is required: ```diff --- i/src/libstd/os/freebsd/fs.rs +++ w/src/libstd/os/freebsd/fs.rs @@ -66,8 +66,6 @@ pub trait MetadataExt { fn st_flags(&self) -> u32; #[stable(feature = "metadata_ext2", since = "1.8.0")] fn st_gen(&self) -> u32; - #[stable(feature = "metadata_ext2", since = "1.8.0")] - fn st_lspare(&self) -> u32; } #[stable(feature = "metadata_ext", since = "1.1.0")] @@ -136,7 +134,4 @@ impl MetadataExt for Metadata { fn st_flags(&self) -> u32 { self.as_inner().as_inner().st_flags as u32 } - fn st_lspare(&self) -> u32 { - self.as_inner().as_inner().st_lspare as u32 - } } ``` I guess std could like.. detect that `libc` isn't built for the old ABI, and replace the implementation of `st_lspare` with a panic?
2020-08-14Rollup merge of #75376 - tmiasko:cmake-system-name, r=Mark-SimulacrumTyler Mandry-8/+16
Set CMAKE_SYSTEM_NAME when cross-compiling Configure CMAKE_SYSTEM_NAME when cross-compiling in `configure_cmake`, to tell CMake about target system. Previously this was done only for LLVM step and now applies more generally to steps using cmake. Helps with #74576.
2020-08-14Disable zlib in LLVM on aarch64-apple-darwinMike Hommey-1/+1
2020-08-13Set CMAKE_SYSTEM_NAME when cross-compilingTomasz Miąsko-8/+16
Configure CMAKE_SYSTEM_NAME when cross-compiling in `configure_cmake`, to tell CMake about target system. Previously this was done only for LLVM step and now applies more generally to steps using cmake.
2020-08-09Add sanitizer support on FreeBSDGreg V-0/+1
2020-07-17Teach bootstrap about target files vs target triplesJake Goulding-19/+20
`rustc` allows passing in predefined target triples as well as JSON target specification files. This change allows bootstrap to have the first inkling about those differences. This allows building a cross-compiler for an out-of-tree architecture (even though that compiler won't work for other reasons). Even if no one ever uses this functionality, I think the newtype around the `Interned<String>` improves the readability of the code.
2020-07-15Rollup merge of #72973 - msizanoen1:riscv-host, r=pietroalbiniManish Goregaokar-2/+22
RISC-V GNU/Linux as host platform This PR add a new builder named `dist-riscv64-linux` that builds the compiler toolchain for RISC-V 64-bit GNU/Linux. r? @alexcrichton
2020-07-12Don't allow `DESTDIR` to influence LLVM buildsJake Goulding-0/+5
When running a command like `DESTDIR=foo x.py install` in a completely clean build directory, this will cause LLVM to be installed into `DESTDIR`, which then causes the build to fail later when it attempts to *use* those LLVM files.
2020-07-11RISC-V GNU/Linux as host platformmsizanoen1-2/+22
2020-07-08Fix cross-compilation of LLVM to aarch64 Windows targetsArlo Siemsen-8/+23
When cross-compiling, the LLVM build system recurses to build tools that need to run on the host system. However, since we pass cmake defines to set the compiler and target, LLVM still compiles these tools for the target system, rather than the host. The tools then fail to execute during the LLVM build. This change sets defines for the tools that need to run on the host (llvm-nm, llvm-tablegen, and llvm-config), so that the LLVM build does not attempt to build them, and instead relies on the tools already built. If compiling with clang-cl, this change also adds the `--target` option to specify the target triple. MSVC compilers do not require this, since there is a separate compiler binary for cross-compilation.
2020-07-01Explicitly check for iOS/tvOS.aspen-1/+1
2020-07-01Also document iphoneos-version-min.aspen-0/+1
2020-07-01Document the CMake defines.aspen-1/+4
2020-06-30Don't break on iOS Simulator builds.aspen-1/+5
2020-06-30Only set the flag in LLVM builds.aspen-0/+3
2020-06-30Changes required for rustc/cargo to build for iOS targetsaspen-0/+8
2020-06-21Auto merge of #72696 - jethrogb:jb/llvm-zlib, r=Mark-Simulacrumbors-1/+8
Enable LLVM zlib Compilers may generate ELF objects with compressed sections (although rustc currently doesn't do this). Currently, when linking these with `rust-lld`, you'll get this error: `rust-lld: error: ...: contains a compressed section, but zlib is not available` This enables zlib when building LLVM.
2020-06-20bootstrap: Factor out common code in supported_sanitizersTomasz Miąsko-45/+29
2020-06-20bootstrap: Build sanitizer runtimes for aarch64-unknown-linux-gnuTomasz Miąsko-0/+9
2020-06-11Enable LLVM zlib when building LLDJethro Beekman-1/+8
2020-06-09[AVR] Add AVR platform supportJake Goulding-1/+1
2020-05-20Set CMAKE_CXX_STANDARD when compiling LLDNikita Popov-0/+4
2020-05-10remove lldb package from bootstrap, config and build-manifestRalf Jung-12/+4
it's not been built since a long time ago
2020-05-02Extract stamp testing for LLVMMark Rousskov-45/+71
The extracted function can be used by the rest of bootstrap to detect if we've already built an up-to-date LLVM (and so it's safe for us to either request it or pretend it exists).
2020-04-24Fix cross-compiling LLD to different platformsAlex Crichton-1/+20
Looks like the native build system isn't great a coping with this, so try to work around that with a few workarounds.
2020-04-14Update the minimum external LLVM to 8Josh Stone-2/+2
LLVM 8 was released on March 20, 2019, over a year ago.
2020-04-07Make LLVM version suffix independent of rustc version on dev channelTomasz Miąsko-3/+7
Remove rustc version from LLVM version suffix on dev channel, avoiding the need for full rebuilds when moving between commits with different LLVM submodule & rustc version.
2020-03-05bootstrap: Use hash to determine if sanitizers needs to be rebuiltTomasz Miąsko-31/+67
* Rebuild sanitizers runtimes when LLVM submodule commit changes. * When rebuilding LLVM / sanitizers, remove the stamp file before starting the build process to invalidate previous build output.
2020-02-23bootstrap: Remove commit hash from LLVM version suffix to avoid rebuildsTomasz Miąsko-6/+2
The custom LLVM version suffix was introduced to avoid unintentional library names conflicts. By default it included the LLVM submodule commit hash. Changing the version suffix requires the complete LLVM rebuild, and since then every change to the submodules required it as well. Remove the commit hash from version suffix to avoid complete rebuilds, while leaving the `rust` string, the release number and release channel to disambiguate the library name.
2020-02-13Rollup merge of #69104 - tmiasko:configure-cmake, r=Mark-SimulacrumDylan DPC-9/+19
bootstrap: Configure cmake when building sanitizer runtimes Configure cmake before building sanitizer runtimes in similar way it is already configured elsewhere, to ensure that they are built with expected compiler flags. Previously this step has been intentionally omitted since sanitizer runtimes are built as universal binaries on Darwin targets, which in turn are unsupported by sccache which is also configured there. To avoid the issue everything but the compiler launcher is configured. Helps with #68863.
2020-02-12bootstrap: Configure cmake when building sanitizer runtimesTomasz Miąsko-9/+19
2020-02-11rustbuild: include channel in sanitizers installed nameMarc-Antoine Perennou-6/+10
Allows parallel install of different rust channels Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2020-02-03bootstrap: fix clippy warningsMatthias Krüger-3/+1
2020-01-22Enable ASan on FuchsiaAaron Green-0/+18
This change adds the x86_64-fuchsia and aarch64-fuchsia LLVM targets to those allowed to invoke -Zsanitizer. Currently, the only overlap between compiler_rt sanitizers supported by both rustc and Fuchsia is ASan.
2020-01-14Better support for cross compilation on Windows.Daniel Frampton-0/+2
2020-01-09Add bootstrap step for building sanitizer runtimesTomasz Miąsko-0/+115
2019-12-26Skip LLVM rebuild when skip-rebuild is trueMatthew Healy-0/+9
2019-12-22Format the worldMark Rousskov-129/+106
2019-12-02Update the minimum external LLVM to 7Josh Stone-2/+2
LLVM 7 is over a year old, which should be plenty for compatibility. The last LLVM 6 holdout was llvm-emscripten, which went away in #65501. I've also included a fix for LLVM 8 lacking `MemorySanitizerOptions`, which was broken by #66522.
2019-10-30Statically link libstdc++ on windows-gnuMateusz Mikuła-2/+2
2019-10-25Re-enable Emscripten's exception handling supportThomas Lively-0/+4
Passes LLVM codegen and Emscripten link-time flags for exception handling if and only if the panic strategy is `unwind`. Sets the default panic strategy for Emscripten targets to `unwind`. Re-enables tests that depend on unwinding support for Emscripten, including `should_panic` tests.
2019-10-21Remove `src/llvm-emscripten` submoduleAlex Crichton-50/+25
With #65251 landed there's no need to build two LLVM backends and ship them with rustc, every target we have now uses the same LLVM backend! This removes the `src/llvm-emscripten` submodule and additionally removes all support from rustbuild for building the emscripten LLVM backend. Multiple codegen backend support is left in place for now, and this is intended to be an easy 10-15 minute win on CI times by avoiding having to build LLVM twice.
2019-10-08Disable Go and OCaml bindings when building LLVMTomasz Miąsko-9/+1
Instead of instaling OCaml bindings in a location where installation will not fail, don't build them in the first place.
2019-09-04Assume non-git LLVM is fresh if the stamp file existsJosh Stone-13/+14
Rustbuild usually writes the LLVM submodule commit in a stamp file, so we can avoid rebuilding it unnecessarily. However, for builds from a source tarball (non-git), we were assuming a rebuild is always needed. This can cause a lot of extra work if any environment like `CFLAGS` changed between steps like build and install, which are often separate in distro builds. Now we also write an empty stamp file if the git commit is unknown, and its presence is trusted to indicate that no rebuild is needed. An info message reports that this is happening, along with the stamp file path that can be deleted to force a rebuild anyway.
2019-08-02rustbuild: correct line lengthSam Elliott-1/+2
2019-08-02rustbuild: WebAssembly is no longer an experimental LLVM backendSam Elliott-2/+2
2019-08-02rustbuild: RISC-V is no longer an experimental LLVM targetSam Elliott-2/+5
This commit moves RISC-V from the experimental LLVM targets to the regular LLVM targets. RISC-V was made non-experimental in https://reviews.llvm.org/rL366399 I have also sorted the list of LLVM targets, and changed the code around setting llvm_exp_targets (and its default) to match the code setting llvm_targets (and its default), ensuring future changes to the defaults, as LLVM targets become stable, affect as few places as possible.
2019-07-27Remove run-pass test suitesVadim Petrochenkov-1/+1