From 889995d379b7d28746fc411ab87d3509d92041f5 Mon Sep 17 00:00:00 2001 From: SpamDoodler Date: Wed, 12 Apr 2023 12:11:30 +0200 Subject: [PATCH] Change wasm-ld target --- ll/args.bzl | 1 + ll/attributes.bzl | 3 ++- ll/environment.bzl | 2 +- ll/toolchain.bzl | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ll/args.bzl b/ll/args.bzl index 92481b1c..ffdd1eca 100644 --- a/ll/args.bzl +++ b/ll/args.bzl @@ -259,6 +259,7 @@ def compile_object_args( if ctx.attr.compilation_mode == "wasm": args.add("--target=wasm32") + args.add("-emit-llvm-bc") # Write compilation database. args.add("-Xarch_host") diff --git a/ll/attributes.bzl b/ll/attributes.bzl index f0f79056..5f544c92 100644 --- a/ll/attributes.bzl +++ b/ll/attributes.bzl @@ -313,8 +313,9 @@ LL_TOOLCHAIN_ATTRS = { "wasm_linker": attr.label( doc = "The linker for WebAssembly", executable = True, + allow_single_file = True, cfg = transition_to_bootstrap, - default = "@llvm-project//llvm:wasm-ld", + default = "@llvm-project//lld:wasm-ld", ), "builtin_includes": attr.label( doc = "Clang's built-in header files.", diff --git a/ll/environment.bzl b/ll/environment.bzl index 7e88e65c..3d20ad72 100644 --- a/ll/environment.bzl +++ b/ll/environment.bzl @@ -20,7 +20,7 @@ def compile_object_environment(ctx): config = ctx.attr.toolchain_configuration[BuildSettingInfo].value toolchain = ctx.toolchains["//ll:toolchain_type"] - if config in ["cpp", "omp_cpu", "wasm"]: + if config in ["cpp", "omp_cpu"]: return { "LINK": toolchain.bitcode_linker.path, "LLD": toolchain.linker.path, diff --git a/ll/toolchain.bzl b/ll/toolchain.bzl index e6d39eeb..06a2c5e3 100644 --- a/ll/toolchain.bzl +++ b/ll/toolchain.bzl @@ -30,6 +30,7 @@ def _ll_toolchain_impl(ctx): linker = lld_alias, linker_executable = ctx.executable.linker, linker_wrapper = ctx.executable.linker_wrapper, + wasm_linker = ctx.executable.wasm_linker, address_sanitizer = ctx.files.address_sanitizer, leak_sanitizer = ctx.files.leak_sanitizer, memory_sanitizer = ctx.files.memory_sanitizer,