mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 08:33:14 +01:00
Some more fixups for mingw -- missing underscores
This commit is contained in:
@@ -2165,8 +2165,8 @@ namespace AsmParserx8632
|
||||
{
|
||||
use_star = false;
|
||||
// simply write out the mangle
|
||||
// on osx, prepend extra _
|
||||
if ( global.params.os == OSMacOSX )
|
||||
// on osx and mingw, prepend extra _
|
||||
if ( global.params.os == OSMacOSX || global.params.os == OSWindows )
|
||||
insnTemplate << "_";
|
||||
insnTemplate << decl->mangle();
|
||||
// addOperand2("${", ":c}", Arg_Pointer, e, asmcode);
|
||||
|
||||
@@ -1656,7 +1656,7 @@ namespace AsmParserx8664
|
||||
}
|
||||
|
||||
// osx needs an extra underscore
|
||||
if ( global.params.os == OSMacOSX )
|
||||
if ( global.params.os == OSMacOSX || global.params.os == OSWindows )
|
||||
insnTemplate << "_";
|
||||
|
||||
// print out the mangle
|
||||
@@ -2287,8 +2287,8 @@ namespace AsmParserx8664
|
||||
{
|
||||
use_star = false;
|
||||
// simply write out the mangle
|
||||
// on osx, prepend extra _
|
||||
if ( global.params.os == OSMacOSX )
|
||||
// on osx and windows, prepend extra _
|
||||
if ( global.params.os == OSMacOSX || global.params.os == OSWindows )
|
||||
insnTemplate << "_";
|
||||
insnTemplate << decl->mangle();
|
||||
// addOperand2("${", ":c}", Arg_Pointer, e, asmcode);
|
||||
|
||||
@@ -144,7 +144,14 @@ void DtoDefineNakedFunction(FuncDeclaration* fd)
|
||||
if (DtoIsTemplateInstance(fd))
|
||||
{
|
||||
linkage = "weak";
|
||||
tmpstr << "section\t.gnu.linkonce.t." << mangle << ",\"ax\",@progbits";
|
||||
tmpstr << "section\t.gnu.linkonce.t.";
|
||||
if (global.params.os != OSWindows)
|
||||
{
|
||||
tmpstr << mangle << ",\"ax\",@progbits";
|
||||
} else
|
||||
{
|
||||
tmpstr << "_" << mangle << ",\"ax\"";
|
||||
}
|
||||
section = tmpstr.str();
|
||||
}
|
||||
asmstr << "\t." << section << std::endl;
|
||||
@@ -154,10 +161,11 @@ void DtoDefineNakedFunction(FuncDeclaration* fd)
|
||||
{
|
||||
std::string def = "def";
|
||||
std::string endef = "endef";
|
||||
asmstr << "\t." << def << "\t" << mangle << ";";
|
||||
asmstr << "\t." << def << "\t_" << mangle << ";";
|
||||
// hard code these two numbers for now since gas ignores .scl and llvm
|
||||
// is defaulting to .type 32 for everything I have seen
|
||||
asmstr << "\t.scl 2; .type 32;\t" << "." << endef << std::endl;
|
||||
asmstr << "_";
|
||||
} else
|
||||
{
|
||||
asmstr << "\t." << linkage << "\t" << mangle << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user