RFR: 8210703: vmStructs.cpp compiled with -O0 (was: Why is vmStructs.cpp compiled with -O0?

Severin Gehwolf sgehwolf at redhat.com
Thu Sep 13 08:43:40 UTC 2018


Hi Erik,

On Wed, 2018-09-12 at 10:25 -0700, Erik Joelsson wrote:
> Hello,
> 
> I very much doubt it was included with the new build system. We were 
> extremely careful to use the exact same flags then, and did binary 
> comparisons of all object files to verify equal builds.
> 
> Tracing back, it was caused (probably unintentionally) by this change:
> 
> http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/e796d52ca85b

Thanks for the detective work! This looks very much unintentional to me
as JDK-8114853 is about silencing a note.

> In the old build, setting OPT_CFLAGS/<file> overrides the common 
> OPT_CFLAGS. In the new build, we have a more general way of adding flags 
> for specific files that does not directly override any other flags. To 
> get the same behavior for vmStructs.cpp in the new build as in the old 
> at the time of the switch, we had to add -O0 explicitly in the new build.

I've filed JDK-8210703 and posting this patch as review for the bug.
Note I've changed the subject. Does this look OK?

diff --git a/make/hotspot/lib/JvmOverrideFiles.gmk b/make/hotspot/lib/JvmOverrideFiles.gmk
--- a/make/hotspot/lib/JvmOverrideFiles.gmk
+++ b/make/hotspot/lib/JvmOverrideFiles.gmk
@@ -30,7 +30,7 @@
 # status for individual files on specific platforms.
 
 ifeq ($(TOOLCHAIN_TYPE), gcc)
-  BUILD_LIBJVM_vmStructs.cpp_CXXFLAGS := -fno-var-tracking-assignments -O0
+  BUILD_LIBJVM_vmStructs.cpp_CXXFLAGS := -fno-var-tracking-assignments
   BUILD_LIBJVM_jvmciCompilerToVM.cpp_CXXFLAGS := -fno-var-tracking-assignments
   BUILD_LIBJVM_jvmciCompilerToVMInit.cpp_CXXFLAGS := -fno-var-tracking-assignments
   BUILD_LIBJVM_assembler_x86.cpp_CXXFLAGS := -Wno-maybe-uninitialized

Thanks,
Severin

On 2018-09-12 09:13, Severin Gehwolf wrote:
> > Hi,
> > 
> > Does anybody know why vmStructs.cpp gets an override in
> > JvmOverrideFiles.gmk:
> > 
> > $ grep -C3 -n vmStructs.cpp make/hotspot/lib/JvmOverrideFiles.gmk
> > 30-# status for individual files on specific platforms.
> > 31-
> > 32-ifeq ($(TOOLCHAIN_TYPE), gcc)
> > 33:  BUILD_LIBJVM_vmStructs.cpp_CXXFLAGS := -fno-var-tracking-assignments -O0
> > 34-  BUILD_LIBJVM_jvmciCompilerToVM.cpp_CXXFLAGS := -fno-var-tracking-assignments
> > 35-  BUILD_LIBJVM_jvmciCompilerToVMInit.cpp_CXXFLAGS := -fno-var-tracking-assignments
> > 36-  BUILD_LIBJVM_assembler_x86.cpp_CXXFLAGS := -Wno-maybe-uninitialized
> > 
> > It seems to have been introduced with the new build system. JDK 8
> > doesn't seem to have it. Thoughts?
> > 
> > Thanks,
> > Severin
> > 
> 
> 




More information about the build-dev mailing list