At the moment, provide only profile at first.
Details
- Reviewers
GMNGeoffrey MaskRay aaronmondal paquette - Group Reviewers
Restricted Project - Commits
- rGcd25a50a8f26: [Bazel] Introduce `//compiler-rt:profile`
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel | ||
---|---|---|
38 | should just fix the sources instead if these are finding real issues |
FYI I have buildfiles for a bunch of the compiler-rt targets at https://github.com/eomii/rules_ll/blob/main/llvm-project-overlay/compiler-rt/lib/profile/BUILD.bazel
I'd a bit hesitant to build those with the potentially very old host toolchain since these targets are linked into non clang-toolchain executables. For something like profiling this might not be as impactful as building libcxx with an old toolchain but I'm a bit worried that this could lead to issues when using bootstrapped toolchains.
Thanks for feedbacks.
I assume the host toolchain should be capable of building runtimes for bootstrapping.
[RFC] RUNTIMES may be built in-tree and be linked to tools
https://discourse.llvm.org/t/rfc-runtimes-may-be-built-in-tree-and-be-linked-to-tools/70357
rules_ll itself is interesting. I will read and play it later. Thanks.
utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel | ||
---|---|---|
17 | I haven't introduced conditions since I don't use other environments. Do you think I could use select() with minimal conditions here? Could we conditionalize defs individually? | |
25 | I missed it. Thanks. I have confirmed it can be built (and identical to CMake's in my environment). | |
38 | -Wno-strict-prototypes was redundant. It has been there since I checked -std=c11 for strdup. -Wno-pedantic is required since my environment enforces -pedantic. I know compiler-rt doesn't like -pedantic. I will remove -pedantic in my environment. |
utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel | ||
---|---|---|
17 | Looks like CMake checks if the target supports fcntl, atomics, ..., and then sets COMPILER_RT_HAS_<whatever> accordingly. For example: |
I don't have any environments for targeting Win32 at the moment.
Do we think I should make this Win32-compatible?
utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel | ||
---|---|---|
28 | It is excluded for non-Win32 targets also in CMake. |
utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel | ||
---|---|---|
17 | AFAIK LLVM's Bazel build is less configurable. So I think something may rely on assumptions. |
utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel | ||
---|---|---|
38 | copts may be pruned if -pedantic is not given. |
I think we should either
- Support Windows.
OR
- Emit a useful error ("Building libprofile on Windows using Bazel not yet supported") if we can't yet support Windows.
At the moment, this can be built for targeting linux, or will raise error before building begins.
The error cannot be seen unless //compiler-rt:profile is specified as a target explicitly.
utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel | ||
---|---|---|
35–36 | Seems wrong format. I'll fix it later. |
Windows doesn't define COMPILER_RT_HAS_FCNTL_LCK or COMPILER_RT_HAS_UNAME