  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",
 +)
 +

+        "  <{}_H>0x{}</{}_H>".format(attribute_name_upper, attribute[0:16], attribute_name_upper),
+    ])
+
+def _sgx_enclave_configuration(ctx):
+    """Implementation of enclave signing configuration file formatting."""
+    xml_file = ctx.actions.declare_file(ctx.label.name + ".xml")
+
+    _validate_kss_attribute(ctx.attr.isvfamilyid, "isvfamilyid", ctx.attr.kss)
+    _validate_kss_attribute(ctx.attr.isvextprodid, "isvextprodid", ctx.attr.kss)
+
+    content = "\n".join([
+        "<EnclaveConfiguration>",
+        "  <ProdID>%s</ProdID>" % ctx.attr.prodid,
+        "  <ISVSVN>%s</ISVSVN>" % ctx.attr.isvsvn,
+        "  <StackMaxSize>%s</StackMaxSize>" % ctx.attr.stack_max_size,
+        "  <HeapMaxSize>%s</HeapMaxSize>" % ctx.attr.heap_max_size,
+        "  <TCSNum>%s</TCSNum>" % ctx.attr.tcs_num,
+        "  <TCSPolicy>%s</TCSPolicy>" % ctx.attr.tcs_policy,
+        "  <DisableDebug>%s</DisableDebug>" % ctx.attr.disable_debug,
+        "  <ProvisionKey>%s</ProvisionKey>" % ctx.attr.provision_key,
+        "  <EnableKSS>%s</EnableKSS>" % ("1" if ctx.attr.kss else "0"),
+        _kss_attribute_xml_tag(ctx.attr.isvfamilyid, "ISVFAMILYID"),
+        _kss_attribute_xml_tag(ctx.attr.isvextprodid, "ISVEXTPRODID"),
+        "  <MiscSelect>%s</MiscSelect>" % ctx.attr.misc_select,
+        "  <MiscMask>%s</MiscMask>" % ctx.attr.misc_mask,
+        "</EnclaveConfiguration>\n\n",
+    ])
+
+    # Strip any empty lines created by optional attributes that do not have

+    )
+
+    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
+    )
