On Tue, Jun 7, 2016 at 3:37 PM, Erik Joelsson <erik.joels...@oracle.com> wrote:
> 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

Great, that's exactly what I was looking for!

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

I'm preparing a fix for various problems with the new hotspot build on
AIX, so I'd like to leave the general fix for another change.
Especially when I see that all current 'overrides' in
JvmOverrideFiles.gmk are using _CXXFLAGS when probably most of them
should use _OPTIMIZATION. And I think the valid values for
OPTIMIZATION should be synchronized with the corresponding option
names (currently LOW is mapped to CXX_O_FLAG_NORM and HIGH to
CXX_O_FLAG_HI without any good reason).

Thank you and best regards,
Volker

>
> 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
>
>

Reply via email to