RFR: 8371626: [linux] use icf=all for linking libraries [v2]

Matthias Baesken mbaesken at openjdk.org
Tue Nov 11 16:28:41 UTC 2025


> Identical code folding can reduce the size of some libs, especially libjvm. However not all linkers support the flag/feature so we have to limit it to some environments.
> See for example this manpage :
> https://manpages.debian.org/testing/lld-7/ld.lld-7.1
> 
> 
> sizes of libjvm.so with / without -icf=all
> linux aarch64 : 25888 / 27112 K
> linux x86_64 : 27952 / 29072 K
> 
> 
> (for most other native libs the identical code folding has no effect, because there is nothing to fold)

Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:

  limit icf=all link flag to gcc + gold linker

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28236/files
  - new: https://git.openjdk.org/jdk/pull/28236/files/faee9051..b3caf9ab

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28236&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28236&range=00-01

  Stats: 5 lines in 2 files changed: 1 ins; 2 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/28236.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28236/head:pull/28236

PR: https://git.openjdk.org/jdk/pull/28236


More information about the build-dev mailing list