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

Jessica Paquette via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 18:09:17 PDT 2023


paquette 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",
----------------
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


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