From 3e7b4d7fc25d05ec9a1eeb0bd411fd48040c0c85 Mon Sep 17 00:00:00 2001 From: Christoph von Wittich Date: Sat, 8 Jul 2006 18:24:11 +0000 Subject: [PATCH] -fix msvc dll entrypoint -fix PROJECT_LFLAGS -added --enable-stdcall-fixup to PROJECT_LFLAGS svn path=/trunk/; revision=22930 --- reactos/tools/rbuild/backend/mingw/mingw.cpp | 4 ++-- reactos/tools/rbuild/backend/mingw/modulehandler.cpp | 8 ++++---- reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp | 2 +- reactos/tools/rbuild/module.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/reactos/tools/rbuild/backend/mingw/mingw.cpp b/reactos/tools/rbuild/backend/mingw/mingw.cpp index 01350ee0af2..787778e0fa6 100644 --- a/reactos/tools/rbuild/backend/mingw/mingw.cpp +++ b/reactos/tools/rbuild/backend/mingw/mingw.cpp @@ -420,8 +420,8 @@ MingwBackend::GenerateGlobalVariables () const fprintf ( fMakefile, "PROJECT_RCFLAGS := $(PROJECT_CFLAGS)\n" ); fprintf ( fMakefile, "PROJECT_WIDLFLAGS := $(PROJECT_CFLAGS)\n" ); - fprintf ( fMakefile, "PROJECT_LFLAGS := %s\n", - GenerateProjectLFLAGS ().c_str () ); + fprintf ( fMakefile, "PROJECT_LFLAGS := %s %s\n", + GenerateProjectLFLAGS ().c_str (), "-Wl,--enable-stdcall-fixup" ); fprintf ( fMakefile, "PROJECT_CFLAGS += -Wall\n" ); fprintf ( fMakefile, "PROJECT_CFLAGS += $(PROJECT_GCCOPTIONS)\n" ); fprintf ( fMakefile, "\n" ); diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp index bd2f1c2fd71..69ba16ef33c 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp @@ -1564,15 +1564,15 @@ MingwModuleHandler::GenerateLinkerCommand ( killAt.c_str () ); fprintf ( fMakefile, - "\t%s %s %s %s -o %s %s %s %s\n", + "\t%s %s %s %s %s -o %s %s %s\n", linker.c_str (), + GetLinkerMacro ().c_str (), linkerParameters.c_str (), linkerScriptArgument.c_str (), temp_exp.c_str (), target.c_str (), objectsMacro.c_str (), - libsMacro.c_str (), - GetLinkerMacro ().c_str () ); + libsMacro.c_str () ); fprintf ( fMakefile, "\t$(Q)$(PEFIXUP_TARGET) %s -exports %s\n", @@ -2263,7 +2263,7 @@ MingwBuildToolModuleHandler::GenerateBuildToolModuleTarget () fprintf ( fMakefile, "\t%s %s -o $@ %s %s\n\n", linker.c_str (), - GetLinkerMacro ().c_str (), + GetLinkerMacro().c_str (), objectsMacro.c_str (), libsMacro.c_str () ); } diff --git a/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp b/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp index eaefd900e94..d15b79a98eb 100644 --- a/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp +++ b/reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp @@ -443,7 +443,7 @@ MSVCBackend::_generate_vcproj ( const Module& module ) } else if ( dll ) { - fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"%s\"\r\n", module.GetEntryPoint(false) == "" ? "DllMain" : module.GetEntryPoint(false).c_str ()); + fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"%s%s\"\r\n", module.GetEntryPoint(false) == "" ? "" : "_", module.GetEntryPoint(false) == "" ? "_DllMainCRTStartup@12" : module.GetEntryPoint(false).c_str ()); fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr == "" ? "0x40000" : baseaddr.c_str ()); } fprintf ( OUT, "\t\t\t\tTargetMachine=\"%d\"/>\r\n", 1 ); diff --git a/reactos/tools/rbuild/module.cpp b/reactos/tools/rbuild/module.cpp index 8c642a6fba6..4eb7468d608 100644 --- a/reactos/tools/rbuild/module.cpp +++ b/reactos/tools/rbuild/module.cpp @@ -835,7 +835,7 @@ Module::GetDefaultModuleEntrypoint () const case NativeCUI: return "NtProcessStartup@4"; case Win32DLL: - return "DllMain@12"; + return "DllMainCRTStartup@12"; case Win32CUI: case Test: if ( isUnicode )