  bool is_valid_sp(uintptr_t sp);
 --- /dev/null
 +++ BUILD
-@@ -0,0 +1,1321 @@
+@@ -0,0 +1,1336 @@
 +# linux-sgx is the Intel SGX SDK
 +
 +load(
 +    ":sgx_sdk.bzl",
 +    "sgx_enclave",
++    "sgx_full_enclave_configuration",
 +    "sgx_enclave_configuration",
 +)
 +

+
+    ctx.actions.write(
+        output = xml_file,
+        content = "\n".join(content),
+    )
+    return [DefaultInfo(files = depset([xml_file])), SGXEnclaveConfigInfo()]
+
+sgx_enclave_configuration = rule(
+    implementation = _sgx_enclave_configuration,
+    output_to_genfiles = True,
+    attrs = {
+        # "1" for release enclaves.
+        "disable_debug": attr.string(
+            default = "0",
+            doc = ("Indicates whether launching the enclave in debug mode is " +
+                   "disabled"),
+        ),
+        "heap_max_size": attr.string(
+            default = "0x2000000",
+            doc = "The enclave's maximum heap size in bytes (4KB aligned)",
+        ),
+        "isvsvn": attr.string(
+            default = "0",
+            doc = ("The enclave's ISV (Independent Software Vendor) assigned " +
+                   "Security Version Number"),
+        ),
+        "misc_mask": attr.string(
+            default = "0xffffffff",
+            doc = "A mask indicating which bits in misc_select are enforced",
+        ),
+        "misc_select": attr.string(
+            default = "0",
+            doc = "The desired Extended SSA frame feature (must be 0)",
+        ),
+        "prodid": attr.string(
+            default = "0",
+            doc = ("The enclave's ISV (Independent Software Vendor) assigned " +
+                   "Product ID"),
+        ),
+        "provision_key": attr.string(
+            default = "0",
+            doc = ("Indicates whether the enclave has access to the " +
+                   "Provisioning Key and the Provisioning Seal Key"),
+        ),
+        "kss": attr.bool(
+            default = False,
+            doc = ("Indicates whether the enclave can use Key Sharing and " +
+                   "Separation (KSS)"),
+        ),
+        "isvextprodid": attr.string(
+            default = "",
+            doc = ("The enclave's 16-byte extended ISVPRODID value. It is an " +
+                   "error to set this attribute if 'kss' is set to False"),
+        ),
+        "isvfamilyid": attr.string(
+            default = "",
+            doc = ("The enclave's 16-byte extended ISV Family ID. It is an " +
+                   "error to set this attribute if 'kss' is set to False"),
+        ),
+        "stack_max_size": attr.string(
+            default = "0x40000",
+            doc = "The enclave's maximum stack size in bytes (4KB aligned)",
+        ),
+        # 2 tcs are reserved by the framework, 10 are left for users.
+        "tcs_num": attr.string(
+            default = "12",
+            doc = ("The number of Thread Control Structures allocated for " +
+                   "the enclave"),
+        ),
+        "tcs_policy": attr.string(
+            default = "0",
+            doc = ("The TCS management policy (" +
+                   "0 - The TCS is bound to the untrusted thread, " +
+                   "1 - The TCS is unbound to the untrusted thread)"),
+        ),
+    },
+)
+
+def _sgx_debug_sign_enclave_impl(ctx):
+    """Implementation of an automated signing process of an unsigned enclave."""

+    )
+
+    kwargs = {k: v for k, v in kwargs.items() if k in ["visibility"]}
+    if config:
+        kwargs["config"] = config
+    _sgx_debug_sign_enclave(
+        name = name,
+        unsigned = unsigned_name,
+        tags = sgx_tags(),
+        testonly = testonly,
+        **kwargs
+    )
