Skip to content

Commit

Permalink
Pass -no_warning_for_no_symbols flag to libtool and ranlib in bazel o…
Browse files Browse the repository at this point in the history
…sx CROSSTOOL.

Reduces useless warning spam on osx, as reported in #5981.

RELNOTES: None
PiperOrigin-RevId: 229586053
  • Loading branch information
tetromino authored and Copybara-Service committed Jan 16, 2019
1 parent 09c36b7 commit 81b59f0
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 13 deletions.
48 changes: 36 additions & 12 deletions tools/osx/crosstool/CROSSTOOL.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ toolchain {
flag_set {
action: "c++-link-static-library"
flag_group {
flag: "rcs"
flag: "rcS"
flag: "%{output_execpath}"
expand_if_all_available: "output_execpath"
}
Expand Down Expand Up @@ -1414,6 +1414,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-filelist"
flag: "%{obj_list_path}"
Expand Down Expand Up @@ -1659,6 +1660,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-arch_only"
flag: "x86_64"
Expand Down Expand Up @@ -1991,7 +1993,7 @@ toolchain {
flag_set {
action: "c++-link-static-library"
flag_group {
flag: "rcs"
flag: "rcS"
flag: "%{output_execpath}"
expand_if_all_available: "output_execpath"
}
Expand Down Expand Up @@ -3092,6 +3094,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-filelist"
flag: "%{obj_list_path}"
Expand Down Expand Up @@ -3337,6 +3340,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-arch_only"
flag: "x86_64"
Expand Down Expand Up @@ -3669,7 +3673,7 @@ toolchain {
flag_set {
action: "c++-link-static-library"
flag_group {
flag: "rcs"
flag: "rcS"
flag: "%{output_execpath}"
expand_if_all_available: "output_execpath"
}
Expand Down Expand Up @@ -4772,6 +4776,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-filelist"
flag: "%{obj_list_path}"
Expand Down Expand Up @@ -5017,6 +5022,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-arch_only"
flag: "i386"
Expand Down Expand Up @@ -5344,7 +5350,7 @@ toolchain {
flag_set {
action: "c++-link-static-library"
flag_group {
flag: "rcs"
flag: "rcS"
flag: "%{output_execpath}"
expand_if_all_available: "output_execpath"
}
Expand Down Expand Up @@ -6447,6 +6453,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-filelist"
flag: "%{obj_list_path}"
Expand Down Expand Up @@ -6692,6 +6699,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-arch_only"
flag: "x86_64"
Expand Down Expand Up @@ -7019,7 +7027,7 @@ toolchain {
flag_set {
action: "c++-link-static-library"
flag_group {
flag: "rcs"
flag: "rcS"
flag: "%{output_execpath}"
expand_if_all_available: "output_execpath"
}
Expand Down Expand Up @@ -8110,6 +8118,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-filelist"
flag: "%{obj_list_path}"
Expand Down Expand Up @@ -8355,6 +8364,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-arch_only"
flag: "<architecture>"
Expand Down Expand Up @@ -8688,7 +8698,7 @@ toolchain {
flag_set {
action: "c++-link-static-library"
flag_group {
flag: "rcs"
flag: "rcS"
flag: "%{output_execpath}"
expand_if_all_available: "output_execpath"
}
Expand Down Expand Up @@ -9816,6 +9826,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-filelist"
flag: "%{obj_list_path}"
Expand Down Expand Up @@ -10064,6 +10075,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-arch_only"
flag: "x86_64"
Expand Down Expand Up @@ -10396,7 +10408,7 @@ toolchain {
flag_set {
action: "c++-link-static-library"
flag_group {
flag: "rcs"
flag: "rcS"
flag: "%{output_execpath}"
expand_if_all_available: "output_execpath"
}
Expand Down Expand Up @@ -11497,6 +11509,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-filelist"
flag: "%{obj_list_path}"
Expand Down Expand Up @@ -11742,6 +11755,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-arch_only"
flag: "i386"
Expand Down Expand Up @@ -12074,7 +12088,7 @@ toolchain {
flag_set {
action: "c++-link-static-library"
flag_group {
flag: "rcs"
flag: "rcS"
flag: "%{output_execpath}"
expand_if_all_available: "output_execpath"
}
Expand Down Expand Up @@ -13163,6 +13177,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-filelist"
flag: "%{obj_list_path}"
Expand Down Expand Up @@ -13408,6 +13423,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-arch_only"
flag: "armv7"
Expand Down Expand Up @@ -13740,7 +13756,7 @@ toolchain {
flag_set {
action: "c++-link-static-library"
flag_group {
flag: "rcs"
flag: "rcS"
flag: "%{output_execpath}"
expand_if_all_available: "output_execpath"
}
Expand Down Expand Up @@ -14831,6 +14847,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-filelist"
flag: "%{obj_list_path}"
Expand Down Expand Up @@ -15076,6 +15093,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-arch_only"
flag: "armv7k"
Expand Down Expand Up @@ -15409,7 +15427,7 @@ toolchain {
flag_set {
action: "c++-link-static-library"
flag_group {
flag: "rcs"
flag: "rcS"
flag: "%{output_execpath}"
expand_if_all_available: "output_execpath"
}
Expand Down Expand Up @@ -16525,6 +16543,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-filelist"
flag: "%{obj_list_path}"
Expand Down Expand Up @@ -16773,6 +16792,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-arch_only"
flag: "arm64"
Expand Down Expand Up @@ -17105,7 +17125,7 @@ toolchain {
flag_set {
action: "c++-link-static-library"
flag_group {
flag: "rcs"
flag: "rcS"
flag: "%{output_execpath}"
expand_if_all_available: "output_execpath"
}
Expand Down Expand Up @@ -18194,6 +18214,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-filelist"
flag: "%{obj_list_path}"
Expand Down Expand Up @@ -18439,6 +18460,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-arch_only"
flag: "arm64"
Expand Down Expand Up @@ -18771,7 +18793,7 @@ toolchain {
flag_set {
action: "c++-link-static-library"
flag_group {
flag: "rcs"
flag: "rcS"
flag: "%{output_execpath}"
expand_if_all_available: "output_execpath"
}
Expand Down Expand Up @@ -19860,6 +19882,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-filelist"
flag: "%{obj_list_path}"
Expand Down Expand Up @@ -20105,6 +20128,7 @@ toolchain {
}
flag_set {
flag_group {
flag: "-no_warning_for_no_symbols"
flag: "-static"
flag: "-arch_only"
flag: "<architecture>"
Expand Down
8 changes: 7 additions & 1 deletion tools/osx/crosstool/wrapped_ar.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ done
export ZERO_AR_DATE=1

"${MY_LOCATION}"/xcrunwrapper.sh ar "$@"
# Setting ZERO_AR_DATE for the above invocation means the output will have

# To silence the "has no symbols" warnings when generating the symbol table,
# call ar with the -S flag and then call ranlib explicitly.
"${MY_LOCATION}"/xcrunwrapper.sh \
ranlib -no_warning_for_no_symbols "$ARCHIVE_NAME"

# Setting ZERO_AR_DATE for the above invocations may mean the output will have
# zero timestamp, which, as an input, would break ld. Thus, update timestamp.
touch "$ARCHIVE_NAME"

0 comments on commit 81b59f0

Please sign in to comment.