about summary refs log tree commit diff
path: root/src/bootstrap/cc_detect.rs
AgeCommit message (Collapse)AuthorLines
2022-10-04Update CI to use Android NDK r25bChris Wailes-7/+18
This commit updates the CI definitions to use the most recent Android LTS NDK release: r25b. Changes since the last NDK used by Rust negate the need to generate "standalone toolchains" and newer NDKs can be used in-place. See https://developer.android.com/ndk/guides/other_build_systems#overview
2022-06-27Ensure that `static_crt` is set in the bootstrapper whenever using `cc` to ↵Daniel Paoliello-30/+27
get a compiler command line. When attempting to build rustc with LLVM on Windows, I noticed that the CRT flag provided to the C and C++ Compilers was inconsistent: ``` "-DCMAKE_C_FLAGS=-nologo -MT -Brepro" "-DCMAKE_CXX_FLAGS=-nologo -MD -Brepro" ``` Since the bootstrapper also sets the various `LLVM_USE_CRT` variables, this resulted in cl.exe reporting a bunch of warnings: ``` cl : Command line warning D9025 : overriding '/MD' with '/MT' ``` The root cause for this is that `cc_detect::find` was creating a `cc::Build` twice, but didn't set `static_crt` the second time. It's possible that this what is also causing #81381
2022-04-15Respect ranlib specified for target during LLVM buildNikita Popov-0/+4
The ranlib specified for the target was never actually transferred into the builder configuration. In the dist-x86_64-linux build we ended up using ranlib instead of llvm-ranlib.
2022-03-05Merge build_helper into utilbjorn3-1/+1
2022-03-05Remove build_helperbjorn3-2/+1
The majority of the code is only used by either rustbuild or rustc_llvm's build script. Rust_build is compiled once for rustbuild and once for every stage. This means that the majority of the code in this crate is needlessly compiled multiple times. By moving only the code actually used by the respective crates to rustbuild and rustc_llvm's build script, this needless duplicate compilation is avoided.
2022-03-03bootstrap: correct reading of flags for llvmJon Gjengset-3/+4
First, this reverts the `CFLAGS`/`CXXFLAGS` of #93918. Those flags are already read by `cc` and populated into `Build` earlier on in the process. We shouldn't be overriding that based on `CFLAGS`, since `cc` also respects overrides like `CFLAGS_{TARGET}` and `HOST_CFLAGS`, which we want to take into account. Second, this adds the same capability to specify target-specific versions of `LDFLAGS` as we have through `cc` for the `C*` flags: https://github.com/alexcrichton/cc-rs#external-configuration-via-environment-variables Note that this also necessitated an update to compiletest to treat CXXFLAGS separately from CFLAGS.
2020-10-19bootstrap: fall back to auto-detected CXXJonas Schievink-1/+2
This allows us to use the C++ compiler configured via `CXX_target_triple` env vars
2020-08-25For VxWorks:Pang, Baoshan-1/+2
fix building errors use wr-c++ as linker
2020-07-17Teach bootstrap about target files vs target triplesJake Goulding-17/+17
`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-06-07Enable LVI hardening for x86_64-fortanix-unknown-sgxJethro Beekman-1/+3
2019-12-22Format the worldMark Rousskov-21/+40
2019-08-131. support crt-staticBaoshan Pang-1/+1
2. change armv7_wrs_vxworks to armv7_wrs_vxworks_eabihf. 3. use wr-** instead of vx-** 4. set PIE to false 5. code cleanup
2019-07-16Add supporting for vxWorksBaoshan Pang-0/+2
r? @alexcrichton
2019-06-24rustbuild: always set cxx for build hostMarc-Antoine Perennou-1/+1
Even if it's not in hosts Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2019-06-21rustbuild: only autodetect cxx for hostsMarc-Antoine Perennou-12/+9
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2019-06-13rustbuild: set cxx for hosts even if not configuredMarc-Antoine Perennou-1/+1
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2019-06-13rustbuild: don't set cxx if not configuredMarc-Antoine Perennou-10/+23
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2019-06-13rustbuild: fix default value for cxxMarc-Antoine Perennou-1/+3
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2019-06-12rustbuild: detect cxx for all targetsMarc-Antoine Perennou-17/+15
Replaces #61544 Fixes #59917 We need CXX to build llvm-libunwind which can be enabled for all targets. As we needed it for all hosts anyways, just move the detection so that it is ran for all targets (which contains all hosts) instead. Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2019-02-25bootstrap: deny(rust_2018_idioms)Taiki Endo-2/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-19Rollup merge of #56947 - hsivonen:neon, r=alexcrichtonPietro Albini-1/+4
Add targets thumbv7neon-linux-androideabi and thumbv7neon-unknown-linux-gnueabihf These two targets enable both thumb-mode and NEON for ARMv7 CPUs. This another attempt at #49902, which cannot be reopened. Between that PR and this one, some subrepos with C code whose build systems were failing went away.
2018-12-13Add targets thumbv7neon-linux-androideabi and ↵Henri Sivonen-1/+4
thumbv7neon-unknown-linux-gnueabihf These two targets enable both thumb-mode and NEON for ARMv7 CPUs.
2018-12-10bootstrap: fix editionljedrz-3/+3
2018-09-10Add rustc SHA to released DWARF debuginfoAlex Crichton-2/+2
This commit updates the debuginfo that is encoded in all of our released artifacts by default. Currently it has paths like `/checkout/src/...` but these are a little inconsistent and have changed over time. This commit instead attempts to actually define the file paths in our debuginfo to be consistent between releases. All debuginfo paths are now intended to be `/rustc/$sha` where `$sha` is the git sha of the released compiler. Sub-paths are all paths into the git repo at that `$sha`.
2018-04-20Update the Cargo submoduleAlex Crichton-3/+12
2018-03-13rustbuild: Tweak CFLAGS to various libstd piecesAlex Crichton-2/+2
* Pass `opt_level(2)` when calculating CFLAGS to get the right flags on iOS * Unconditionally pass `-O2` when compiling libbacktrace This should... Close #48903 Close #48906
2018-03-03rust: Import LLD for linking wasm objectsAlex Crichton-0/+3
This commit imports the LLD project from LLVM to serve as the default linker for the `wasm32-unknown-unknown` target. The `binaryen` submoule is consequently removed along with "binaryen linker" support in rustc. Moving to LLD brings with it a number of benefits for wasm code: * LLD is itself an actual linker, so there's no need to compile all wasm code with LTO any more. As a result builds should be *much* speedier as LTO is no longer forcibly enabled for all builds of the wasm target. * LLD is quickly becoming an "official solution" for linking wasm code together. This, I believe at least, is intended to be the main supported linker for native code and wasm moving forward. Picking up support early on should help ensure that we can help LLD identify bugs and otherwise prove that it works great for all our use cases! * Improvements to the wasm toolchain are currently primarily focused around LLVM and LLD (from what I can tell at least), so it's in general much better to be on this bandwagon for bugfixes and new features. * Historical "hacks" like `wasm-gc` will soon no longer be necessary, LLD will [natively implement][gc] `--gc-sections` (better than `wasm-gc`!) which means a postprocessor is no longer needed to show off Rust's "small wasm binary size". LLD is added in a pretty standard way to rustc right now. A new rustbuild target was defined for building LLD, and this is executed when a compiler's sysroot is being assembled. LLD is compiled against the LLVM that we've got in tree, which means we're currently on the `release_60` branch, but this may get upgraded in the near future! LLD is placed into rustc's sysroot in a `bin` directory. This is similar to where `gcc.exe` can be found on Windows. This directory is automatically added to `PATH` whenever rustc executes the linker, allowing us to define a `WasmLd` linker which implements the interface that `wasm-ld`, LLD's frontend, expects. Like Emscripten the LLD target is currently only enabled for Tier 1 platforms, notably OSX/Windows/Linux, and will need to be installed manually for compiling to wasm on other platforms. LLD is by default turned off in rustbuild, and requires a `config.toml` option to be enabled to turn it on. Finally the unstable `#![wasm_import_memory]` attribute was also removed as LLD has a native option for controlling this. [gc]: https://reviews.llvm.org/D42511
2017-10-29ci: Upgrade Android SDK/NDK and refactor to use sdkmanager/avdmanager.kennytm-4/+31
* SDK tools is upgraded to 27.0.0. - Refactored to use `sdkmanager`/`avdmanager` instead of the deprecated `android` tool. * The Java version used by Android SDK is downgraded to OpenJDK-8, in order to download the SDK through HTTPS. * NDK is upgrade to r15c. - Dropped support for android-9 (2.3 / Gingerbread), the minimal supported version is now android-14 (4.0 / Ice Cream Sandwich). - Changed the default Android compiler from GCC to clang. - For details of change introduced by NDK r15, see https://github.com/android-ndk/ndk/wiki/Changelog-r15.
2017-10-15rustbuild: Support specifying archiver and linker explicitlyVadim Petrochenkov-7/+45
2017-09-28Update to the `cc` crateAlex Crichton-0/+147
This is the name the `gcc` crate has moved to