Optimization flags in new HotSpot build
Erik Joelsson
erik.joelsson at oracle.com
Mon Aug 10 09:53:11 UTC 2015
Hello Volker,
On 2015-07-06 10:56, Volker Simonis wrote:
> Hi,
>
> I've just realized that the new hotspot build doesn't really handle
> different levels of optimization flags correctly.
That's correct, it has not yet been addressed. Note that the whole flags
handling in the new hotspot build is still just very rudimentary,
basically just copy pasting from command lines and bunching them
together. Part of the next step of the makefile conversion is to derive
each flag correctly based on configuration options.
> 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.
Yes, that was good enough to get the correct bits built on the platforms
we did so far, but certainly isn't the desired final solution.
> Are there any plans to separate the optimization flags from the
> general JVM_CFLAGS_OPTIONS in the new build?
Yes, definitely. Ideally we would like use the same OPT flags as we use
in the jdk build, which are setup by configure. If that doesn't fit well
enough, we need to define some hotspot specific versions of these opt
flags.
>
> 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?
Most likely yes.
/Erik
More information about the build-infra-dev
mailing list