--- configure.orig	2026-06-25 01:31:34 UTC
+++ configure
@@ -4323,9 +4323,10 @@ printf "%s\n" "$as_me: LIBS note: LIBS should only be 
       -I*)
         xc_bad_var_ldflags=yes
         ;;
-      -l* | --library=*)
-        xc_bad_var_ldflags=yes
-        ;;
+# Temporarily disable -l* flag check for SSP support (Mk/bsd.ssp.mk)
+#      -l* | --library=*)
+#        xc_bad_var_ldflags=yes
+#        ;;
     esac
   done
   if test "$xc_bad_var_ldflags" = "yes"; then
@@ -4395,9 +4396,10 @@ printf "%s\n" "$as_me: $xc_bad_var_msg libraries. Use 
   xc_bad_var_cflags=no
   for xc_word in $CFLAGS; do
     case "$xc_word" in
-      -D*)
-        xc_bad_var_cflags=yes
-        ;;
+# Temporarily disable -D* flag check (PR/177401, PR/180944)
+#      -D*)
+#        xc_bad_var_cflags=yes
+#        ;;
       -U*)
         xc_bad_var_cflags=yes
         ;;
@@ -15736,13 +15738,13 @@ freebsd* | dragonfly* | midnightbsd*)
   fi
   version_type=freebsd-$objformat
   case $version_type in
-    freebsd-elf*)
+    freebsd-elf*|midnightbsd-elf*)
       library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
       soname_spec='$libname$release$shared_ext$major'
       need_version=no
       need_lib_prefix=no
       ;;
-    freebsd-*)
+    freebsd-*|midnightbsd-*)
       library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
       need_version=yes
       ;;
@@ -16899,7 +16901,7 @@ printf "%s\n" "yes" >&6; }
       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 printf "%s\n" "yes" >&6; }
       ;;
-    freebsd*)
+    freebsd*|midnightbsd*)
       if $STRIP -V 2>&1 | $GREP "elftoolchain" >/dev/null; then
         old_striplib="$STRIP --strip-debug"
         striplib="$STRIP --strip-unneeded"
@@ -17484,7 +17486,7 @@ printf "%s\n" "$as_me: WARNING: failed to figure out c
   flags_dbg_yes="unknown"
   flags_opt_all="unknown"
   flags_opt_yes="unknown"
-  flags_opt_off="unknown"
+  flags_opt_off=""
 
   flags_prefer_cppflags="no"
 
@@ -17734,7 +17736,7 @@ printf "%s\n" "yes" >&6; }
     flags_opt_all="$flags_opt_all -qoptimize=4"
     flags_opt_all="$flags_opt_all -qoptimize=5"
     flags_opt_yes="-O2"
-    flags_opt_off="-qnooptimize"
+    flags_opt_off=""
     flags_prefer_cppflags="yes"
   else
     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
@@ -18401,7 +18403,7 @@ printf "%s\n" "yes" >&6; }
     flags_dbg_yes="-g"
     flags_opt_all="-O -O0 -O1 -O2 -O3 -Ofast"
     flags_opt_yes="-O2"
-    flags_opt_off="-O0"
+    flags_opt_off=""
   else
     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
 printf "%s\n" "no" >&6; }
@@ -19224,6 +19226,7 @@ printf "%s\n" "$honor_optimize_option" >&6; }
     if test "$honor_optimize_option" = "yes"; then
 
 
+if false; then
   ac_var_stripped=""
   for word1 in $tmp_CFLAGS; do
     ac_var_strip_word="no"
@@ -19255,6 +19258,7 @@ printf "%s\n" "$honor_optimize_option" >&6; }
   done
     tmp_CPPFLAGS="$ac_var_stripped"
   squeeze tmp_CPPFLAGS
+fi
 
       if test "$want_optimize" = "yes"; then
         { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if compiler accepts optimizer enabling options" >&5
@@ -49940,9 +49944,10 @@ printf "%s\n" "$as_me: LIBS note: LIBS should only be 
       -I*)
         xc_bad_var_ldflags=yes
         ;;
-      -l* | --library=*)
-        xc_bad_var_ldflags=yes
-        ;;
+# Temporarily disable -l* flag check for SSP support (Mk/bsd.ssp.mk)
+#      -l* | --library=*)
+#        xc_bad_var_ldflags=yes
+#        ;;
     esac
   done
   if test "$xc_bad_var_ldflags" = "yes"; then
@@ -50012,9 +50017,10 @@ printf "%s\n" "$as_me: $xc_bad_var_msg libraries. Use 
   xc_bad_var_cflags=no
   for xc_word in $CFLAGS; do
     case "$xc_word" in
-      -D*)
-        xc_bad_var_cflags=yes
-        ;;
+# Temporarily disable -D* flag check (PR/177401, PR/180944)
+#      -D*)
+#        xc_bad_var_cflags=yes
+#        ;;
       -U*)
         xc_bad_var_cflags=yes
         ;;
