remove redundant flags
- -target - linkopts
This commit is contained in:
parent
b1209d0165
commit
f30a3afdde
@ -31,11 +31,11 @@ def declare_cc_toolchains(os, zig_sdk_path, zig_include_root):
|
||||
)
|
||||
absolute_tool_paths[name] = tool_path
|
||||
|
||||
linkopts = target_config.linkopts
|
||||
dynamic_library_linkopts = target_config.dynamic_library_linkopts
|
||||
copts = target_config.copts
|
||||
linkopts = []
|
||||
for s in getattr(target_config, "linker_version_scripts", []):
|
||||
linkopts = linkopts + ["-Wl,--version-script,%s/%s" % (zig_sdk_path, s)]
|
||||
linkopts = ["-Wl,--version-script,%s/%s" % (zig_sdk_path, s)]
|
||||
for incl in getattr(target_config, "compiler_extra_includes", []):
|
||||
copts = copts + ["-include", zig_sdk_path + "/" + incl]
|
||||
|
||||
|
@ -54,7 +54,6 @@ def _target_darwin(gocpu, zigcpu):
|
||||
"libc/include/any-macos.{}-any".format(min_os),
|
||||
"libc/include/any-macos-any",
|
||||
],
|
||||
linkopts = [],
|
||||
dynamic_library_linkopts = ["-Wl,-undefined=dynamic_lookup"],
|
||||
copts = [],
|
||||
bazel_target_cpu = "darwin",
|
||||
@ -73,7 +72,6 @@ def _target_windows(gocpu, zigcpu):
|
||||
"libunwind/include",
|
||||
"libc/include/any-windows-any",
|
||||
],
|
||||
linkopts = [],
|
||||
dynamic_library_linkopts = [],
|
||||
copts = [],
|
||||
bazel_target_cpu = "x64_windows",
|
||||
@ -106,7 +104,6 @@ def _target_linux_gnu(gocpu, zigcpu, glibc_version):
|
||||
toplevel_include = ["glibc-hacks"] if fcntl_hack else [],
|
||||
compiler_extra_includes = ["glibc-hacks/glibchack-fcntl.h"] if fcntl_hack else [],
|
||||
linker_version_scripts = ["glibc-hacks/fcntl.map"] if fcntl_hack else [],
|
||||
linkopts = ["-lc++", "-lc++abi"],
|
||||
dynamic_library_linkopts = [],
|
||||
copts = [],
|
||||
bazel_target_cpu = "k8",
|
||||
@ -131,7 +128,6 @@ def _target_linux_musl(gocpu, zigcpu):
|
||||
(["libc/include/{}-linux-any".format(zigcpu)] if zigcpu != "x86_64" else []) + [
|
||||
"libc/include/any-linux-any",
|
||||
],
|
||||
linkopts = [],
|
||||
dynamic_library_linkopts = [],
|
||||
copts = ["-D_LIBCPP_HAS_MUSL_LIBC", "-D_LIBCPP_HAS_THREAD_API_PTHREAD"],
|
||||
bazel_target_cpu = "k8",
|
||||
|
@ -93,8 +93,6 @@ def _zig_cc_toolchain_config_impl(ctx):
|
||||
"-I" + d
|
||||
for d in ctx.attr.cxx_builtin_include_directories
|
||||
] + [
|
||||
"-target",
|
||||
ctx.attr.target + ctx.attr.target_suffix,
|
||||
"-no-canonical-prefixes",
|
||||
"-Wno-builtin-macro-redefined",
|
||||
"-D__DATE__=\"redacted\"",
|
||||
@ -128,17 +126,7 @@ def _zig_cc_toolchain_config_impl(ctx):
|
||||
default_linker_flags = feature(
|
||||
name = "default_linker_flags",
|
||||
enabled = True,
|
||||
flag_sets = [
|
||||
flag_set(
|
||||
actions = all_link_actions,
|
||||
flag_groups = [
|
||||
flag_group(
|
||||
flags = ["-target", ctx.attr.target] +
|
||||
ctx.attr.linkopts,
|
||||
),
|
||||
],
|
||||
),
|
||||
] + dynamic_library_flag_sets,
|
||||
flag_sets = dynamic_library_flag_sets,
|
||||
)
|
||||
|
||||
features = [
|
||||
|
Loading…
Reference in New Issue
Block a user