toolchains_llvm
toolchains_llvm copied to clipboard
Host platform still uses gcc
Maybe there's an obvious solution to this. I have multiple build configs, the default one uses clang via bazel-toolchain, the others use emscripten to target js/wasm. When I test c++ targets in the js/wasm config, I need a host tool at runtime. I get this using attr.label(..., cfg="host"). The problem is this tool is compiled with gcc. Is there a way to use the clang toolchain for the "host" in addition to "target"?
I tried --host_crosstool_top=@llvm_toolchain//:cc-toolchain-x86_64-linux
but that gives me
external/bazel_tools/tools/cpp/BUILD:63:11: in :cc_toolchain attribute of cc_library rule @bazel_tools//tools/cpp:malloc: '@llvm_toolchain//:cc-toolchain-x86_64-linux' does not have mandatory providers: 'CcToolchainInfo'
Ah I need to pass --noincompatible_enable_cc_toolchain_resolution
for my wasm build, otherwise it tries to use clang to compile c++ files for wasm, and this disables llvm_toolchain