Skip to content

Commit 979b2aa

Browse files
committed
Add gcc 11 toolchain linux x86_64
1 parent e58e628 commit 979b2aa

File tree

1 file changed

+99
-0
lines changed

1 file changed

+99
-0
lines changed
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
load("@rules_cc//cc/private/toolchain:unix_cc_toolchain_config.bzl", "cc_toolchain_config")
2+
load("@rules_cc//cc/toolchains:cc_toolchain.bzl", "cc_toolchain")
3+
4+
package(default_visibility = ["//visibility:public"])
5+
6+
cc_toolchain_config(
7+
name = "local-x86_64-linux",
8+
cpu = "k8",
9+
compiler = "gcc-11",
10+
toolchain_identifier = "cc-gcc-x86_64-linux",
11+
host_system_name = "local",
12+
target_system_name = "local",
13+
target_libc = "glibc",
14+
abi_version = "unknown",
15+
abi_libc_version = "unknown",
16+
tool_paths = {
17+
"ar": "/usr/bin/ar",
18+
"as": "/usr/bin/as",
19+
"cpp": "/usr/bin/cpp-11",
20+
"gcc": "/usr/bin/gcc-11",
21+
"g++": "/usr/bin/g++-11",
22+
"gcov": "/usr/bin/gcov-11",
23+
"ld": "/usr/bin/g++-11",
24+
"nm": "/usr/bin/nm",
25+
"objcopy": "/usr/bin/objcopy",
26+
"objdump": "/usr/bin/objdump",
27+
"ranlib": "/usr/bin/ranlib",
28+
"strip": "/usr/bin/strip",
29+
},
30+
cxx_builtin_include_directories = [
31+
"/usr/include",
32+
"/usr/include/c++/11",
33+
"/usr/include/x86_64-linux-gnu/c++/11",
34+
"/usr/include/c++/11/backward",
35+
"/usr/lib/gcc/x86_64-linux-gnu/11/include",
36+
"/usr/lib/gcc/x86_64-linux-gnu/11/include-fixed",
37+
],
38+
cxx_flags = ["-std=c++17"],
39+
opt_compile_flags = [
40+
"-g0",
41+
"-O2",
42+
"-D_FORTIFY_SOURCE=1",
43+
"-DNDEBUG",
44+
"-ffunction-sections",
45+
"-fdata-sections",
46+
],
47+
dbg_compile_flags = ["-g"],
48+
link_flags = [
49+
"-lstdc++",
50+
"-fuse-ld=gold",
51+
"-Wl,-no-as-needed",
52+
"-Wl,-z,relro,-z,now",
53+
"-B/usr/bin",
54+
"-pass-exit-codes",
55+
"-lm",
56+
],
57+
opt_link_flags = ["-Wl,--gc-sections"],
58+
unfiltered_compile_flags = [
59+
"-fno-canonical-system-headers",
60+
"-Wno-builtin-macro-redefined",
61+
"-D__DATE__=\"redacted\"",
62+
"-D__TIMESTAMP__=\"redacted\"",
63+
"-D__TIME__=\"redacted\"",
64+
],
65+
coverage_compile_flags = ["--coverage"],
66+
coverage_link_flags = ["--coverage"],
67+
supports_start_end_lib = True,
68+
)
69+
70+
filegroup(name = "empty")
71+
72+
cc_toolchain(
73+
name = "cc-gcc-x86_64-linux",
74+
all_files = ":empty",
75+
ar_files = ":empty",
76+
as_files = ":empty",
77+
compiler_files = ":empty",
78+
dwp_files = ":empty",
79+
linker_files = ":empty",
80+
objcopy_files = ":empty",
81+
strip_files = ":empty",
82+
supports_param_files = 0,
83+
toolchain_config = ":local-x86_64-linux",
84+
toolchain_identifier = "cc-gcc-x86_64-linux",
85+
)
86+
87+
toolchain(
88+
name = "cc-toolchain-x86_64-linux",
89+
exec_compatible_with = [
90+
"@platforms//os:linux",
91+
"@platforms//cpu:x86_64",
92+
],
93+
target_compatible_with = [
94+
"@platforms//os:linux",
95+
"@platforms//cpu:x86_64",
96+
],
97+
toolchain = ":cc-gcc-x86_64-linux",
98+
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
99+
)

0 commit comments

Comments
 (0)