Skip to content

Commit bb112dc

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

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+
abi_libc_version = "unknown",
9+
abi_version = "unknown",
10+
compiler = "gcc-11",
11+
coverage_compile_flags = ["--coverage"],
12+
coverage_link_flags = ["--coverage"],
13+
cpu = "k8",
14+
cxx_builtin_include_directories = [
15+
"/usr/include",
16+
"/usr/include/c++/11",
17+
"/usr/include/x86_64-linux-gnu/c++/11",
18+
"/usr/include/c++/11/backward",
19+
"/usr/lib/gcc/x86_64-linux-gnu/11/include",
20+
"/usr/lib/gcc/x86_64-linux-gnu/11/include-fixed",
21+
],
22+
cxx_flags = ["-std=c++17"],
23+
dbg_compile_flags = ["-g"],
24+
host_system_name = "local",
25+
link_flags = [
26+
"-lstdc++",
27+
"-fuse-ld=gold",
28+
"-Wl,-no-as-needed",
29+
"-Wl,-z,relro,-z,now",
30+
"-B/usr/bin",
31+
"-pass-exit-codes",
32+
"-lm",
33+
],
34+
opt_compile_flags = [
35+
"-g0",
36+
"-O2",
37+
"-D_FORTIFY_SOURCE=1",
38+
"-DNDEBUG",
39+
"-ffunction-sections",
40+
"-fdata-sections",
41+
],
42+
opt_link_flags = ["-Wl,--gc-sections"],
43+
supports_start_end_lib = True,
44+
target_libc = "glibc",
45+
target_system_name = "local",
46+
tool_paths = {
47+
"ar": "/usr/bin/ar",
48+
"as": "/usr/bin/as",
49+
"cpp": "/usr/bin/cpp-11",
50+
"gcc": "/usr/bin/gcc-11",
51+
"g++": "/usr/bin/g++-11",
52+
"gcov": "/usr/bin/gcov-11",
53+
"ld": "/usr/bin/g++-11",
54+
"nm": "/usr/bin/nm",
55+
"objcopy": "/usr/bin/objcopy",
56+
"objdump": "/usr/bin/objdump",
57+
"ranlib": "/usr/bin/ranlib",
58+
"strip": "/usr/bin/strip",
59+
},
60+
toolchain_identifier = "cc-gcc-x86_64-linux",
61+
unfiltered_compile_flags = [
62+
"-fno-canonical-system-headers",
63+
"-Wno-builtin-macro-redefined",
64+
"-D__DATE__=\"redacted\"",
65+
"-D__TIMESTAMP__=\"redacted\"",
66+
"-D__TIME__=\"redacted\"",
67+
],
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)