After the changes in JDK-8238649 some users are experience a build error:
On 17/06/2021 9:47 am, Vitaly Provodin wrote:
> Hi all,
>
> Building OpenJDK on Windows I am faced with the following error
>
> ---------------------------8<---------------------------
> os_windows.obj : error LNK2019: unresolved external symbol "int __cdecl convert_to_unicode(char const *,wchar_t * *)" (?convert_to_unicode@@YAHPEBDPEAPEA_W@Z) referenced in function "public: static void __cdecl os::set_native_thread_name(char const *)" (?set_native_thread_name@os@@SAXPEBD@Z)
> c:\buildagent\work\d0555747f6bd5c6\build\windows-x86_64-server-release\support\modules_libs\java.base\server\jvm.dll : fatal error LNK1120: 1 unresolved externals
This is not seen by all users.
convert_to_unicode is a static function in os_windows.cpp and was used prior to this recent change with set_native_thread_name(). The only difference is that we declared a function prototype for it, as a forward declaration, as it is defined later in the file. It seems the prototype and the definition are subtly different, leading to the linker thinking this is an external reference.