[PATCH] D156095: [Bazel] Introduce `//compiler-rt:profile`

NAKAMURA Takumi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 18:20:21 PDT 2023


chapuni added inline comments.


================
Comment at: utils/bazel/llvm-project-overlay/compiler-rt/BUILD.bazel:16
+        "COMPILER_RT_HAS_ATOMICS=1",
+        "COMPILER_RT_HAS_FCNTL_LCK=1",
+        "COMPILER_RT_HAS_UNAME=1",
----------------
paquette wrote:
> chapuni wrote:
> > MaskRay wrote:
> > > Windows doesn't define COMPILER_RT_HAS_FCNTL_LCK or COMPILER_RT_HAS_UNAME
> > 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?
> Looks like CMake checks if the target supports `fcntl`, atomics, ..., and then sets `COMPILER_RT_HAS_<whatever>` accordingly.
> 
> For example:
> 
> https://github.com/llvm/llvm-project/blob/c8bcc48af628d9f1e6b0cfd3edda330f3c04ed9a/compiler-rt/lib/profile/CMakeLists.txt#L99
AFAIK LLVM's Bazel build is less configurable. So I think something may rely on assumptions.
See also config.bzl and llvm/Config/config.h


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156095/new/

https://reviews.llvm.org/D156095



More information about the llvm-commits mailing list