RFR: 8311661: Resolve duplicate symbol of StringTable::StringTable with JDK static linking [v2]
Jiangli Zhou
jiangli at openjdk.org
Tue Jul 11 22:26:10 UTC 2023
On Tue, 11 Jul 2023 20:35:13 GMT, Dean Long <dlong at openjdk.org> wrote:
> Does passing -Wl,--exclude-libs,ALL to gcc work for static libs?
I just did a quick test using `gcc` with testing code added to define `StringTable` related symbols outside `libjvm.a`. With `-Wl,--exclude-libs,ALL`, statically linking the launcher executable with `libjvm.a` and the testing code fails due to multiple definition of the related symbols. I guess that's expected as `--exclude-libs` is for controlling symbol exporting.
>From https://linux.die.net/man/1/ld#:~:text=Specifying%20%22%2D%2Dexclude%2Dlibs%20ALL,and%20for%20ELF%20targeted%20ports.
--exclude-libs lib,lib,...
Specifies a list of archive libraries from which symbols should not be automatically exported. The library names may be delimited by commas or colons. Specifying "--exclude-libs ALL" excludes symbols in all archive libraries from automatic export. This option is available only for the i386 PE targeted port of the linker and for ELF targeted ports. For i386 PE , symbols explicitly listed in a .def file are still exported, regardless of this option. For ELF targeted ports, symbols affected by this option will be treated as hidden.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/14808#issuecomment-1631585756
More information about the hotspot-dev
mailing list