--- simulator/internal/BUILD.bazel
+++ simulator/internal/BUILD.bazel
@@ -4,83 +4,17 @@
     name = "internal",
     srcs = [
         "doc.go",
-        "include.c",
         "internal_cgo.go",
         "internal_cross.go",
     ],
     cgo = True,
-    clinkopts = select({
-        "@io_bazel_rules_go//go/platform:darwin": [
-            "-L/usr/local/opt/openssl/lib",
-        ],
-        "@io_bazel_rules_go//go/platform:ios": [
-            "-L/usr/local/opt/openssl/lib",
-        ],
-        "//conditions:default": [],
+    cdeps =  select({
+        "@//bazel/settings:tpm_simulator_enabled": ["//simulator/ms-tpm-20-ref:ms_tpm_20_ref"],
+        "//conditions:default": ["@//3rdparty/bazel/com_github_google_go_tpm_tools/placeholder:ms_tpm_20_ref_disabled"],
     }),
     copts = [
-        "-DALG_SHA512=ALG_YES",
-        "-DCERTIFYX509_DEBUG=NO",
-        "-DCOMPILER_CHECKS=DEBUG",
-        "-DDEBUG=YES",
-        "-DECC_NIST_P224=YES",
-        "-DECC_NIST_P521=YES",
-        "-DMAX_CONTEXT_SIZE=1360",
-        "-DRUNTIME_SIZE_CHECKS=DEBUG",
-        "-DSIMULATION=NO",
-        "-DUSE_DA_USED=NO",
-        "-DVTPM=NO -DSIMULATION=NO -DUSE_DA_USED=NO",
-        "-I simulator/ms-tpm-20-ref/Samples/Google",
-        "-I simulator/ms-tpm-20-ref/TPMCmd/tpm/include",
-        "-I simulator/ms-tpm-20-ref/TPMCmd/tpm/include/prototypes",
-        "-I simulator/ms-tpm-20-ref/TPMCmd/tpm/src",
-        "-Wno-deprecated-declarations",
-        "-Wno-missing-braces -Wno-empty-body -Wno-unused-variable -Wno-uninitialized",
-        "-std=gnu11 -Wall -Wformat-security -fPIC",
-    ] + select({
-        "@io_bazel_rules_go//go/platform:aix": [
-            "-fstack-protector-all",
-        ],
-        "@io_bazel_rules_go//go/platform:android": [
-            "-fstack-protector-all",
-        ],
-        "@io_bazel_rules_go//go/platform:darwin": [
-            "-I/usr/local/opt/openssl/include",
-            "-fstack-protector-all",
-        ],
-        "@io_bazel_rules_go//go/platform:dragonfly": [
-            "-fstack-protector-all",
-        ],
-        "@io_bazel_rules_go//go/platform:freebsd": [
-            "-fstack-protector-all",
-        ],
-        "@io_bazel_rules_go//go/platform:illumos": [
-            "-fstack-protector-all",
-        ],
-        "@io_bazel_rules_go//go/platform:ios": [
-            "-I/usr/local/opt/openssl/include",
-            "-fstack-protector-all",
-        ],
-        "@io_bazel_rules_go//go/platform:js": [
-            "-fstack-protector-all",
-        ],
-        "@io_bazel_rules_go//go/platform:linux": [
-            "-fstack-protector-all",
-        ],
-        "@io_bazel_rules_go//go/platform:netbsd": [
-            "-fstack-protector-all",
-        ],
-        "@io_bazel_rules_go//go/platform:openbsd": [
-            "-fstack-protector-all",
-        ],
-        "@io_bazel_rules_go//go/platform:plan9": [
-            "-fstack-protector-all",
-        ],
-        "@io_bazel_rules_go//go/platform:solaris": [
-            "-fstack-protector-all",
-        ],
-        "//conditions:default": [],
-    }),
+        "-fno-sanitize=all",  # relax sanitizer checks for this test-only dependency
+    ],
     importpath = "github.com/google/go-tpm-tools/simulator/internal",
     visibility = ["//simulator:__subpackages__"],
 )
