Ensure the hermetic launcher plays nice with features = select(...)

You can't check whether a strings is contained within a select().

BUG=b:291840720
TEST=portage/tools/run_tests.sh

Change-Id: Ica3fbc077613f8d7cf9d3337bb63de74c5d841db
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/bazel/+/5606982
Commit-Queue: Matt Stark <msta@google.com>
Reviewed-by: Shuhei Takahashi <nya@chromium.org>
Tested-by: Matt Stark <msta@google.com>
Auto-Submit: Matt Stark <msta@google.com>
diff --git a/cc/defs.bzl b/cc/defs.bzl
index dabb926..b7fe8ba 100644
--- a/cc/defs.bzl
+++ b/cc/defs.bzl
@@ -56,11 +56,9 @@
         A macro wrapping the rule with a hermetic launcher.
     """
 
-    def wrapper(name, visibility = None, features = [], **kwargs):
-        if kwargs.get("linkshared", False):
-            # Shared libraries don't need a launcher.
-            features = features + ["-hermetic_launcher"]
-        if "-hermetic_launcher" in features:
+    def wrapper(name, visibility = None, features = [], hermetic_launcher = True, **kwargs):
+        # Shared libraries don't need a launcher.
+        if kwargs.get("linkshared", False) or not hermetic_launcher:
             # buildifier: disable=native-cc
             native.cc_binary(
                 name = name,