-
Type:
Enhancement
-
Resolution: Unresolved
-
Priority:
P4
-
None
-
Affects Version/s: 25, 26
-
Component/s: infrastructure
-
None
-
generic
-
linux
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 :
https://manpages.debian.org/testing/lld-7/ld.lld-7.1
https://manpages.ubuntu.com/manpages/jammy/man1/ld.lld-11.1.html
From what I see, the gold linker and the ld.lld (ELF linker from the LLVM project) support the flag.
sizes of libjvm.so with / without -icf=all (gcc 13.2.0 is used for compilation)
linux aarch64 : 25888 / 27112 K
linux x86_64 : 27952 / 29072 K
(on linuxppc64le the gold linker seems to be available only on very recent distros, so for now I did not measure lib sizes there)
(for most other native libs the identical code folding has no effect, because there is nothing to fold)
See for example :
https://manpages.debian.org/testing/lld-7/ld.lld-7.1
https://manpages.ubuntu.com/manpages/jammy/man1/ld.lld-11.1.html
From what I see, the gold linker and the ld.lld (ELF linker from the LLVM project) support the flag.
sizes of libjvm.so with / without -icf=all (gcc 13.2.0 is used for compilation)
linux aarch64 : 25888 / 27112 K
linux x86_64 : 27952 / 29072 K
(on linuxppc64le the gold linker seems to be available only on very recent distros, so for now I did not measure lib sizes there)
(for most other native libs the identical code folding has no effect, because there is nothing to fold)
- links to
-
Review(master)
openjdk/jdk/28236