Skip to content

Commit 8f243ae

Browse files
committed
Set linkage for windows
1 parent 1c1bf90 commit 8f243ae

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/aotcompile.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,6 +1690,10 @@ void jl_dump_native_impl(void *native_code,
16901690
auto F = Function::Create(FT, Function::ExternalLinkage, "get_jl_RTLD_DEFAULT_handle_pointer", metadataM);
16911691
llvm::IRBuilder<> builder(BasicBlock::Create(Context, "top", F));
16921692
builder.CreateRet(jlRTLD_DEFAULT_var);
1693+
F->setLinkage(GlobalValue::ExternalLinkage);
1694+
if (TheTriple.isOSWindows()) {
1695+
F->setDLLStorageClass(GlobalValue::DLLStorageClassTypes::DLLExportStorageClass);
1696+
}
16931697
if (TheTriple.isOSWindows()) {
16941698
// Windows expect that the function `_DllMainStartup` is present in an dll.
16951699
// Normal compilers use something like Zig's crtdll.c instead we provide a

0 commit comments

Comments
 (0)