merge from amd64 branch

34740: Strip off stdcall decoration from amd64 entry points (Timo Kreuzer)
37786: Link to libgcc_eh for amd64 C++ apps (Samuel Serapión)

svn path=/trunk/; revision=39414
This commit is contained in:
Timo Kreuzer 2009-02-05 17:58:55 +00:00
parent 80187e8d4e
commit d3a9426b6a
2 changed files with 12 additions and 0 deletions

View file

@ -544,6 +544,10 @@ MingwBackend::GenerateGlobalVariables () const
fprintf ( fMakefile, "PROJECT_WIDLFLAGS := $(PROJECT_CINCLUDES) $(PROJECT_CDEFINES)\n" );
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" );
fprintf ( fMakefile, "PROJECT_GCCOPTIONS += -Wall\n" );
fprintf ( fMakefile, "ifneq ($(OARCH),)\n" );
fprintf ( fMakefile, "PROJECT_GCCOPTIONS += -march=$(OARCH)\n" );

View file

@ -1325,6 +1325,14 @@ Module::GetEntryPoint(bool leadingUnderscore) const
result = "_";
result += entrypoint;
if (Environment::GetArch() == "amd64")
{
size_t at_index = result.find_last_of( '@' );
if ( at_index != result.npos )
return result.substr (0, at_index );
}
return result;
}