Skip to content

Commit

Permalink
Add feature definition for static_link_cpp_runtimes in unix cc tool…
Browse files Browse the repository at this point in the history
…chain config

`static_link_cpp_runtimes` is one of the well-known features - which is required if you want to link in non-default toolchain libs. However the default unix toolchain does not define it at all.

This PR adds a simple definition of this feature. The added feature is disabled by default to avoid negative impacts, and can be enabled on demand.

Closes #17391.

PiperOrigin-RevId: 507677235
Change-Id: If149a50c1ab41dad258f706bc83df0fc09f8e6e7
  • Loading branch information
yuzhy8701 authored and copybara-github committed Feb 7, 2023
1 parent 4b6f014 commit 6c7147b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/cpp/unix_cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ def _impl(ctx):
enabled = True,
)

static_link_cpp_runtimes_feature = feature(
name = "static_link_cpp_runtimes",
enabled = False,
)

default_compile_flags_feature = feature(
name = "default_compile_flags",
enabled = True,
Expand Down Expand Up @@ -1327,6 +1332,7 @@ def _impl(ctx):
asan_feature,
tsan_feature,
ubsan_feature,
static_link_cpp_runtimes_feature,
] + (
[
supports_start_end_lib_feature,
Expand Down Expand Up @@ -1365,6 +1371,7 @@ def _impl(ctx):
asan_feature,
tsan_feature,
ubsan_feature,
static_link_cpp_runtimes_feature,
] + (
[
supports_start_end_lib_feature,
Expand Down

0 comments on commit 6c7147b

Please sign in to comment.