Skip to content

Commit

Permalink
Remove mold support (#30)
Browse files Browse the repository at this point in the history
Mold no longer supports macho
  • Loading branch information
keith authored Jan 13, 2023
1 parent 1f9a08c commit 82c98d0
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 51 deletions.
3 changes: 0 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
# TODO: Remove once mold supports -S
build --strip=never

test --test_output=errors
7 changes: 1 addition & 6 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_apple_linker//:rules.bzl", "lld_override", "mold_override", "zld_override")
load("@rules_apple_linker//:rules.bzl", "lld_override", "zld_override")

zld_override(
name = "zld",
Expand All @@ -9,8 +9,3 @@ lld_override(
name = "lld",
visibility = ["//visibility:public"],
)

mold_override(
name = "mold",
visibility = ["//visibility:public"],
)
1 change: 0 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ non_module_deps = use_extension("//:deps.bzl", "linker_deps")
use_repo(
non_module_deps,
"rules_apple_linker_lld",
"rules_apple_linker_mold",
"rules_apple_linker_zld",
)
7 changes: 0 additions & 7 deletions deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ def rules_apple_linker_deps():
url = "https://github.com/keith/ld64.lld/releases/download/12-22-22/ld64.tar.xz",
)

http_archive(
name = "rules_apple_linker_mold",
build_file_content = 'filegroup(name = "mold_bin", srcs = ["ld64.mold"], visibility = ["//visibility:public"])',
sha256 = "2b1ab27d4ab0d6319cf79b6bc94710e8a515c069670191dea022c3dffaef64fd",
url = "https://github.com/keith/ld64.mold/releases/download/11-7-22/ld64.tar.xz",
)

def _impl(_):
rules_apple_linker_deps()

Expand Down
17 changes: 0 additions & 17 deletions rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -121,20 +121,3 @@ lld_override = rule(
),
provides = [apple_common.Objc, CcInfo],
)

def _mold_override(ctx):
return _linker_override(ctx, ctx.attr.mold_linkopts)

mold_override = rule(
implementation = _mold_override,
attrs = _attrs(
"@rules_apple_linker_mold//:mold_bin",
{
"mold_linkopts": attr.string_list(
mandatory = False,
doc = "The options to pass to mold, and not ld64 (see enable)",
),
},
),
provides = [apple_common.Objc, CcInfo],
)
17 changes: 0 additions & 17 deletions test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,6 @@ cc_test(
deps = ["@rules_apple_linker//:zld"],
)

cc_test(
name = "mold_test",
srcs = ["main.c"],
features = [
"-dynamic_linking_mode", # TODO: https://github.com/bazelbuild/bazel/pull/16414
],
deps = ["@rules_apple_linker//:mold"],
)

cc_library(
name = "binary_lib",
srcs = ["main.c"],
Expand Down Expand Up @@ -167,15 +158,7 @@ action_command_line_test(
mnemonics = ["CppLink"],
not_expected_argv = [
"--ld-path=external/$(BZLMOD)rules_apple_linker_lld/ld64.lld",
"--ld-path=external/$(BZLMOD)rules_apple_linker_mold/ld64.mold",
"--ld-path=external/$(BZLMOD)rules_apple_linker_zld/zld",
],
target_under_test = ":default_test",
)

action_command_line_test(
name = "use_mold_test",
expected_argv = ["--ld-path=external/$(BZLMOD)rules_apple_linker_mold/ld64.mold"],
mnemonics = ["CppLink"],
target_under_test = ":mold_test",
)

0 comments on commit 82c98d0

Please sign in to comment.