Hello,

I understand your problem, but I'm really not sure I like this solution. What I mostly question is your desire for adding optimization to the libraries nobody has bothered adding optimizations on by default since forever. If this is important to you, then provide a patch adding opt flags to the specific libraries. In general, the OpenJDK build is very conscious about what optimization levels are used wherever it matters, so tinkering with them is likely not a good idea.

That said, I think a better fix would be to reorder the arguments so that the OPT flags are added after any extra flags variable.

/Erik


On 2018-09-04 08:36, Severin Gehwolf wrote:
Hi,

Could I please get reviews of this JDK 8-only change?

The issue at hand is that the JDK 8 build seems to be inconsistent with
later JDK builds (9+). When somebody passes
--with-extra-c{,xx}-flags="-O2" to the OpenJDK build on JDK 9+ the JVM
will get compiled with -O3 for a release type build. Not so on JDK 8.
It gets compiled with -O2. The reason we are passing extra C flags via
configure is to: a) get distro-wide optimization done b) allow for
hardened builds. Without the --with-extra-c{,xx}-flags="-O2" flag,
libjsig, libsaproc will get compiled with no optimization. That's what
I'd like to fix. The proposed patch allows one to force -O2 for the JVM
via OPT_EXTRAS make variable if so desired. Omitting OPT_EXTRAS=-O2
allows one to get hotspot libraries optimized with -O2 and better.
Thoughts?

Bug: https://bugs.openjdk.java.net/browse/JDK-8210352
webrev: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8210352/webrev.01/

Thanks,
Severin


Reply via email to