 +
 +/* Define if using gcc and it supports RDRAND */
 +#define HAVE_RDRAND_IN_GCC 1
-diff -Nur external/tinyxml2/tinyxml2.cpp external/tinyxml2/tinyxml2.cpp
---- external/tinyxml2/tinyxml2.cpp
-+++ external/tinyxml2/tinyxml2.cpp
-@@ -433,16 +433,19 @@
-             *output = (char)((input | BYTE_MARK) & BYTE_MASK);
-             input >>= 6;
-             //fall through
-+            [[clang::fallthrough]];
-         case 3:
-             --output;
-             *output = (char)((input | BYTE_MARK) & BYTE_MASK);
-             input >>= 6;
-             //fall through
-+            [[clang::fallthrough]];
-         case 2:
-             --output;
-             *output = (char)((input | BYTE_MARK) & BYTE_MASK);
-             input >>= 6;
-             //fall through
-+            [[clang::fallthrough]];
-         case 1:
-             --output;
-             *output = (char)(input | FIRST_BYTE_MARK[*length]);
 diff -Nur psw/ae/aesm_service/source/bundles/ecdsa_quote_service_bundle/ecdsa_quote_service_bundle.cpp psw/ae/aesm_service/source/bundles/ecdsa_quote_service_bundle/ecdsa_quote_service_bundle.cpp
 --- psw/ae/aesm_service/source/bundles/ecdsa_quote_service_bundle/ecdsa_quote_service_bundle.cpp
 +++ psw/ae/aesm_service/source/bundles/ecdsa_quote_service_bundle/ecdsa_quote_service_bundle.cpp

+        "-Iexternal/linux_sgx/sdk/sign_tool/SignTool",
+        "-Iexternal/linux_sgx/common/inc/internal/linux",
+        "-Iexternal/boringssl",
+        "-DSE_DEBUG_LEVEL=SE_TRACE_DEBUG",
+    ],
+    visibility = ["//visibility:public"],
+    deps = [
+        ":common_inc",
+        ":common_inc_internal",
+        ":untrusted_inc_internal",
+        ":urts_select",
+        "@boringssl//:crypto",

+    ],
+)
+
+cc_library(
+    name = "external_tinyxml2",
+    srcs = ["external/tinyxml2/tinyxml2.cpp"],
+    hdrs = ["external/tinyxml2/tinyxml2.h"],
+    copts = [
+        "-Wno-implicit-fallthrough",
+        "-Iexternal/linux_sgx/external/tinyxml2",
+    ],
+)
+
+cc_binary(
+    name = "sgx_sign_tool",
+    srcs = [
+        "sdk/sign_tool/SignTool/elf_helper.h",
+        "sdk/sign_tool/SignTool/enclave_creator_sign.cpp",
+        "sdk/sign_tool/SignTool/enclave_creator_sign.h",
