Skip to content

Commit e137324

Browse files
committed
fix(windows): add .exe extension to cc_toolchain tool paths
- Add .exe extension to all tool paths in cc_toolchain_config - Update gcc, ld, ar, cpp, nm, objdump, and strip paths for Windows - Format cc_config_content with exe_ext variable - Ensures C++ toolchain tools are found on Windows builds
1 parent 471b2a8 commit e137324

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

toolchains/wasi_sdk_toolchain.bzl

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -341,14 +341,14 @@ def _wasm_cc_toolchain_config_impl(ctx):
341341
"""C++ toolchain config for WASM using WASI SDK"""
342342
343343
tool_paths = [
344-
tool_path(name = "gcc", path = "bin/clang"),
345-
tool_path(name = "ld", path = "bin/wasm-ld"),
346-
tool_path(name = "ar", path = "bin/ar"),
347-
tool_path(name = "cpp", path = "bin/clang"),
344+
tool_path(name = "gcc", path = "bin/clang{exe_ext}"),
345+
tool_path(name = "ld", path = "bin/wasm-ld{exe_ext}"),
346+
tool_path(name = "ar", path = "bin/ar{exe_ext}"),
347+
tool_path(name = "cpp", path = "bin/clang{exe_ext}"),
348348
tool_path(name = "gcov", path = "/usr/bin/false"),
349-
tool_path(name = "nm", path = "bin/llvm-nm"),
350-
tool_path(name = "objdump", path = "bin/llvm-objdump"),
351-
tool_path(name = "strip", path = "bin/llvm-strip"),
349+
tool_path(name = "nm", path = "bin/llvm-nm{exe_ext}"),
350+
tool_path(name = "objdump", path = "bin/llvm-objdump{exe_ext}"),
351+
tool_path(name = "strip", path = "bin/llvm-strip{exe_ext}"),
352352
]
353353
354354
default_compile_flags_feature = feature(
@@ -416,6 +416,8 @@ wasm_cc_toolchain_config = rule(
416416
)
417417
'''
418418

419+
# Format cc_config content with executable extension
420+
cc_config_content = cc_config_content.format(exe_ext = exe_ext)
419421
repository_ctx.file("cc_toolchain_config.bzl", cc_config_content)
420422

421423
wasi_sdk_repository = repository_rule(

0 commit comments

Comments
 (0)