Optimization flags in new HotSpot build
Volker Simonis
volker.simonis at gmail.com
Mon Jul 6 08:56:25 UTC 2015
Hi,
I've just realized that the new hotspot build doesn't really handle
different levels of optimization flags correctly.
In the old build we had various levels of OPT_CFLAGS:
OPT_CFLAGS/NOOPT=-O0
OPT_CFLAGS/DEBUG=-O0
OPT_CFLAGS/SIZE=-Os
OPT_CFLAGS/SPEED=-O3
and we could also override the general optimization level on a
per-file base as follows:
OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT)
In the new build system we still have the overriding mechanism but it
doesn't really work (or it only works by chance) because all the
optimization flags are part of JVM_CFLAGS_OPTIONS which are always
used for every file. For gcc an override like
BUILD_LIBJVM_sharedRuntimeTrans.cpp_CXXFLAGS := $(CXX_O_FLAG_NONE)
works because it ends up in a compiler command line like ".. -O3 ..
-O0.." and the later option will win. On AIX we have various different
optimization flags and can not easily disable them simply by appending
other options to the command line.
Are there any plans to separate the optimization flags from the
general JVM_CFLAGS_OPTIONS in the new build?
Also notice that there are reference to OPT_CFLAGS in Common.gmk in
the new build altough I can't find any definition of OPT_CFLAGS so I
suppose this is a "copy and paste" leftover?
Regards,
Volker
More information about the build-infra-dev
mailing list