Skip to content

Commit 2130b36

Browse files
committed
Fix missing default features. Fix debug symbol stripping being applied to all modes instead of just fastbuild.
1 parent 7257269 commit 2130b36

File tree

6 files changed

+19
-42
lines changed

6 files changed

+19
-42
lines changed

bazel/BUILD

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,24 @@ portable_cc_toolchain(
55
apple_os_versions = {
66
"macos": "11",
77
},
8+
dbg_features = [
9+
"//feature:asan",
10+
"//feature:ubsan",
11+
"//feature:lsan",
12+
"//feature:no_optimization", # in a future version, this could be debug_optimization
13+
],
14+
enabled_features = [
15+
"//feature:c17",
16+
"//feature:cpp17",
17+
"//feature:warnings_enabled",
18+
"//feature:debug_symbols",
19+
"//feature:strip_unused_dynamic_libs",
20+
],
21+
fastbuild_features = [
22+
"//feature:no_optimization",
23+
],
24+
opt_features = [
25+
"//feature:moderate_optimization",
26+
],
827
visibility = ["//visibility:public"],
928
)

bazel/feature/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ load("doc.bzl", "generate_features_doc")
44

55
FEATURES = [
66
"//feature/misc:debug_symbols",
7-
"//feature/misc:strip_debug_symbols",
87
"//feature/misc:strip_unused_dynamic_libs",
98
"//feature/misc:thinlto",
109
"//feature/misc:coverage",

bazel/feature/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
| Feature | Target | Description |
44
| ------- | ------ | ----------- |
55
| `debug_symbols` | `//feature:debug_symbols` | Generage debug information |
6-
| `strip_debug_symbols` | `//feature:strip_debug_symbols` | Strip debug information |
76
| `strip_unused_dynamic_libs` | `//feature:strip_unused_dynamic_libs` | Don't link against dynamic libraries that aren't referenced by any symbols |
87
| `thinlto` | `//feature:thinlto` | Link with ThinLTO (incremental link time optimization) |
98
| `coverage` | `//feature:coverage` | Compile with instrumentation for code coverage |

bazel/feature/doc.bzl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ load("//feature/std:standards.bzl", "STANDARDS_FEATURES")
22

33
FEATURES = {
44
"//feature:debug_symbols": "Generage debug information",
5-
"//feature:strip_debug_symbols": "Strip debug information",
65
"//feature:strip_unused_dynamic_libs": "Don't link against dynamic libraries that aren't referenced by any symbols",
76
"//feature:thinlto": "Link with ThinLTO (incremental link time optimization)",
87
"//feature:coverage": "Compile with instrumentation for code coverage",

bazel/feature/misc/BUILD

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,6 @@ cc_args(
4040
args = ["-gmlt"],
4141
)
4242

43-
# Strip debug symbols
44-
45-
cc_feature(
46-
name = "strip_debug_symbols",
47-
args = ["strip_debug_symbols_args"],
48-
overrides = "@rules_cc//cc/toolchains/features/legacy:strip_debug_symbols",
49-
visibility = ["//feature:__pkg__"],
50-
)
51-
52-
cc_args(
53-
name = "strip_debug_symbols_args",
54-
actions = ["@rules_cc//cc/toolchains/actions:link_actions"],
55-
args = ["-Wl,-S"],
56-
)
57-
5843
# Hide symbols
5944

6045
cc_feature(

bazel/toolchain.bzl

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,6 @@ load("@rules_cc//cc/toolchains:toolchain.bzl", "cc_toolchain")
22
load("//detail/args:target.bzl", "target_args")
33
load("//feature:doc.bzl", "FEATURES")
44

5-
DEFAULT_ENABLED_FEATURES = [
6-
"//feature:c17",
7-
"//feature:cpp17",
8-
"//feature:warnings_enabled",
9-
"//feature:debug_symbols",
10-
"//feature:strip_unused_dynamic_libs",
11-
]
12-
13-
DEFAULT_FASTBUILD_FEATURES = [
14-
"//feature:strip_debug_symbols",
15-
"//feature:no_optimization",
16-
]
17-
18-
DEFAULT_DBG_FEATURES = [
19-
"//feature:asan",
20-
"//feature:ubsan",
21-
"//feature:lsan",
22-
"//feature:no_optimization", # in a future version, this could be debug_optimization
23-
]
24-
25-
DEFAULT_OPT_FEATURES = [
26-
"//feature:moderate_optimization",
27-
]
28-
295
def portable_cc_toolchain(
306
name,
317
args = [],

0 commit comments

Comments
 (0)