[PATCH] Windows 32-bit DLL name decoration

Alexey Ivanov alexey.ivanov at oracle.com
Thu Nov 15 22:14:05 UTC 2018


Hi Ali,

Can the issue be resolved by using different call modifiers on the 
affected functions?

Some build / link issues were resolved by adding / removing JNICALL 
modifier, see
https://bugs.openjdk.java.net/browse/JDK-8201226
http://mail.openjdk.java.net/pipermail/build-dev/2018-April/021553.html

https://bugs.openjdk.java.net/browse/JDK-8202476
http://mail.openjdk.java.net/pipermail/build-dev/2018-May/021913.html

Regards,
Alexey

On 15/11/2018 21:43, Ali İnce wrote:
> Hi,
>
> An issue (https://github.com/AdoptOpenJDK/openjdk-build/issues/709) raised against AdoptOpenJDK jdk11 32-bit windows builds led us to the name decoration problem on built 32-bit dlls - specifically dt_socket.dll and dt_shmem.dll. Whereas 64-bit MSVC builds don’t apply any name decorations on exported functions, 32-bit builds apply them - which requires either def files or /export flags to be specified on the linker arguments.
>
> Although the expected linker arguments were present on previous jdk makefiles, they were removed in jdk11 makefiles.
>
> Below is the proposed patch, which can also be browsed at https://github.com/AdoptOpenJDK/openjdk-jdk11u/pull/1.
>
> Would you please have a look and let me know of any points I may have missed (I don’t have any background information about why the export flags were removed in jdk11)?
>
> Regards,
>
> Ali
>
> diff --git a/make/lib/Lib-jdk.jdi.gmk b/make/lib/Lib-jdk.jdi.gmk
> index 197b95c2e2..ac6ebf5591 100644
> --- a/make/lib/Lib-jdk.jdi.gmk
> +++ b/make/lib/Lib-jdk.jdi.gmk
> @@ -37,6 +37,7 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
>             jdk.jdwp.agent:include \
>             jdk.jdwp.agent:libjdwp/export, \
>         LDFLAGS := $(LDFLAGS_JDKLIB), \
> +      LDFLAGS_windows := -export:jdwpTransport_OnLoad, \
>         LIBS := $(JDKLIB_LIBS), \
>     ))
>
> diff --git a/make/lib/Lib-jdk.jdwp.agent.gmk b/make/lib/Lib-jdk.jdwp.agent.gmk
> index 0bc93e0d35..0382e55325 100644
> --- a/make/lib/Lib-jdk.jdwp.agent.gmk
> +++ b/make/lib/Lib-jdk.jdwp.agent.gmk
> @@ -37,6 +37,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBDT_SOCKET, \
>           libjdwp/export, \
>       LDFLAGS := $(LDFLAGS_JDKLIB) \
>           $(call SET_SHARED_LIBRARY_ORIGIN), \
> +    LDFLAGS_windows := -export:jdwpTransport_OnLoad, \
>       LIBS_linux := -lpthread, \
>       LIBS_solaris := -lnsl -lsocket, \
>       LIBS_windows := $(JDKLIB_LIBS) ws2_32.lib, \




More information about the build-dev mailing list