Skip to content

Commit 4cacdbc

Browse files
committed
Remove places where we launder dllimport away
1 parent 8f243ae commit 4cacdbc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/codegen.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ struct JuliaVariable {
496496
auto var = new GlobalVariable(*m, _type(T_size),
497497
isconst, GlobalVariable::ExternalLinkage,
498498
NULL, name);
499-
if (Triple(m->getTargetTriple()).isOSWindows())
499+
if (Triple(m->getTargetTriple()).getObjectFormat() == Triple::COFF)
500500
var->setDLLStorageClass(GlobalValue::DLLStorageClassTypes::DLLImportStorageClass); // This is necessary to avoid auto import issues
501501
return var;
502502
}
@@ -1791,7 +1791,8 @@ static inline GlobalVariable *prepare_global_in(Module *M, GlobalVariable *G)
17911791
proto->copyAttributesFrom(G);
17921792
// DLLImport only needs to be set for the shadow module
17931793
// it just gets annoying in the JIT
1794-
proto->setDLLStorageClass(GlobalValue::DefaultStorageClass);
1794+
if (Triple(M->getTargetTriple()).getObjectFormat() != Triple::COFF)
1795+
proto->setDLLStorageClass(GlobalValue::DefaultStorageClass);
17951796
return proto;
17961797
}
17971798
return cast<GlobalVariable>(local);

0 commit comments

Comments
 (0)