[bazel] Make fdio an implicit dep of cc binaries

Bug: 118309
Change-Id: Id0c3c144a18dab3c556105d2ba5cb33de7dfa3ac
Reviewed-on: https://fuchsia-review.googlesource.com/c/sdk-integration/+/783963
Fuchsia-Auto-Submit: Shai Barack <shayba@google.com>
Reviewed-by: Renato Mangini Dias <mangini@google.com>
Reviewed-by: Jay Zhuang <jayzhuang@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
diff --git a/bazel_rules_fuchsia/fuchsia/private/fuchsia_cc.bzl b/bazel_rules_fuchsia/fuchsia/private/fuchsia_cc.bzl
index 8e65be7..7ecb62c 100644
--- a/bazel_rules_fuchsia/fuchsia/private/fuchsia_cc.bzl
+++ b/bazel_rules_fuchsia/fuchsia/private/fuchsia_cc.bzl
@@ -142,12 +142,20 @@
     if exact_cc_binary_deps == None:
         fail(_invalid_deps_message % ("binary", cc_binary))
 
+    _deps = exact_cc_binary_deps
+    _implicit_deps = [
+        "%s//pkg/fdio" % sdk_root_label,
+    ]
+    for implicit_dep in _implicit_deps:
+        if implicit_dep not in _deps:
+            _deps.append(implicit_dep)
+
     _fuchsia_cc_binary(
         name = name,
         bin_name = bin_name if bin_name != None else name,
         native_target = cc_binary,
         clang_debug_symbols = "%s//:debug_symbols" % clang_root_label,
-        deps = exact_cc_binary_deps,
+        deps = _deps,
         data = [
             "%s//pkg/sysroot:dist" % sdk_root_label,
             "%s//:dist" % clang_root_label,