C++: Add two more rules to defs.bzl in rules_cc

These rules are in bazel_tools.

RELNOTES:none
PiperOrigin-RevId: 259298756
Change-Id: I9ed4b8f3cd712adc889a950765c96b5b68a5d43c
diff --git a/cc/defs.bzl b/cc/defs.bzl
index 01378c5..5060efe 100644
--- a/cc/defs.bzl
+++ b/cc/defs.bzl
@@ -14,6 +14,9 @@
 
 """Starlark rules for building C++ projects."""
 
+load("@bazel_tools//tools/cpp:cc_flags_supplier.bzl", _cc_flags_supplier = "cc_flags_supplier")
+load("@bazel_tools//tools/cpp:compiler_flag.bzl", _compiler_flag = "compiler_flag")
+
 _MIGRATION_TAG = "__CC_RULES_MIGRATION_DO_NOT_USE_WILL_BREAK__"
 
 def _add_tags(attrs):
@@ -132,3 +135,19 @@
       **attrs: Rule attributes
     """
     native.objc_import(**_add_tags(attrs))
+
+def cc_flags_supplier(**attrs):
+    """Bazel cc_flags_supplier rule.
+
+    Args:
+      **attrs: Rule attributes
+    """
+    _cc_flags_supplier(**_add_tags(attrs))
+
+def compiler_flag(**attrs):
+    """Bazel compiler_flag rule.
+
+    Args:
+      **attrs: Rule attributes
+    """
+    _compiler_flag(**_add_tags(attrs))
diff --git a/cc/find_cc_toolchain.bzl b/cc/find_cc_toolchain.bzl
index 47940a2..8964772 100644
--- a/cc/find_cc_toolchain.bzl
+++ b/cc/find_cc_toolchain.bzl
@@ -57,8 +57,8 @@
 
     # Check the incompatible flag for toolchain resolution.
     if hasattr(cc_common, "is_cc_toolchain_resolution_enabled_do_not_use") and cc_common.is_cc_toolchain_resolution_enabled_do_not_use(ctx = ctx):
-        if "//cc:toolchain_type" in ctx.toolchains:
-            return ctx.toolchains["//cc:toolchain_type"]
+        if "@rules_cc//cc:toolchain_type" in ctx.toolchains:
+            return ctx.toolchains["@rules_cc//cc:toolchain_type"]
         fail("In order to use find_cc_toolchain, you must include the '@rules_cc//cc:toolchain_type' in the toolchains argument to your rule.")
 
     # Fall back to the legacy implicit attribute lookup.
diff --git a/examples/my_c_archive/BUILD b/examples/my_c_archive/BUILD
index 164ff65..6b215bb 100644
--- a/examples/my_c_archive/BUILD
+++ b/examples/my_c_archive/BUILD
@@ -17,7 +17,7 @@
 
 load("//examples/my_c_compile:my_c_compile.bzl", "my_c_compile")
 load("//examples/my_c_archive:my_c_archive.bzl", "my_c_archive")
-load("//cc:defs.bzl", "cc_binary")
+load("@rules_cc//cc:defs.bzl", "cc_binary")
 
 cc_binary(
     name = "main",