RFR: 8295231: Move all linking of native libraries to make

Alan Bateman alanb at openjdk.org
Sun Oct 16 13:21:53 UTC 2022


On Mon, 10 Oct 2022 14:15:37 GMT, Julian Waters <jwaters at openjdk.org> wrote:

> Some external libraries required by native code are linked via linker comments embedded in pragmas. Searching for which libraries are linked can then become frustrating and confusing since they may be included in an obscure place, and for all relevant compilers there is no difference between specifying them from make and in a source file. The easiest solution is to just always link them from make and remove any source level linkage.

src/java.base/windows/native/libnio/ch/FileDispatcherImpl.c line 38:

> 36: 
> 37: #include <Mswsock.h>
> 38: #pragma comment(lib, "Mswsock.lib")

I think this came about with one of the early Microsoft contributions to have transferTo optionally use TransmitFile on Windows. This create the dependency on Mswsock.

-------------

PR: https://git.openjdk.org/jdk/pull/10633



More information about the build-dev mailing list