Linking failures were observed when statically linking the launcher executable with hotspot and user native code together:
```
ld: error: duplicate symbol: Thread::Thread()
>>> defined at <user_code>
>>> <user_code.o>:(Thread::Thread())
>>> defined at thread.cpp:223 (/.../src/hotspot/share/runtime/thread.cpp:223)
>>> .../objs/thread.o:(.text+0x430)
ld: error: duplicate symbol: vtable for Thread
>>> defined at <user_code>
>>> /.../<user_code.o>:(vtable for Thread)
>>> defined at thread.cpp
>>> .../libjvm/objs/thread.o:(.data.rel.ro+0x0)
ld: error: duplicate symbol: Thread::~Thread()
>>> defined at <user_code>
>>> /.../<user_code>.o:(Thread::~Thread())
>>> defined at thread.cpp:402 (/...src/hotspot/share/runtime/thread.cpp:402)
>>> .../libjvm/objs/thread.o:(.text+0xE70)
```
```
ld: error: duplicate symbol: Thread::Thread()
>>> defined at <user_code>
>>> <user_code.o>:(Thread::Thread())
>>> defined at thread.cpp:223 (/.../src/hotspot/share/runtime/thread.cpp:223)
>>> .../objs/thread.o:(.text+0x430)
ld: error: duplicate symbol: vtable for Thread
>>> defined at <user_code>
>>> /.../<user_code.o>:(vtable for Thread)
>>> defined at thread.cpp
>>> .../libjvm/objs/thread.o:(.data.rel.ro+0x0)
ld: error: duplicate symbol: Thread::~Thread()
>>> defined at <user_code>
>>> /.../<user_code>.o:(Thread::~Thread())
>>> defined at thread.cpp:402 (/...src/hotspot/share/runtime/thread.cpp:402)
>>> .../libjvm/objs/thread.o:(.text+0xE70)
```
- relates to
-
JDK-8311661 Resolve duplicate symbol of StringTable::StringTable with JDK static linking
- Open
-
JDK-8303796 Optionally build fully statically linked JDK image
- Open
- links to
-
Review openjdk/jdk/17456