diff --git a/java-17-openj9.spec b/java-17-openj9.spec index be2992d..bdfdf4f 100644 --- a/java-17-openj9.spec +++ b/java-17-openj9.spec @@ -121,6 +121,8 @@ Patch20: loadAssistiveTechnologies.patch # Patch31: aarch64.patch # +Patch32: stringop-overflow.patch +# # OpenJDK specific patches # Patch302: disable-doclint-by-default.patch @@ -373,6 +375,7 @@ rm -rvf src/java.desktop/share/native/liblcms/lcms2* %patch20 -p1 %patch31 -p1 +%patch32 -p1 %patch302 -p1 %patch303 -p1 @@ -396,8 +399,8 @@ done %build export ARCH_DATA_MODEL=64 -EXTRA_CFLAGS="-Wno-error -Wno-stringop-overflow -Wno-error=stringop-overflow -Wno-maybe-uninitialized -fno-delete-null-pointer-checks -fno-lifetime-dse" -EXTRA_CPP_FLAGS="-Wno-error -Wno-stringop-overflow -Wno-error=stringop-overflow -Wno-maybe-uninitialized -std=gnu++98 -fno-delete-null-pointer-checks -fno-lifetime-dse" +EXTRA_CFLAGS="-Wno-error -Wno-maybe-uninitialized -fno-delete-null-pointer-checks -fno-lifetime-dse" +EXTRA_CPP_FLAGS="-Wno-error -Wno-maybe-uninitialized -std=gnu++98 -fno-delete-null-pointer-checks -fno-lifetime-dse" %ifarch ppc64le EXTRA_CFLAGS="$EXTRA_CFLAGS -fno-strict-aliasing" diff --git a/stringop-overflow.patch b/stringop-overflow.patch new file mode 100644 index 0000000..3f0a6a3 --- /dev/null +++ b/stringop-overflow.patch @@ -0,0 +1,20 @@ +diff -urEbwB openj9-openjdk-jdk17.orig/omr/compiler/optimizer/OMRSimplifierHandlers.cpp openj9-openjdk-jdk17/omr/compiler/optimizer/OMRSimplifierHandlers.cpp +--- openj9-openjdk-jdk17.orig/omr/compiler/optimizer/OMRSimplifierHandlers.cpp 2023-03-28 09:18:57.979474249 +0200 ++++ openj9-openjdk-jdk17/omr/compiler/optimizer/OMRSimplifierHandlers.cpp 2023-03-28 09:49:47.316000333 +0200 +@@ -22,6 +22,9 @@ + #ifndef OMR_SIMPLIFIERHANDLERS_INCL + #define OMR_SIMPLIFIERHANDLERS_INCL + ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wstringop-overflow" ++ + #include "optimizer/OMRSimplifierHelpers.hpp" + #include "optimizer/OMRSimplifierHandlers.hpp" + +@@ -17404,5 +17407,6 @@ + return node; + } + ++#pragma GCC diagnostic pop + + #endif