 +
 +    # Append enclave specific arguments.
 +    kwargs["copts"] = kwargs.get("copts", []) + ["-fstack-protector"]
-+
-+    lds_label = "@linux_sgx//:enclave_sim.lds"
 +    kwargs["features"] = kwargs.get("features", []) + [
 +        "fully_static_link",
 +    ]

+}  // namespace linux_sgx
+
+#endif  // _DEBUG_KEY_MRSIGNER_H_
diff -Nur /dev/null enclave_sim.lds
--- /dev/null
+++ enclave_sim.lds
@@ -0,0 +1,9 @@
+enclave.so
+{
+    global:
+        enclave_entry;
+        g_global_data;
+        g_global_data_sim;
+    local:
+        *;
+};

+        "-Wl,-pie,-eenclave_entry",
+        "-Wl,--defsym,__ImageBase=0",
+        "-Wl,--export-dynamic",
+    ]
+    kwargs["linkshared"] = 1
+    kwargs["linkstatic"] = 1
+
+    kwargs["tags"] = kwargs.get("tags", []) + sgx_tags()
+    kwargs["deps"] = kwargs.get("deps", []) + [
+        "@linux_sgx//:enclave_lds",
+    ]
+
+    # Create rule to build unsigned enclave.
