Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cc/private/toolchain/unix_cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,7 @@ def _impl(ctx):
flag_groups = [
flag_group(
flags = [
"-no_warning_for_no_symbols",
"-static",
"-o",
"%{output_execpath}",
Expand Down
10 changes: 10 additions & 0 deletions cc/toolchains/args/archiver_flags/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,23 @@ cc_feature(
cc_args_list(
name = "archiver_flags",
args = [
":no_warning_for_no_symbols",
":create_static_archive",
":output_execpath",
":libraries_to_link",
],
visibility = ["//visibility:public"],
)

cc_args(
name = "no_warning_for_no_symbols",
actions = ["//cc/toolchains/actions:ar_actions"],
args = select({
":use_libtool_on_macos_setting": ["-no_warning_for_no_symbols"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: -no_warning_for_no_symbols can be moved into create_static_archive below, next to -static.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review. I'll move that down. There is also the -D which sets default to userid, groupid, modes etc.. I can make a second PR for that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of creating a separate cc_args for this i would just include this with -static below

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

"//conditions:default": [],
}),
)

cc_args(
name = "create_static_archive",
actions = ["//cc/toolchains/actions:ar_actions"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
enabled: false
flag_sets {
actions: "c++-link-static-library"
flag_groups {
flags: "-no_warning_for_no_symbols"
}
}
flag_sets {
actions: "c++-link-static-library"
flag_groups {
Expand Down