jdk10 build : usage of -fno-var-tracking-assignments g++ flag in hotspot build
Baesken, Matthias
matthias.baesken at sap.com
Thu Jul 13 09:21:12 UTC 2017
Hello, when building jdk10 on Suse Linux 11 with default gcc/g++ 4.3.4 installed, I was running into
compilation errors because of the missing support for g++ flag -fno-var-tracking-assignments .
It seems gcc-4.6 has the -fvar-tracking-assignments / -fnovar-tracking-assignments flags , see
https://gcc.gnu.org/onlinedocs/gcc-4.6.4/gcc/Option-Summary.html#Option-Summary
I have no gcc-4.6 at hand but could verify that gcc-4.7 and gcc-4.8 "know" the flag.
There are various solutions one could do to avoid the compilation error .
1) disallow usage of old gcc versions here :
autoconf/toolchain.m4
TOOLCHAIN_MINIMUM_VERSION_gcc="4.3"
( e.g. change to minimum gcc 4.6 or gcc 4.7 supporting the flags used in the build )
2) remove the flag -fno-var-tracking-assignments for older gcc versions here :
(in a similar way it was done : http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/37e693211deb )
hotspot/make/lib/JvmOverrideFiles.gmk-32-ifeq ($(TOOLCHAIN_TYPE), gcc)
hotspot/make/lib/JvmOverrideFiles.gmk:33: BUILD_LIBJVM_vmStructs.cpp_CXXFLAGS := -fno-var-tracking-assignments -O0
hotspot/make/lib/JvmOverrideFiles.gmk:34: BUILD_LIBJVM_jvmciCompilerToVM.cpp_CXXFLAGS := -fno-var-tracking-assignments
hotspot/make/lib/JvmOverrideFiles.gmk-35-endif
What is your preferred solution ?
Thanks, Matthias
More information about the build-dev
mailing list