--- jdk23u-jdk-23.0.1-ga/make/autoconf/flags-cflags.m4.orig
+++ jdk23u-jdk-23.0.1-ga/make/autoconf/flags-cflags.m4
@@ -541,8 +541,8 @@
   fi
 
   if test "x$TOOLCHAIN_TYPE" = xgcc; then
-    TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM -fstack-protector"
-    TOOLCHAIN_CFLAGS_JDK="-fvisibility=hidden -pipe -fstack-protector"
+    TOOLCHAIN_CFLAGS_JVM="$TOOLCHAIN_CFLAGS_JVM"
+    TOOLCHAIN_CFLAGS_JDK="-fvisibility=hidden -pipe"
     # reduce lib size on linux in link step, this needs also special compile flags
     # do this on s390x also for libjvm (where serviceability agent is not supported)
     if test "x$ENABLE_LINKTIME_GC" = xtrue; then
@@ -588,7 +588,12 @@
 
   # CFLAGS C language level for JDK sources (hotspot only uses C++)
   if test "x$TOOLCHAIN_TYPE" = xgcc || test "x$TOOLCHAIN_TYPE" = xclang; then
-    LANGSTD_CFLAGS="-std=c11"
+    if test "x$OPENJDK_TARGET_OS" = xsolaris; then
+      # illumos headers are confused by c11
+      LANGSTD_CFLAGS="-std=gnu11"
+    else
+      LANGSTD_CFLAGS="-std=c11"
+    fi
   elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
     LANGSTD_CFLAGS="-std:c11"
   fi