RFR: 8236714: enable link-time section-gc for linux to remove unused code

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Fri Jan 17 09:31:06 UTC 2020


On 2020-01-16 10:30, David Holmes wrote:
> Hi Matthias,
>
> On 16/01/2020 6:10 pm, Baesken, Matthias wrote:
>> Hi David, sure we can introduce a way to switch this on/off.
>
> Thanks.
>
>> There is already something similar for the link-time optimization 
>> (flto) , see the feature
>>
>> JvmFeatures.gmk
>> 180 ifeq ($(call check-jvm-feature, link-time-opt), true)
>> 190 ifeq ($(call check-jvm-feature, link-time-opt), false)
>>
>> hotspot.m4
>> 29 static-build link-time-opt aot jfr"
>> 502 JVM_FEATURES_link_time_opt="link-time-opt"
>
> Yep familiar with that from Minimal VM and SE Embedded days :)
>
>> Should we have  "link-time-gc" additionally to   " link-time-opt"  
>> ?   (however it  would  be a  bit misleading   that it is a "JVM" 
>> feature , but except linux s390x  it is only changing the build of 
>> the JDK libs) .
>
> I agree the definition of this as a "JVM" feature is a bit 
> odd/misleading. Perhaps the build folk have a suggestion on how to 
> refactor this kind of option into something more general? In the 
> meantime having link-time-gc sit alongside link-time-opt seems 
> acceptable to me.

We don't have the concept of "JDK features", akin to "JVM features". 
Maybe we should have. It's an idea worth exploring, anyway.

The way we currently do on/off features for the entire JDK is by using 
autoconf options. So, in this case, --enable-link-time-gc, or something 
like that. It might just as well be on by default, which gives us a 
--disable-link-time-gc instead. (I understand David's reservation not 
about this being the default, just that it is not possible to simply 
turn off.)

Matthias: Have a look at some recently added option to get an indication 
of the best practice in adding new options. There are some ways to 
easily make this incorrect, and our code is full of old examples that 
does this unnecessary complex, or downright wrong. (These should be 
fixed, and we should probably introduce a simpler API for doing this, 
and so on... I'll address those as soon as time permits.)

/Magnus


>
> Thanks,
> David
>
>> Best regards, Matthias
>>
>>
>>
>>>
>>> Hi Matthias,
>>>
>>> I have reservations about turning this on by default and with no way to
>>> control it. This seems like it should be something you have to 
>>> opt-in to
>>> initially while we gain some experience with it and ensure there are no
>>> unexpected side-effects. After that it could be enabled by default.
>>>
>>




More information about the build-dev mailing list