Skip to content

Commit

Permalink
Change wasm-ld target
Browse files Browse the repository at this point in the history
  • Loading branch information
SpamDoodler committed Apr 12, 2023
1 parent 4c44542 commit 889995d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions ll/args.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion ll/attributes.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
2 changes: 1 addition & 1 deletion ll/environment.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions ll/toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 889995d

Please sign in to comment.