1

remove redundant flags

- -target
- linkopts
This commit is contained in:
Motiejus Jakštys 2022-10-01 23:27:58 +03:00
parent b1209d0165
commit f30a3afdde
3 changed files with 3 additions and 19 deletions

View File

@ -31,11 +31,11 @@ def declare_cc_toolchains(os, zig_sdk_path, zig_include_root):
) )
absolute_tool_paths[name] = tool_path absolute_tool_paths[name] = tool_path
linkopts = target_config.linkopts
dynamic_library_linkopts = target_config.dynamic_library_linkopts dynamic_library_linkopts = target_config.dynamic_library_linkopts
copts = target_config.copts copts = target_config.copts
linkopts = []
for s in getattr(target_config, "linker_version_scripts", []): 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", []): for incl in getattr(target_config, "compiler_extra_includes", []):
copts = copts + ["-include", zig_sdk_path + "/" + incl] copts = copts + ["-include", zig_sdk_path + "/" + incl]

View File

@ -54,7 +54,6 @@ def _target_darwin(gocpu, zigcpu):
"libc/include/any-macos.{}-any".format(min_os), "libc/include/any-macos.{}-any".format(min_os),
"libc/include/any-macos-any", "libc/include/any-macos-any",
], ],
linkopts = [],
dynamic_library_linkopts = ["-Wl,-undefined=dynamic_lookup"], dynamic_library_linkopts = ["-Wl,-undefined=dynamic_lookup"],
copts = [], copts = [],
bazel_target_cpu = "darwin", bazel_target_cpu = "darwin",
@ -73,7 +72,6 @@ def _target_windows(gocpu, zigcpu):
"libunwind/include", "libunwind/include",
"libc/include/any-windows-any", "libc/include/any-windows-any",
], ],
linkopts = [],
dynamic_library_linkopts = [], dynamic_library_linkopts = [],
copts = [], copts = [],
bazel_target_cpu = "x64_windows", 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 [], toplevel_include = ["glibc-hacks"] if fcntl_hack else [],
compiler_extra_includes = ["glibc-hacks/glibchack-fcntl.h"] 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 [], linker_version_scripts = ["glibc-hacks/fcntl.map"] if fcntl_hack else [],
linkopts = ["-lc++", "-lc++abi"],
dynamic_library_linkopts = [], dynamic_library_linkopts = [],
copts = [], copts = [],
bazel_target_cpu = "k8", 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/{}-linux-any".format(zigcpu)] if zigcpu != "x86_64" else []) + [
"libc/include/any-linux-any", "libc/include/any-linux-any",
], ],
linkopts = [],
dynamic_library_linkopts = [], dynamic_library_linkopts = [],
copts = ["-D_LIBCPP_HAS_MUSL_LIBC", "-D_LIBCPP_HAS_THREAD_API_PTHREAD"], copts = ["-D_LIBCPP_HAS_MUSL_LIBC", "-D_LIBCPP_HAS_THREAD_API_PTHREAD"],
bazel_target_cpu = "k8", bazel_target_cpu = "k8",

View File

@ -93,8 +93,6 @@ def _zig_cc_toolchain_config_impl(ctx):
"-I" + d "-I" + d
for d in ctx.attr.cxx_builtin_include_directories for d in ctx.attr.cxx_builtin_include_directories
] + [ ] + [
"-target",
ctx.attr.target + ctx.attr.target_suffix,
"-no-canonical-prefixes", "-no-canonical-prefixes",
"-Wno-builtin-macro-redefined", "-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"", "-D__DATE__=\"redacted\"",
@ -128,17 +126,7 @@ def _zig_cc_toolchain_config_impl(ctx):
default_linker_flags = feature( default_linker_flags = feature(
name = "default_linker_flags", name = "default_linker_flags",
enabled = True, enabled = True,
flag_sets = [ flag_sets = dynamic_library_flag_sets,
flag_set(
actions = all_link_actions,
flag_groups = [
flag_group(
flags = ["-target", ctx.attr.target] +
ctx.attr.linkopts,
),
],
),
] + dynamic_library_flag_sets,
) )
features = [ features = [