-
Type:
Enhancement
-
Resolution: Fixed
-
Priority:
P4
-
Affects Version/s: 27
-
Component/s: infrastructure
-
None
-
master
-
generic
-
linux
Currently linktime-gc is only supported with gcc, but the needed compile and linker flags should work too with clang on Linux.
So it should be supported too on Linux when choosing the clang toolchain .
While on Linux with clang we get slightly smaller lib when enabling ltgc, on macOS the -ffunction-sections -fdata-sections compile flags seem to cause larger libs (the linker option -Wl,--gc-sections is not available on macOS, but we use the dead_strip linker option already) ,
On AIX (uses clang too), some kind of section gc is performed already by default by the linker so no need to enable it; see https://www.ibm.com/docs/en/aix/7.2.0?topic=l-ld-command (there is only the nogc option to disable the linktime gc) ;
the -ffunction-sections -fdata-sections compile flags showed no benefit regarding binary sizes.
So it should be supported too on Linux when choosing the clang toolchain .
While on Linux with clang we get slightly smaller lib when enabling ltgc, on macOS the -ffunction-sections -fdata-sections compile flags seem to cause larger libs (the linker option -Wl,--gc-sections is not available on macOS, but we use the dead_strip linker option already) ,
On AIX (uses clang too), some kind of section gc is performed already by default by the linker so no need to enable it; see https://www.ibm.com/docs/en/aix/7.2.0?topic=l-ld-command (there is only the nogc option to disable the linktime gc) ;
the -ffunction-sections -fdata-sections compile flags showed no benefit regarding binary sizes.
- links to
-
Commit(master)
openjdk/jdk/dc6f7014
-
Review(master)
openjdk/jdk/30071