building libjvm with -Os for space optimization - was : RE: RFR: 8234525: enable link-time section-gc for linux s390x to remove unused code

Baesken, Matthias matthias.baesken at
Wed Nov 27 16:36:38 UTC 2019

Hello Martin,  I checked  building  with -Os  (instead of -O3) .

I used gcc-7  on linux x86_64 .
The size  of   dropped   from    24M  (normal night make with -O3)  to   18M   ( test make with -Os)   .
 (adding the link-time gc might  reduce the size by another ~ 10 % ,  but those 2 builds were without the ltgc )

Cannot say much so far about performance impact .

Best regards, Matthias

> Hi Matthias and Erik,
> I also think this is an interesting option.
> I like the idea to generate smaller libraries. In addition to that, I could also
> imagine building with -Os (size optimized) by default and only select -O3 for
> performance critical files (e.g. C2's register allocation, some gc code, ...).
> If we want to go into such a direction for all linux platforms and want to use
> this s390 only change as some kind of pipe cleaner, I think this change is fine
> and can get pushed.
> Otherwise, I think building s390 differently and not intending to do the same
> for other linux platforms would be not so good.
> We should only make sure the exported symbols are set up properly to avoid
> that this optimization throws out too much.
> My 50 Cents.
> Best regards,
> Martin

More information about the hotspot-dev mailing list