Questions about the Hermetic Java project
Magnus Ihse Bursie
magnus.ihse.bursie at oracle.com
Fri Apr 19 10:48:09 UTC 2024
On 2024-04-19 00:35, dean.long at oracle.com wrote:
> There is also the LIB command, which creates the equivalent of a .a
> library, but with an explicit export list:
>
> https://learn.microsoft.com/en-us/cpp/build/reference/building-an-import-library-and-export-file?view=msvc-170
>
This is where the Microsoft toolchain gets confusing. This will only
create an *import* library. An import library does not have a
corresponding concept in the clang/gcc toolchain. It is a static
library, yes, but it is a shim library with the single trivial purpose
to load and initialize the corresponding dll. So this does not help us
in building a "proper" static library.
Unfortunately, this distinction was not entirely clear to me or the
other initial authors of the JDK build system, so things are confusing
there as well with regard to this. (I plan to address this.)
/Magnus
>
> dl
>
> On 4/18/24 3:28 AM, Magnus Ihse Bursie wrote:
>> What needs to be done then is:
>>
>> 1) Combine multiple .obj (COFF object files) into one.
>>
>> 2) Change the visibility of symbols that are not marked as
>> dll_export:ed to they appear like they were declared static.
>>
>> In the clang/gcc world, the first step is done by "partial linking"
>> by ld. That is our first blocker -- link.exe cannot do that. So the
>> first question is really, is there a Windows build of ld that can
>> work on COFF files to achieve this?
>>
>> The second step is done by objcopy using the "--localize-hidden"
>> argument. The second question is, could this work on a COFF object file?
More information about the leyden-dev
mailing list