On Mon, 17 Oct 2022 09:24:58 GMT, Magnus Ihse Bursie <i...@openjdk.org> wrote:

> @TheShermanTanker Question: is this a Windows-specific thing, or are there 
> pragma-loaded libraries for other compilers as well?

To my knowledge only Visual C++ has the ability to perform linking through 
pragmas, the comment pragma works by leaving a linker comment in the object 
file (hence the name), meaning this only works with the Visual C++ linker, so 
while clang does support this pragma with clang-cl, for the use cases in the 
JDK it wouldn't matter. gcc does not have an equivalent pragma (or provide 
support for linking from inside source files at all, for that matter)

> If the methods are equivalent, I prefer linking via make file.

There isn't any difference between the 2 unless the library is tampered with by 
`-nodefaultlib`, but I can only find that specified in 
https://github.com/openjdk/jdk/blob/a033aa5a3d9c63d72d11af218b9896b037fbd8de/make/autoconf/flags-other.m4#L38
 and 
https://github.com/openjdk/jdk/blob/392f35df4be1a9a8d7a67a25ae01230c7dd060ac/make/autoconf/lib-hsdis.m4#L45,
 neither of which have an effect on the libraries in this changeset

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

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

Reply via email to