On Mon, 13 Jul 2026 08:09:19 GMT, Thomas Stuefe <[email protected]> wrote:
>> Linux/gcc currently enables linktime-gc on libjvm.so, when it is configured >> for the build. >> Linux/clang enables it (when configured) so far only for the JDK libs. This >> should be changed. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Is this happening by default? Since we have a number of probably "unused" > functions for debugging purposes in debug.cpp. I would dislike having to > re-do a debug build with different options every time I want to debug and use > those functions in the debugger. > > OTOH doing this for release by default sounds okay. > @tstuefe linktime-gc (ltgc) is enabled by default on Linux s390x and ppc64le; > not on x86_64 and aarch64 there it has to be enabled by the configure flag > > https://github.com/openjdk/jdk/blob/6247550cec70f76420ccf7e3a8aaa57e93315439/make/autoconf/jdk-options.m4#L112 > > Regarding the debug-helpers, there was some work to 'keep them in' even with > aggressive linkage like ltgc https://bugs.openjdk.org/browse/JDK-8379516 > https://bugs.openjdk.org/browse/JDK-8375311 Ah okay then. It also occurred to me we could just force the linker to retain them with something like `__attribute__((used, retain)) ` ------------- PR Comment: https://git.openjdk.org/jdk/pull/31765#issuecomment-4955952510
