third_party/pico_sdk: Selectively disable elf2uf2 warnings

As a quick fix, the strict_warnings flag was removed from the elf2uf2
tool to get it to build on Windows. This change reverts that, and
instead selectively disables the appropriate warnings to allow the tool
to build on Windows with gcc.

Bug: b/300474559
Change-Id: I93277be814edfff43ff9156a90fcde7442c62f62
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/171072
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Reviewed-by: Anthony DiGirolamo <tonymd@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/third_party/pico_sdk/gn/BUILD.gn b/third_party/pico_sdk/gn/BUILD.gn
index 8234f01..eba2bc7 100644
--- a/third_party/pico_sdk/gn/BUILD.gn
+++ b/third_party/pico_sdk/gn/BUILD.gn
@@ -12,6 +12,8 @@
 # License for the specific language governing permissions and limitations under
 # the License.
 
+import("//build_overrides/pi_pico.gni")
+
 # These warnings need to be disabled when using strict warnings.
 config("disable_warnings") {
   cflags = [
@@ -21,3 +23,12 @@
   ]
   asmflags = cflags
 }
+
+config("disable_elf2uf2_warnings") {
+  cflags = [
+    "-Wno-shadow",
+    "-Wno-reorder",
+    "-Wno-type-limits",
+  ]
+  visibility = [ "${PICO_ROOT}/src:elf2uf2" ]
+}
diff --git a/third_party/pico_sdk/src/BUILD.gn b/third_party/pico_sdk/src/BUILD.gn
index e79a85f..059d3a4 100644
--- a/third_party/pico_sdk/src/BUILD.gn
+++ b/third_party/pico_sdk/src/BUILD.gn
@@ -39,11 +39,8 @@
 pw_executable("elf2uf2") {
   configs = [
     ":elf2uf2_configs",
+    "${PICO_ROOT}/gn:disable_elf2uf2_warnings",
     "${PICO_ROOT}/gn:disable_warnings",
   ]
   sources = [ "$PICO_SRC_DIR/tools/elf2uf2/main.cpp" ]
-
-  if (host_os == "win") {
-    remove_configs = [ "$dir_pw_build:strict_warnings" ]
-  }
 }