Why is vmStructs.cpp compiled with -O0?

Erik Joelsson erik.joelsson at oracle.com
Wed Sep 12 17:25:06 UTC 2018


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:


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.


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