Commit Graph

18 Commits

Author SHA1 Message Date
Zalathar
5b6ff4fe18 Don't skip nonexistent source files
This behaviour was introduced during the upgrade to LLVM 11. Now that the list
of source files has been cleaned up, we can reasonably expect _all_ of the
listed source files to be present.
2024-08-27 17:30:42 +10:00
Zalathar
7f90aa5538 Add cargo::rerun-if-changed directives for source directories 2024-08-27 17:30:25 +10:00
Zalathar
842cda6865 Always include WindowsMMap.c in the list of source files
The whole file is surrounded by `#if defined(_WIN32)`, so there's no need to
have separate logic to exclue it from non-Windows builds.
2024-08-27 17:30:25 +10:00
Zalathar
25ca8a283f Sort the list of source files 2024-08-27 17:30:19 +10:00
Zalathar
b6dba995b4 Remove InstrProfilingBiasVar.c from the list of source files
This file was introduced in LLVM 11, but was then removed in LLVM 13.
2024-08-27 17:30:06 +10:00
Zalathar
fcce75e9a6 Use helper functions to read environment variables
This also migrates from legacy `cargo:` directives to the newer `cargo::`
prefix.
2024-08-27 17:29:47 +10:00
Zalathar
2c141a4542 Update old comment referring to libcompiler_builtins 2024-08-27 15:22:35 +10:00
Zalathar
94aadf0f62 Build library/profiler_builtins from ci-llvm if appropriate 2024-08-24 21:21:34 +10:00
Zalathar
585804fcee Check that library/profiler_builtins actually found some source files
The current `build.rs` will automatically skip source files that don't exist.
An unfortunate side-effect is that if _no_ files could be found (e.g. because
the directory was wrong), the build fails with a mysterious linker error.

We can reduce the awkwardness of this by explicitly checking that at least one
source file was found.
2024-08-23 10:10:34 +10:00
Qiu Chaofan
9d71386252 Add profiling support to AIX
AIX ld needs special option to merge objects with profiling. Also,
profiler_builtins should include builtins for AIX from compiler-rt.
2024-02-28 17:41:12 +08:00
Lawrence Tang
1ecb08409d Add support for custom JSON targets when using build-std.
Currently, when building with `build-std`, some library build scripts
check properties of the target by inspecting the target triple at
`env::TARGET`, which is simply set to the filename of the JSON file
when using JSON target files.

This patch alters these build scripts to use `env::CARGO_CFG_*` to
fetch target information instead, allowing JSON target files
describing platforms without `restricted_std` to build correctly when
using `-Z build-std`.

Fixes wg-cargo-std-aware/#60.
2024-02-05 10:20:42 +00:00
Josh Stone
d0b58f40a0 Allow using external builds of the compiler-rt profile lib
This changes the bootstrap config `target.*.profiler` from a plain bool
to also allow a string, which will be used as a path to the pre-built
profiling runtime for that target. Then `profiler_builtins/build.rs`
reads that in a `LLVM_PROFILER_RT_LIB` environment variable.
2023-07-25 13:11:50 -07:00
Josh Stone
7d872f538e Update the minimum external LLVM to 10 2021-03-22 11:33:43 -07:00
Nikita Popov
41b81584e2 Build newly added InstrProfilingVersionVar.c file 2021-03-01 23:35:35 +01:00
Mateusz Mikuła
1ea121c74f Fix warning whe building profiler_builtins crate 2020-09-04 15:10:29 +02:00
Rich Kadel
dd96996c70 Add InstrProfilingPlatformFuchsia.c to profiler_builtins
All other Platform files included in `llvm-project/compiler-rt` were
present, except Fuchsia.

Now that there is a functional end-to-end version of
`-Zinstrument-coverage`, I need to start building and testing
coverage-enabled Rust programs on Fuchsia, and this file is required.
2020-08-27 11:52:36 -07:00
Mateusz Mikuła
1a9def139e Profiler: reenable atomics after #65214 2020-08-23 15:55:18 +02:00
mark
2c31b45ae8 mv std libs to library/ 2020-07-27 19:51:13 -05:00