diff --git a/reactos/drivers/net/afd/afd.def b/reactos/drivers/net/afd/afd.def deleted file mode 100644 index c83c3a9e031..00000000000 --- a/reactos/drivers/net/afd/afd.def +++ /dev/null @@ -1,7 +0,0 @@ -; Ancillary Function Driver - ReactOS Operating System - -LIBRARY AFDTEST.SYS - -EXPORTS - -; EOF diff --git a/reactos/drivers/net/afd/afd.xml b/reactos/drivers/net/afd/afd.xml index 5161b224fa3..46f07209bd0 100644 --- a/reactos/drivers/net/afd/afd.xml +++ b/reactos/drivers/net/afd/afd.xml @@ -1,5 +1,4 @@ - include include/afd diff --git a/reactos/lib/kernel32/kernel32.def b/reactos/lib/kernel32/kernel32.def index f618755bef1..0eefd695cc2 100644 --- a/reactos/lib/kernel32/kernel32.def +++ b/reactos/lib/kernel32/kernel32.def @@ -178,7 +178,7 @@ EnterCriticalSection@4=NTDLL.RtlEnterCriticalSection EnumCalendarInfoA@16 EnumCalendarInfoExA@16 EnumCalendarInfoExW@16 -EnumCalendarInfoW@16 +;EnumCalendarInfoW@16 EnumDateFormatsA@12 EnumDateFormatsExA@12 EnumDateFormatsExW@12 @@ -657,7 +657,7 @@ OpenJobObjectW@12 OpenMutexA@12 OpenMutexW@12 OpenProcess@12 -OpenProfileUserMapping@0 +;OpenProfileUserMapping@0 OpenSemaphoreA@12 OpenSemaphoreW@12 OpenThread@12 @@ -689,7 +689,7 @@ QueryPerformanceCounter@4 QueryPerformanceFrequency@4 QueueUserAPC@12 QueueUserWorkItem@12 -QueryWin31IniFilesMappedToRegistry@16 +;QueryWin31IniFilesMappedToRegistry@16 RaiseException@16 ReadConsoleA@20 ReadConsoleInputA@16 diff --git a/reactos/lib/kernel32/kernel32.xml b/reactos/lib/kernel32/kernel32.xml index 33943466f44..cae001069f9 100644 --- a/reactos/lib/kernel32/kernel32.xml +++ b/reactos/lib/kernel32/kernel32.xml @@ -9,6 +9,9 @@ pseh rosrtl ntdll + -lgcc + -nostartfiles + -nostdlib kernel32.mc diff --git a/reactos/lib/ntdll/ntdll.xml b/reactos/lib/ntdll/ntdll.xml index 71a745af4c4..3a6ddf15e87 100644 --- a/reactos/lib/ntdll/ntdll.xml +++ b/reactos/lib/ntdll/ntdll.xml @@ -6,6 +6,7 @@ rosrtl rtl string + -lgcc capture.c lpc.c diff --git a/reactos/lib/ntdll/rtl/i386/exception.c b/reactos/lib/ntdll/rtl/i386/exception.c index 8a03fcb1fc4..dbc2d596885 100755 --- a/reactos/lib/ntdll/rtl/i386/exception.c +++ b/reactos/lib/ntdll/rtl/i386/exception.c @@ -247,23 +247,6 @@ RtlpDispatchException(IN PEXCEPTION_RECORD ExceptionRecord, return ExceptionContinueExecution; } -/* - * @implemented - */ -VOID STDCALL -RtlRaiseStatus(NTSTATUS Status) -{ - EXCEPTION_RECORD ExceptionRecord; - - DPRINT("RtlRaiseStatus(Status 0x%.08x)\n", Status); - - ExceptionRecord.ExceptionCode = Status; - ExceptionRecord.ExceptionRecord = NULL; - ExceptionRecord.NumberParameters = 0; - ExceptionRecord.ExceptionFlags = EXCEPTION_NONCONTINUABLE; - RtlRaiseException (& ExceptionRecord); -} - /* * @implemented */ diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp index 2706f61b7f5..7a96a6fdcd7 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp @@ -532,21 +532,60 @@ MingwModuleHandler::GenerateCommand ( const Module& module, sourceFilename.c_str () ); } -string +void MingwModuleHandler::GenerateLinkerCommand ( const Module& module, const string& linker, const string& linkerParameters, const string& objectFilenames ) const { + string targetName ( module.GetTargetName () ); string target ( FixupTargetFilename ( module.GetPath () ) ); string importLibraryDependencies = GetImportLibraryDependencies ( module ); - return ssprintf ( "%s %s -o %s %s %s %s\n", - linker.c_str (), - linkerParameters.c_str (), - target.c_str (), - objectFilenames.c_str (), - importLibraryDependencies.c_str (), - GetLinkerMacro ( module ).c_str () ); + if ( module.importLibrary != NULL ) + { + static string ros_junk ( "$(ROS_TEMPORARY)" ); + string base_tmp = ros_junk + module.name + ".base.tmp"; + string junk_tmp = ros_junk + module.name + ".junk.tmp"; + string temp_exp = ros_junk + module.name + ".temp.exp"; + + fprintf ( fMakefile, + "\t%s %s -Wl,--base-file,%s -o %s %s %s %s\n", + linker.c_str (), + linkerParameters.c_str (), + base_tmp.c_str (), + junk_tmp.c_str (), + objectFilenames.c_str (), + importLibraryDependencies.c_str (), + GetLinkerMacro ( module ).c_str () ); + + fprintf ( fMakefile, + "\t${dlltool} --dllname %s --base-file %s --def %s --output-exp %s --kill-at\n", + targetName.c_str (), + base_tmp.c_str (), + FixupTargetFilename ( module.GetBasePath () + SSEP + module.importLibrary->definition ).c_str (), + temp_exp.c_str () ); + + fprintf ( fMakefile, + "\t%s %s %s -o %s %s %s %s\n\n", + linker.c_str (), + linkerParameters.c_str (), + temp_exp.c_str (), + target.c_str (), + objectFilenames.c_str (), + importLibraryDependencies.c_str (), + GetLinkerMacro ( module ).c_str () ); + } + else + { + fprintf ( fMakefile, + "\t%s %s -o %s %s %s %s\n\n", + linker.c_str (), + linkerParameters.c_str (), + target.c_str (), + objectFilenames.c_str (), + importLibraryDependencies.c_str (), + GetLinkerMacro ( module ).c_str () ); + } } void @@ -1060,13 +1099,10 @@ MingwKernelModeDLLModuleHandler::GenerateKernelModeDLLModuleTarget ( const Modul importLibraryDependencies.c_str () ); string linkerParameters ( "-Wl,--subsystem,native -Wl,--entry,_DriverEntry@8 -Wl,--image-base,0x10000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -mdll" ); - string linkerCommand = GenerateLinkerCommand ( module, - "${gcc}", - linkerParameters, - archiveFilename ); - fprintf ( fMakefile, - "\t%s\n\n", - linkerCommand.c_str () ); + GenerateLinkerCommand ( module, + "${gcc}", + linkerParameters, + archiveFilename ); } else { @@ -1117,13 +1153,10 @@ MingwKernelModeDriverModuleHandler::GenerateKernelModeDriverModuleTarget ( const importLibraryDependencies.c_str () ); string linkerParameters ( "-Wl,--subsystem,native -Wl,--entry,_DriverEntry@8 -Wl,--image-base,0x10000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -mdll" ); - string linkerCommand = GenerateLinkerCommand ( module, - "${gcc}", - linkerParameters, - archiveFilename ); - fprintf ( fMakefile, - "\t%s\n\n", - linkerCommand.c_str () ); + GenerateLinkerCommand ( module, + "${gcc}", + linkerParameters, + archiveFilename ); } else { @@ -1156,6 +1189,7 @@ MingwNativeDLLModuleHandler::GenerateNativeDLLModuleTarget ( const Module& modul static string ros_junk ( "$(ROS_TEMPORARY)" ); string target ( FixupTargetFilename ( module.GetPath () ) ); string workingDirectory = GetWorkingDirectory ( ); + string objectFilenames = GetObjectFilenames ( module ); string archiveFilename = GetModuleArchiveFilename ( module ); string importLibraryDependencies = GetImportLibraryDependencies ( module ); @@ -1171,13 +1205,10 @@ MingwNativeDLLModuleHandler::GenerateNativeDLLModuleTarget ( const Module& modul importLibraryDependencies.c_str () ); string linkerParameters ( "-Wl,--subsystem,native -Wl,--entry,_DllMainCRTStartup@12 -Wl,--image-base,0x10000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -nostdlib -mdll" ); - string linkerCommand = GenerateLinkerCommand ( module, - "${gcc}", - linkerParameters, - archiveFilename ); - fprintf ( fMakefile, - "\t%s\n\n", - linkerCommand.c_str () ); + GenerateLinkerCommand ( module, + "${gcc}", + linkerParameters, + objectFilenames ); } else { @@ -1225,13 +1256,10 @@ MingwWin32DLLModuleHandler::GenerateWin32DLLModuleTarget ( const Module& module importLibraryDependencies.c_str () ); string linkerParameters ( "-Wl,--subsystem,console -Wl,--entry,_DllMain@12 -Wl,--image-base,0x10000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -mdll" ); - string linkerCommand = GenerateLinkerCommand ( module, - "${gcc}", - linkerParameters, - archiveFilename ); - fprintf ( fMakefile, - "\t%s\n\n", - linkerCommand.c_str () ); + GenerateLinkerCommand ( module, + "${gcc}", + linkerParameters, + archiveFilename ); } else { @@ -1279,13 +1307,10 @@ MingwWin32GUIModuleHandler::GenerateWin32GUIModuleTarget ( const Module& module importLibraryDependencies.c_str () ); string linkerParameters ( "-Wl,--subsystem,windows -Wl,--entry,_WinMainCRTStartup -Wl,--image-base,0x00400000 -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000" ); - string linkerCommand = GenerateLinkerCommand ( module, - "${gcc}", - linkerParameters, - objectFilenames ); - fprintf ( fMakefile, - "\t%s\n\n", - linkerCommand.c_str () ); + GenerateLinkerCommand ( module, + "${gcc}", + linkerParameters, + objectFilenames ); } else { diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.h b/reactos/tools/rbuild/backend/mingw/modulehandler.h index 5456bb925b4..7cb54f885f3 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.h +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.h @@ -41,10 +41,10 @@ protected: std::string GetCFlagsMacro ( const Module& module ) const; std::string GetObjectsMacro ( const Module& module ) const; std::string GetLinkerMacro ( const Module& module ) const; - std::string GenerateLinkerCommand ( const Module& module, - const std::string& linker, - const std::string& linkerParameters, - const std::string& objectFilenames ) const; + void GenerateLinkerCommand ( const Module& module, + const std::string& linker, + const std::string& linkerParameters, + const std::string& objectFilenames ) const; void GenerateImportLibraryTargetIfNeeded ( const Module& module ) const; static FILE* fMakefile; private: