RFR: 8315794: RISC-V: build fails with GCC 12.3 [v2]

Stefan Karlsson stefank at openjdk.org
Thu Sep 21 12:36:47 UTC 2023


On Tue, 19 Sep 2023 14:14:35 GMT, Antonios Printezis <tonyp at openjdk.org> wrote:

>> The build failure happens when building on RISC-V with GCC 12.3. Is there a better way to address this than disabling the stringop-overflow warnings for the two files in question?
>
> Antonios Printezis has updated the pull request incrementally with one additional commit since the last revision:
> 
>   changes based on code review feedback

I find it a bit unfortunate if we have to add this to the ZGC code. Could we instead handle this by turning off the warning in these files when you compile with gcc + riscv? Maybe something like this:

diff --git a/make/common/NativeCompilation.gmk b/make/common/NativeCompilation.gmk
index 6056f4632a5..b0d3c158ffe 100644
--- a/make/common/NativeCompilation.gmk
+++ b/make/common/NativeCompilation.gmk
@@ -363,7 +363,8 @@ define SetupCompileNativeFileBody
     ifneq ($(DISABLE_WARNING_PREFIX), )
       $1_WARNINGS_FLAGS := $$(addprefix $(DISABLE_WARNING_PREFIX), \
         $$($$($1_BASE)_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)_$$($1_FILENAME)) \
-        $$($$($1_BASE)_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS)_$$($1_FILENAME)))
+        $$($$($1_BASE)_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS)_$$($1_FILENAME)) \
+        $$($$($1_BASE)_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)_$(OPENJDK_TARGET_OS)_$(OPENJDK_TARGET_CPU)_$$($1_FILENAME)) )
     endif
 
     $1_BASE_CFLAGS :=  $$($$($1_BASE)_CFLAGS) $$($$($1_BASE)_EXTRA_CFLAGS) \
diff --git a/make/hotspot/lib/CompileJvm.gmk b/make/hotspot/lib/CompileJvm.gmk
index 0123829afee..9ef82905dbb 100644
--- a/make/hotspot/lib/CompileJvm.gmk
+++ b/make/hotspot/lib/CompileJvm.gmk
@@ -166,6 +166,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
     DISABLED_WARNINGS_gcc_cgroupV2Subsystem_linux.cpp := address, \
     DISABLED_WARNINGS_gcc_interp_masm_x86.cpp := uninitialized, \
     DISABLED_WARNINGS_gcc_postaloc.cpp := address, \
+    DISABLED_WARNINGS_gcc_linux_riscv64_xPageAllocator.cpp := stringop-overflow, \
+    DISABLED_WARNINGS_gcc_linux_riscv64_zPageAllocator.cpp := stringop-overflow, \
     DISABLED_WARNINGS_clang := $(DISABLED_WARNINGS_clang), \
     DISABLED_WARNINGS_clang_arguments.cpp := missing-field-initializers, \
     DISABLED_WARNINGS_clang_codeBuffer.cpp := tautological-undefined-compare, \

-------------

Changes requested by stefank (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15593#pullrequestreview-1637708698


More information about the hotspot-gc-dev mailing list