How is the override mechanism in JvmOverrideFiles.gmk supposed to work?

Erik Joelsson erik.joelsson at oracle.com
Tue Jun 7 13:37:11 UTC 2016


Hello Volker,

On 2016-06-07 15:10, Volker Simonis wrote:
> Hi,
>
> I've just realized the the override mechanism from
> JvmOverrideFiles.gmk isn't really 'overriding' options but just
> 'appending' new ones.
>
> So for example:
>
> BUILD_LIBJVM_sharedRuntimeTrig.cpp_CXXFLAGS := -DNO_PCH $(CXX_O_FLAG_NONE)
That's a bad use of *_<file>_CXXFLAGS. The optimization level can be 
specifically overridden on a per file bases using the same notation (or 
at least something similar too):

BUILD_LIBJVM_sharedRuntimeTrig.cpp_OPTIMIZATION := NONE

In that case it is a proper override and not just append. Feel free to 
fix this.

For flags in general, I don't see how we could do anything else but just 
append.

/Erik
> will not replace the CXXFLAGS flags for sharedRuntimeTrig.cpp but only
> append the new ones.
>
> The command line will look like this:
>
> .. -O3 -DNO_PCH -O0 ..
>
> Is this the way it is supposed to work?
>
> I think that's a little problematic because if CXX_O_FLAG_NONE is
> empty (which seems plausible for "doing no optimizations", the
> override mechanism will actually do nothing at all.
>
> Even worse, on AIX we have  CXX_O_FLAG_HIGHEST_JVM="-O3 -qhot=level=1
> -qinline -qinlglue" and CXX_O_FLAG_NORM="-O2". So even if "-O2"
> overrides "-O3", we still have "-qhot=level=1 -qinline -qinlglue" in
> place.
>
> Do we actually have to negate every possible option in
> JvmOverrideFiles.gmk if we want to be sure to have correct results.
> This makes it impossible to use shortcuts like CXX_O_FLAG_NORM in an
> override.
>
> Regards,
> Volker




More information about the build-dev mailing list