merge from amd64 branch
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 5 Feb 2009 17:58:55 +0000 (17:58 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 5 Feb 2009 17:58:55 +0000 (17:58 +0000)
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

reactos/tools/rbuild/backend/mingw/mingw.cpp
reactos/tools/rbuild/module.cpp

index 7453f23..2f7d1f4 100644 (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" );
index 1ead4f1..aea145f 100644 (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;
 }