Skip to content

Commit be9b9e3

Browse files
buildifier on generated stuff
1 parent 39a3b5c commit be9b9e3

13 files changed

+161
-142
lines changed

tools/cross-toolchain/configs/clang/bazel_2.1.1/cc/BUILD

+68-50
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ filegroup(
3838

3939
filegroup(
4040
name = "compiler_deps",
41-
srcs = glob(["extra_tools/**"], allow_empty = True) + [":builtin_include_directory_paths"],
41+
srcs = glob(
42+
["extra_tools/**"],
43+
allow_empty = True,
44+
) + [":builtin_include_directory_paths"],
4245
)
4346

4447
# This is the entry point for --crosstool_top. Toolchains are found
@@ -56,8 +59,6 @@ cc_toolchain_suite(
5659

5760
cc_toolchain(
5861
name = "cc-compiler-k8",
59-
toolchain_identifier = "local",
60-
toolchain_config = ":local",
6162
all_files = ":compiler_deps",
6263
ar_files = ":compiler_deps",
6364
as_files = ":compiler_deps",
@@ -67,26 +68,65 @@ cc_toolchain(
6768
objcopy_files = ":empty",
6869
strip_files = ":empty",
6970
supports_param_files = 1,
71+
toolchain_config = ":local",
72+
toolchain_identifier = "local",
7073
)
7174

7275
cc_toolchain_config(
7376
name = "local",
74-
cpu = "k8",
77+
abi_libc_version = "local",
78+
abi_version = "local",
79+
compile_flags = [
80+
"-U_FORTIFY_SOURCE",
81+
"-fstack-protector",
82+
"-Wall",
83+
"-Wthread-safety",
84+
"-Wself-assign",
85+
"-fcolor-diagnostics",
86+
"-fno-omit-frame-pointer",
87+
],
7588
compiler = "clang",
76-
toolchain_identifier = "local",
89+
coverage_compile_flags = [
90+
"-fprofile-instr-generate",
91+
"-fcoverage-mapping",
92+
],
93+
coverage_link_flags = ["-fprofile-instr-generate"],
94+
cpu = "k8",
95+
cxx_builtin_include_directories = [
96+
"/usr/local/include",
97+
"/usr/lib/clang/10.0.0/include",
98+
"/usr/include/x86_64-linux-gnu",
99+
"/usr/include",
100+
"/usr/include/c++/8",
101+
"/usr/include/x86_64-linux-gnu/c++/8",
102+
"/usr/include/c++/8/backward",
103+
],
104+
cxx_flags = ["-std=c++0x"],
105+
dbg_compile_flags = ["-g"],
77106
host_system_name = "local",
78-
target_system_name = "local",
107+
link_flags = [
108+
"-fuse-ld=/usr/bin/ld.gold",
109+
"-Wl,-no-as-needed",
110+
"-Wl,-z,relro,-z,now",
111+
"-B/usr/bin",
112+
"-lm",
113+
"-static-libgcc",
114+
],
115+
link_libs = ["-l:libstdc++.a"],
116+
opt_compile_flags = [
117+
"-g0",
118+
"-O2",
119+
"-D_FORTIFY_SOURCE=1",
120+
"-DNDEBUG",
121+
"-ffunction-sections",
122+
"-fdata-sections",
123+
],
124+
opt_link_flags = ["-Wl,--gc-sections"],
125+
supports_start_end_lib = True,
79126
target_libc = "local",
80-
abi_version = "local",
81-
abi_libc_version = "local",
82-
cxx_builtin_include_directories = ["/usr/local/include",
83-
"/usr/lib/clang/10.0.0/include",
84-
"/usr/include/x86_64-linux-gnu",
85-
"/usr/include",
86-
"/usr/include/c++/8",
87-
"/usr/include/x86_64-linux-gnu/c++/8",
88-
"/usr/include/c++/8/backward"],
89-
tool_paths = {"ar": "/usr/bin/ar",
127+
target_system_name = "local",
128+
tool_paths = {
129+
"ar": "/usr/bin/ar",
90130
"ld": "/usr/bin/ld",
91131
"cpp": "/usr/bin/cpp",
92132
"gcc": "/usr/bin/clang",
@@ -95,45 +135,21 @@ cc_toolchain_config(
95135
"nm": "/usr/bin/nm",
96136
"objcopy": "/usr/bin/objcopy",
97137
"objdump": "/usr/bin/objdump",
98-
"strip": "/usr/bin/strip"},
99-
compile_flags = ["-U_FORTIFY_SOURCE",
100-
"-fstack-protector",
101-
"-Wall",
102-
"-Wthread-safety",
103-
"-Wself-assign",
104-
"-fcolor-diagnostics",
105-
"-fno-omit-frame-pointer"],
106-
opt_compile_flags = ["-g0",
107-
"-O2",
108-
"-D_FORTIFY_SOURCE=1",
109-
"-DNDEBUG",
110-
"-ffunction-sections",
111-
"-fdata-sections"],
112-
dbg_compile_flags = ["-g"],
113-
cxx_flags = ["-std=c++0x"],
114-
link_flags = ["-fuse-ld=/usr/bin/ld.gold",
115-
"-Wl,-no-as-needed",
116-
"-Wl,-z,relro,-z,now",
117-
"-B/usr/bin",
118-
"-lm",
119-
"-static-libgcc"],
120-
link_libs = ["-l:libstdc++.a"],
121-
opt_link_flags = ["-Wl,--gc-sections"],
122-
unfiltered_compile_flags = ["-no-canonical-prefixes",
123-
"-Wno-builtin-macro-redefined",
124-
"-D__DATE__=\"redacted\"",
125-
"-D__TIMESTAMP__=\"redacted\"",
126-
"-D__TIME__=\"redacted\""],
127-
coverage_compile_flags = ["-fprofile-instr-generate", "-fcoverage-mapping"],
128-
coverage_link_flags = ["-fprofile-instr-generate"],
129-
supports_start_end_lib = True,
138+
"strip": "/usr/bin/strip",
139+
},
140+
toolchain_identifier = "local",
141+
unfiltered_compile_flags = [
142+
"-no-canonical-prefixes",
143+
"-Wno-builtin-macro-redefined",
144+
"-D__DATE__=\"redacted\"",
145+
"-D__TIMESTAMP__=\"redacted\"",
146+
"-D__TIME__=\"redacted\"",
147+
],
130148
)
131149

132150
# Android tooling requires a default toolchain for the armeabi-v7a cpu.
133151
cc_toolchain(
134152
name = "cc-compiler-armeabi-v7a",
135-
toolchain_identifier = "stub_armeabi-v7a",
136-
toolchain_config = ":stub_armeabi-v7a",
137153
all_files = ":empty",
138154
ar_files = ":empty",
139155
as_files = ":empty",
@@ -143,6 +159,8 @@ cc_toolchain(
143159
objcopy_files = ":empty",
144160
strip_files = ":empty",
145161
supports_param_files = 1,
162+
toolchain_config = ":stub_armeabi-v7a",
163+
toolchain_identifier = "stub_armeabi-v7a",
146164
)
147165

148166
armeabi_cc_toolchain_config(name = "stub_armeabi-v7a")

tools/cross-toolchain/configs/clang/bazel_2.1.1/config/BUILD

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ platform(
4949
name: "OSFamily"
5050
value: "Linux"
5151
}
52-
""",
52+
""",
5353
)

tools/cross-toolchain/configs/clang/bazel_2.1.1/prysm_toolchains/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ load(":cc_toolchain_config_osx.bzl", "osx_cc_toolchain_config")
44
load(":cc_toolchain_config_linux_arm64.bzl", "arm64_cc_toolchain_config")
55
load(":cc_toolchain_config_windows.bzl", "windows_cc_toolchain_config")
66

7-
87
cc_toolchain_suite(
98
name = "multiarch_toolchain",
109
toolchains = {

tools/cross-toolchain/configs/clang/bazel_2.1.1/prysm_toolchains/cc_toolchain_config_linux_arm64.bzl

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ load(
1010
"tool_path",
1111
"with_feature_set",
1212
)
13-
1413
load(
1514
"@bazel_tools//tools/cpp:cc_toolchain_config.bzl",
1615
ALL_COMPILE_ACTIONS = "all_compile_actions",

tools/cross-toolchain/configs/clang/bazel_2.1.1/prysm_toolchains/cc_toolchain_config_osx.bzl

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ load(
1010
"tool_path",
1111
"with_feature_set",
1212
)
13-
1413
load(
1514
"@bazel_tools//tools/cpp:cc_toolchain_config.bzl",
1615
ALL_COMPILE_ACTIONS = "all_compile_actions",
@@ -142,10 +141,10 @@ def _impl(ctx):
142141
"-lc++",
143142
"-lc++abi",
144143
"-F" + sdkroot + "System/Library/Frameworks/",
145-
"-L"+ sdkroot + "usr/lib",
144+
"-L" + sdkroot + "usr/lib",
146145
"-undefined",
147146
"dynamic_lookup",
148-
],
147+
],
149148
),
150149
],
151150
),

tools/cross-toolchain/configs/clang/bazel_2.1.1/prysm_toolchains/cc_toolchain_config_windows.bzl

+7-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
load(
22
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
33
"action_config",
4+
"artifact_name_pattern",
5+
"env_entry",
6+
"env_set",
47
"feature",
58
"feature_set",
69
"flag_group",
@@ -9,18 +12,13 @@ load(
912
"tool",
1013
"tool_path",
1114
"with_feature_set",
12-
"artifact_name_pattern",
13-
"env_set",
14-
"env_entry",
1515
)
16-
1716
load(
1817
"@bazel_tools//tools/cpp:cc_toolchain_config.bzl",
1918
ALL_COMPILE_ACTIONS = "all_compile_actions",
2019
ALL_CPP_COMPILE_ACTIONS = "all_cpp_compile_actions",
2120
ALL_LINK_ACTIONS = "all_link_actions",
2221
)
23-
2422
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
2523

2624
def _impl(ctx):
@@ -39,7 +37,6 @@ def _impl(ctx):
3937
install = "/usr/x86_64-w64-mingw32/"
4038
bin_prefix = "/usr/bin/x86_64-w64-mingw32-"
4139

42-
4340
targets_windows_feature = feature(
4441
name = "targets_windows",
4542
implies = ["copy_dynamic_libraries_to_binary"],
@@ -85,8 +82,8 @@ def _impl(ctx):
8582
"-Wself-assign",
8683
"-x c++",
8784
"-lstdc++",
88-
"-lpthread"
89-
]
85+
"-lpthread",
86+
]
9087

9188
msys_mingw_link_flags = [
9289
"-l:libstdc++.a",
@@ -116,7 +113,7 @@ def _impl(ctx):
116113
],
117114
),
118115
flag_set(
119-
actions = [
116+
actions = [
120117
ACTION_NAMES.linkstamp_compile,
121118
ACTION_NAMES.cpp_compile,
122119
ACTION_NAMES.cpp_header_parsing,
@@ -158,7 +155,7 @@ def _impl(ctx):
158155
]
159156

160157
cxx_builtin_include_directories = [
161-
install +"include"
158+
install + "include",
162159
]
163160

164161
artifact_name_patterns = [
@@ -210,4 +207,3 @@ windows_cc_toolchain_config = rule(
210207
},
211208
provides = [CcToolchainConfigInfo],
212209
)
213-

0 commit comments

Comments
 (0)