pw_fuzzer: Clean up build files

Cleans up build files related to fuzzers.

1. Sanitizers (address, memory, undefined, coverage) configs in
   the "pw_fuzzer" template are no longer necessary as they are
   already applied to the toolchain as defaults. These
   instrumentations apply to both the fuzzer target and its
   dependencies (which is what we want for deep fuzzing).

2. Removes "oss_fuzz_added_configs" and "oss_fuzz_removed_configs"
   as they are unused and breaking OSS-FUZZ integration.

Test: pw_fuzzer/examples/build_and_run_toy_fuzzer.sh

Change-Id: I50e70a1b91cf4d5df2d7b385c6ffec53d3416231
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/30861
Reviewed-by: Aaron Green <aarongreen@google.com>
Commit-Queue: Ali Zhang <alizhang@google.com>
Pigweed-Auto-Submit: Ali Zhang <alizhang@google.com>
diff --git a/pw_fuzzer/BUILD.gn b/pw_fuzzer/BUILD.gn
index 264033b..e97d084 100644
--- a/pw_fuzzer/BUILD.gn
+++ b/pw_fuzzer/BUILD.gn
@@ -30,29 +30,6 @@
   ldflags = common_flags
 }
 
-config("sanitize_address") {
-  cflags = [ "-fsanitize=address" ]
-  ldflags = cflags
-}
-
-config("sanitize_memory") {
-  cflags = [ "-fsanitize=memory" ]
-  ldflags = cflags
-}
-
-config("sanitize_undefined") {
-  cflags = [ "-fsanitize=undefined" ]
-  ldflags = cflags
-}
-
-config("sanitize_coverage") {
-  cflags = [
-    "-fprofile-instr-generate",
-    "-fcoverage-mapping",
-  ]
-  ldflags = cflags
-}
-
 # OSS-Fuzz needs to be able to specify its own compilers and add flags.
 config("oss_fuzz") {
   # OSS-Fuzz doesn't always link with -fsanitize=fuzzer, sometimes it uses
diff --git a/pw_fuzzer/fuzzer.gni b/pw_fuzzer/fuzzer.gni
index 777c896..eeb1b5c 100644
--- a/pw_fuzzer/fuzzer.gni
+++ b/pw_fuzzer/fuzzer.gni
@@ -48,10 +48,7 @@
       if (!defined(configs)) {
         configs = []
       }
-      configs += [
-        "$dir_pw_fuzzer:default_config",
-        "$dir_pw_fuzzer:sanitize_${pw_toolchain_SANITIZER}",
-      ]
+      configs += [ "$dir_pw_fuzzer:default_config" ]
       if (pw_toolchain_OSS_FUZZ_ENABLED) {
         configs += [ "$dir_pw_fuzzer:oss_fuzz" ]
       } else {
diff --git a/pw_fuzzer/oss_fuzz.gni b/pw_fuzzer/oss_fuzz.gni
index ffef017..3a21438 100644
--- a/pw_fuzzer/oss_fuzz.gni
+++ b/pw_fuzzer/oss_fuzz.gni
@@ -14,8 +14,6 @@
 
 # TODO(aarongreen): Do some minimal parsing on the environment variables to
 # identify conflicting configs.
-oss_fuzz_added_configs = []
-oss_fuzz_removed_configs = []
 oss_fuzz_extra_cflags_c = string_split(getenv("CFLAGS"))
 oss_fuzz_extra_cflags_cc = string_split(getenv("CXXFLAGS"))
 oss_fuzz_extra_ldflags = string_split(getenv("LDFLAGS"))
diff --git a/pw_toolchain/host_clang/BUILD.gn b/pw_toolchain/host_clang/BUILD.gn
index 4e4ddb7..fe30ba4 100644
--- a/pw_toolchain/host_clang/BUILD.gn
+++ b/pw_toolchain/host_clang/BUILD.gn
@@ -30,6 +30,14 @@
   ldflags = cflags
 }
 
+config("sanitize_coverage") {
+  cflags = [
+    "-fprofile-instr-generate",
+    "-fcoverage-mapping",
+  ]
+  ldflags = cflags
+}
+
 # Locate XCode's sysroot for Clang.
 config("xcode_sysroot") {
   if (current_os == "mac") {
diff --git a/pw_toolchain/host_clang/toolchains.gni b/pw_toolchain/host_clang/toolchains.gni
index 9b4fbe6..71fc7b0 100644
--- a/pw_toolchain/host_clang/toolchains.gni
+++ b/pw_toolchain/host_clang/toolchains.gni
@@ -52,13 +52,7 @@
         [ "$dir_pw_toolchain/host_clang:sanitize_$pw_toolchain_SANITIZER" ]
   }
   if (pw_toolchain_OSS_FUZZ_ENABLED) {
-    default_configs += oss_fuzz_added_configs
     default_configs += [ "$dir_pw_fuzzer:oss_fuzz_extra" ]
-
-    # Add the configs to be removed. They will be de-duplicated, and this
-    # ensures they are present to be removed.
-    default_configs += oss_fuzz_removed_configs
-    remove_default_configs = oss_fuzz_removed_configs
   }
 }