merge from amd64 branch

37786: Link to libgcc_eh for C++ apps (Samuel Serapión)
39416: improve r37786 a bit (Timo Kreuzer)
36415: rbuild: implement MingwModuleHandler::GetDebugFormat(), returning "dwarf-2" on amd64, "stabs+" in all other cases so far (Timo Kreuzer)

svn path=/trunk/; revision=39417
This commit is contained in:
Timo Kreuzer 2009-02-05 18:47:05 +00:00
parent d3a9426b6a
commit bf13eb0000
3 changed files with 19 additions and 5 deletions

View file

@ -545,9 +545,10 @@ MingwBackend::GenerateGlobalVariables () const
fprintf ( fMakefile, "PROJECT_LFLAGS := '$(shell ${TARGET_CC} -print-libgcc-file-name)' %s\n", GenerateProjectLFLAGS ().c_str () );
fprintf ( fMakefile, "PROJECT_LPPFLAGS := '$(shell ${TARGET_CPP} -print-file-name=libstdc++.a)' '$(shell ${TARGET_CPP} -print-file-name=libgcc.a)' '$(shell ${TARGET_CPP} -print-file-name=libmingw32.a)' '$(shell ${TARGET_CPP} -print-file-name=libmingwex.a)' '$(shell ${TARGET_CPP} -print-file-name=libcoldname.a)'\n" );
/* hack to get libgcc_eh.a, should check mingw version or something */
fprintf ( fMakefile, "ifeq ($(ARCH),amd64)\n" );
fprintf ( fMakefile, "PROJECT_LPPFLAGS += '$(shell ${TARGET_CPP} -print-file-name=libgcc_eh.a)'\n" );
fprintf ( fMakefile, "endif\n" );
if (Environment::GetArch() == "amd64")
{
fprintf ( fMakefile, "PROJECT_LPPFLAGS += '$(shell ${TARGET_CPP} -print-file-name=libgcc_eh.a)'\n" );
}
fprintf ( fMakefile, "PROJECT_GCCOPTIONS += -Wall\n" );
fprintf ( fMakefile, "ifneq ($(OARCH),)\n" );
fprintf ( fMakefile, "PROJECT_GCCOPTIONS += -march=$(OARCH)\n" );

View file

@ -1874,6 +1874,16 @@ MingwModuleHandler::GetLinkerMacro () const
module.name.c_str () );
}
string
MingwModuleHandler::GetDebugFormat () const
{
if (Environment::GetArch() == "amd64")
{
return "dwarf-2";
}
return "stabs+";
}
string
MingwModuleHandler::GetModuleTargets ( const Module& module )
{
@ -2031,7 +2041,7 @@ MingwModuleHandler::GenerateOtherMacros ()
}
else
globalCflags += " -Wall -Wpointer-arith";
globalCflags += " -gstabs+";
globalCflags += " -g" + MingwModuleHandler::GetDebugFormat ();
if ( backend->usePipe )
globalCflags += " -pipe";
if ( !module.allowWarnings )
@ -3681,6 +3691,7 @@ MingwElfExecutableModuleHandler::Process ()
string objectsMacro = GetObjectsMacro ( module );
string linkDepsMacro = GetLinkingDependenciesMacro ();
string libsMacro = GetLibsMacro ();
string debugFormat = GetDebugFormat ();
GenerateRules ();
@ -3694,10 +3705,11 @@ MingwElfExecutableModuleHandler::Process ()
fprintf ( fMakefile, "\t$(ECHO_BOOTPROG)\n" );
fprintf ( fMakefile, "\t${gcc} $(%s_LINKFORMAT) %s %s -gstabs+ -o %s\n",
fprintf ( fMakefile, "\t${gcc} $(%s_LINKFORMAT) %s %s -g%s -o %s\n",
module.buildtype.c_str(),
objectsMacro.c_str(),
libsMacro.c_str(),
debugFormat.c_str(),
targetMacro.c_str () );
delete target_file;

View file

@ -102,6 +102,7 @@ protected:
std::string GetLinkingDependenciesMacro () const;
std::string GetLibsMacro () const;
std::string GetLinkerMacro () const;
std::string GetDebugFormat () const;
void GenerateCleanObjectsAsYouGoCode () const;
void GenerateRunRsymCode () const;
void GenerateRunStripCode () const;