From: Colin Finck Date: Tue, 9 Feb 2010 18:14:58 +0000 (+0000) Subject: The big RosBE 1.5 compatibility patch. You will need RosBE 1.5 from this point! X-Git-Tag: backups/jcatena-branch@60647^2~44 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=75538f4c0a8168a726832b8d16a6918030d09fc2 The big RosBE 1.5 compatibility patch. You will need RosBE 1.5 from this point! - Set the minimum GCC version to 4.4.0 and minimum Binutils version to 20091016. - Remove the -fno-unit-at-a-time hacks. - Remove dgorbachev's temporary hacks for user-mode C++ applications. - Merge ntoskrnl's "precomp.h" and "ntoskrnl.h" again, the PCH issues have been fixed. - Use our "ofmt_stub.a" to be compatible with newer MinGW Runtime versions. - Use LD's new -exclude-all-symbols option to not auto-export all symbols in case no DEF file or __declspec(dllexport) was specified. We used to patch our LD version to work around this problem. - Use LD's --start-group and --end-group parameters to allow a more flexible linking order. - Use GCC's -fno-set-stack-executable for amd64 and i386 targets to disable adding the __enable_execute_stack code. - Change the makefile's name to "makefile-$(ARCH).auto" for all architectures. - Remove some -Wno-error flags. See issue #4810 for more details. svn path=/trunk/; revision=45535 --- diff --git a/reactos/Makefile b/reactos/Makefile index 9a8acc0c880..1e7cbd2fcbf 100644 --- a/reactos/Makefile +++ b/reactos/Makefile @@ -169,11 +169,7 @@ else endif ifeq ($(ROS_AUTOMAKE),) - ifeq ($(ARCH),i386) - ROS_AUTOMAKE=makefile.auto - else - ROS_AUTOMAKE=makefile-$(ARCH).auto - endif + ROS_AUTOMAKE=makefile-$(ARCH).auto endif all: $(ROS_AUTOMAKE) diff --git a/reactos/ReactOS-generic.rbuild b/reactos/ReactOS-generic.rbuild index e6668389440..aac81472f1d 100644 --- a/reactos/ReactOS-generic.rbuild +++ b/reactos/ReactOS-generic.rbuild @@ -120,11 +120,6 @@ -Wno-strict-aliasing -Wpointer-arith -Wno-multichar - diff --git a/reactos/ReactOS-i386.rbuild b/reactos/ReactOS-i386.rbuild index 897fadbfa2e..75a6b785298 100644 --- a/reactos/ReactOS-i386.rbuild +++ b/reactos/ReactOS-i386.rbuild @@ -1,6 +1,6 @@ - + diff --git a/reactos/base/applications/games/solitaire/solitaire.cpp b/reactos/base/applications/games/solitaire/solitaire.cpp index e53efda79ce..4046b92ff2a 100644 --- a/reactos/base/applications/games/solitaire/solitaire.cpp +++ b/reactos/base/applications/games/solitaire/solitaire.cpp @@ -196,8 +196,6 @@ int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int iCm SaveSettings(); - try { throw 0; } catch (int i) { } /* HACK */ - return msg.wParam; } diff --git a/reactos/base/applications/games/spider/spider.cpp b/reactos/base/applications/games/spider/spider.cpp index 96188e0c518..49676433234 100644 --- a/reactos/base/applications/games/spider/spider.cpp +++ b/reactos/base/applications/games/spider/spider.cpp @@ -154,9 +154,6 @@ int WINAPI _tWinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int iCm DispatchMessage(&msg); } } - - try { throw 0; } catch (int i) { } /* HACK */ - return msg.wParam; } diff --git a/reactos/dll/directx/ddraw/ddraw.rbuild b/reactos/dll/directx/ddraw/ddraw.rbuild index 70f70d09219..a678e62164e 100644 --- a/reactos/dll/directx/ddraw/ddraw.rbuild +++ b/reactos/dll/directx/ddraw/ddraw.rbuild @@ -69,6 +69,4 @@ DirectD3D3_Vtable.c DirectD3D7_Vtable.c - - -fno-unit-at-a-time diff --git a/reactos/dll/directx/wine/ddraw/ddraw.rbuild b/reactos/dll/directx/wine/ddraw/ddraw.rbuild index 9a905af1940..f8d9c92c279 100644 --- a/reactos/dll/directx/wine/ddraw/ddraw.rbuild +++ b/reactos/dll/directx/wine/ddraw/ddraw.rbuild @@ -42,7 +42,4 @@ viewport.c wineheaders - - - -fno-unit-at-a-time diff --git a/reactos/dll/win32/actxprxy/actxprxy.rbuild b/reactos/dll/win32/actxprxy/actxprxy.rbuild index 04a760bd2db..87a50a17c83 100644 --- a/reactos/dll/win32/actxprxy/actxprxy.rbuild +++ b/reactos/dll/win32/actxprxy/actxprxy.rbuild @@ -15,7 +15,6 @@ rpcrt4 pseh usrmarshal.c - -fno-unit-at-a-time actxprxy_servprov.idl diff --git a/reactos/dll/win32/advapi32/advapi32.rbuild b/reactos/dll/win32/advapi32/advapi32.rbuild index 0396365b7b9..17e120ba9ce 100644 --- a/reactos/dll/win32/advapi32/advapi32.rbuild +++ b/reactos/dll/win32/advapi32/advapi32.rbuild @@ -59,5 +59,4 @@ token.c advapi32.rc - -fno-unit-at-a-time diff --git a/reactos/dll/win32/crypt32/crypt32.rbuild b/reactos/dll/win32/crypt32/crypt32.rbuild index e622fa27ed9..7884c27a317 100644 --- a/reactos/dll/win32/crypt32/crypt32.rbuild +++ b/reactos/dll/win32/crypt32/crypt32.rbuild @@ -42,6 +42,4 @@ message.c crypt32.rc version.rc - - -fno-unit-at-a-time diff --git a/reactos/dll/win32/gdi32/gdi32.rbuild b/reactos/dll/win32/gdi32/gdi32.rbuild index 5e47b5bc0a4..063b53221d8 100644 --- a/reactos/dll/win32/gdi32/gdi32.rbuild +++ b/reactos/dll/win32/gdi32/gdi32.rbuild @@ -8,11 +8,9 @@ pseh dxguid ntdll - dllmain.c @@ -49,6 +47,4 @@ path.c gdi32.rc - - -fno-unit-at-a-time diff --git a/reactos/dll/win32/kernel32/kernel32.rbuild b/reactos/dll/win32/kernel32/kernel32.rbuild index 91135019d9f..261b7b3645a 100644 --- a/reactos/dll/win32/kernel32/kernel32.rbuild +++ b/reactos/dll/win32/kernel32/kernel32.rbuild @@ -13,12 +13,8 @@ 0x0600 errcodes - - - -fno-unit-at-a-time -fno-exceptions -fno-rtti diff --git a/reactos/dll/win32/ole32/ole32.rbuild b/reactos/dll/win32/ole32/ole32.rbuild index 1c7969f8da7..24f60c87a32 100644 --- a/reactos/dll/win32/ole32/ole32.rbuild +++ b/reactos/dll/win32/ole32/ole32.rbuild @@ -63,8 +63,6 @@ dcom.idl irot.idl . - - -fno-unit-at-a-time irot.idl diff --git a/reactos/dll/win32/psapi/psapi.rbuild b/reactos/dll/win32/psapi/psapi.rbuild index 812265a2b27..7c21b6cc5a3 100644 --- a/reactos/dll/win32/psapi/psapi.rbuild +++ b/reactos/dll/win32/psapi/psapi.rbuild @@ -5,12 +5,8 @@ epsapi pseh ntdll - malloc.c psapi.c psapi.rc - - -fno-unit-at-a-time diff --git a/reactos/dll/win32/qmgrprxy/qmgrprxy.rbuild b/reactos/dll/win32/qmgrprxy/qmgrprxy.rbuild index 64dc200cd8c..cea10b90855 100644 --- a/reactos/dll/win32/qmgrprxy/qmgrprxy.rbuild +++ b/reactos/dll/win32/qmgrprxy/qmgrprxy.rbuild @@ -15,7 +15,6 @@ rpcrt4 pseh version.rc - -fno-unit-at-a-time qmgrprxy.idl diff --git a/reactos/dll/win32/rpcrt4/rpcrt4.rbuild b/reactos/dll/win32/rpcrt4/rpcrt4.rbuild index a0dd9e14e40..ad1008bed48 100644 --- a/reactos/dll/win32/rpcrt4/rpcrt4.rbuild +++ b/reactos/dll/win32/rpcrt4/rpcrt4.rbuild @@ -39,8 +39,6 @@ rpcrt4.rc epm.idl . - - -fno-unit-at-a-time epm.idl diff --git a/reactos/dll/win32/setupapi/setupapi.rbuild b/reactos/dll/win32/setupapi/setupapi.rbuild index 81c1dd70394..bb3e0e37c56 100644 --- a/reactos/dll/win32/setupapi/setupapi.rbuild +++ b/reactos/dll/win32/setupapi/setupapi.rbuild @@ -39,6 +39,4 @@ stubs.c rpc.c setupapi.rc - - -fno-unit-at-a-time diff --git a/reactos/dll/win32/syssetup/syssetup.rbuild b/reactos/dll/win32/syssetup/syssetup.rbuild index d2909ce527b..4fd7e6249da 100644 --- a/reactos/dll/win32/syssetup/syssetup.rbuild +++ b/reactos/dll/win32/syssetup/syssetup.rbuild @@ -20,6 +20,4 @@ logfile.c wizard.c syssetup.rc - - -fno-unit-at-a-time diff --git a/reactos/dll/win32/user32/user32.rbuild b/reactos/dll/win32/user32/user32.rbuild index 6fd34e68547..e905d747d31 100644 --- a/reactos/dll/win32/user32/user32.rbuild +++ b/reactos/dll/win32/user32/user32.rbuild @@ -11,11 +11,9 @@ pseh ntdll -fms-extensions - button.c combo.c @@ -76,6 +74,4 @@ winpos.c user32.rc - - -fno-unit-at-a-time diff --git a/reactos/dll/win32/wintrust/wintrust.rbuild b/reactos/dll/win32/wintrust/wintrust.rbuild index 1c73efd7038..910d2278f8e 100644 --- a/reactos/dll/win32/wintrust/wintrust.rbuild +++ b/reactos/dll/win32/wintrust/wintrust.rbuild @@ -18,6 +18,4 @@ asn.c softpub.c version.rc - - -fno-unit-at-a-time diff --git a/reactos/dll/win32/wlanapi/wlanapi.rbuild b/reactos/dll/win32/wlanapi/wlanapi.rbuild index 781a8ae7a44..f17b4c263a4 100644 --- a/reactos/dll/win32/wlanapi/wlanapi.rbuild +++ b/reactos/dll/win32/wlanapi/wlanapi.rbuild @@ -8,6 +8,4 @@ pseh ntdll main.c - - -fno-unit-at-a-time diff --git a/reactos/drivers/input/kbdclass/kbdclass.rbuild b/reactos/drivers/input/kbdclass/kbdclass.rbuild index 37fda368f08..480896a80ed 100644 --- a/reactos/drivers/input/kbdclass/kbdclass.rbuild +++ b/reactos/drivers/input/kbdclass/kbdclass.rbuild @@ -9,6 +9,4 @@ misc.c setup.c kbdclass.rc - - -fno-unit-at-a-time diff --git a/reactos/drivers/input/mouclass/mouclass.rbuild b/reactos/drivers/input/mouclass/mouclass.rbuild index bcbcc4ce25d..1b75a0111cd 100644 --- a/reactos/drivers/input/mouclass/mouclass.rbuild +++ b/reactos/drivers/input/mouclass/mouclass.rbuild @@ -8,6 +8,4 @@ misc.c mouclass.c mouclass.rc - - -fno-unit-at-a-time diff --git a/reactos/drivers/network/afd/afd.rbuild b/reactos/drivers/network/afd/afd.rbuild index aef02b46a6b..6e56ce23b07 100644 --- a/reactos/drivers/network/afd/afd.rbuild +++ b/reactos/drivers/network/afd/afd.rbuild @@ -8,9 +8,7 @@ ntoskrnl hal - bind.c @@ -27,6 +25,4 @@ write.c afd.rc - - -fno-unit-at-a-time diff --git a/reactos/drivers/network/tcpip/tcpip.rbuild b/reactos/drivers/network/tcpip/tcpip.rbuild index ea9d3a6d5e1..f3c6114e568 100644 --- a/reactos/drivers/network/tcpip/tcpip.rbuild +++ b/reactos/drivers/network/tcpip/tcpip.rbuild @@ -13,11 +13,9 @@ chew ntoskrnl hal - lan.c @@ -36,6 +34,4 @@ wait.c tcpip.rc - - -fno-unit-at-a-time diff --git a/reactos/lib/rtl/rtl.rbuild b/reactos/lib/rtl/rtl.rbuild index 6d89eeb18c9..0b15a1c8cda 100644 --- a/reactos/lib/rtl/rtl.rbuild +++ b/reactos/lib/rtl/rtl.rbuild @@ -107,9 +107,5 @@ version.c wait.c workitem.c - - - -fno-unit-at-a-time diff --git a/reactos/ntoskrnl/include/ntoskrnl.h b/reactos/ntoskrnl/include/ntoskrnl.h index 71f4f655551..9c6a06777f9 100644 --- a/reactos/ntoskrnl/include/ntoskrnl.h +++ b/reactos/ntoskrnl/include/ntoskrnl.h @@ -1,5 +1,101 @@ -#include "precomp.h" +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS Kernel + * FILE: ntoskrnl/include/ntoskrnl.h + * PURPOSE: Main Kernel Header + * PROGRAMMER: Alex Ionescu (alex@relsoft.net) + */ + +/* INCLUDES ******************************************************************/ + +/* ARM Bringup Hack */ +#ifdef _M_ARM +#define DbgPrint DbgPrintEarly +#endif + +/* Version Data */ +#undef __MSVCRT__ +#include + +/* DDK/IFS/NDK Headers */ +#define _REALLY_GET_CALLERS_CALLER +#include +#include +#undef DECLSPEC_IMPORT +#define DECLSPEC_IMPORT +#include +#include +#include +#undef NTHALAPI +#define NTHALAPI __declspec(dllimport) +#include +#undef TEXT +#define TEXT(s) L##s +#include + +/* FIXME: Temporary until Winldr is used */ +#include + +/* C Headers */ +#include +#include +#include +#include +#include + +/* SEH support with PSEH */ +#include + +/* ReactOS Headers */ +#include +#include + +/* SetupLDR Support */ +#include + +/* KD Support */ +#define NOEXTAPI +#include +#include +#include +#ifndef _WINKD_ +#include +#endif + +/* PNP GUIDs */ +#include + +/* Internal Headers */ +#include "internal/ntoskrnl.h" +#include "config.h" -/* Headers that shouldn't be precompiled due to GCC bugs */ #include #include "internal/probe.h" + +// +// Define the internal versions of external and public global data +// +#define IoFileObjectType _IoFileObjectType +#define PsThreadType _PsThreadType +#define PsProcessType _PsProcessType +#define ExEventObjectType _ExEventObjectType +#define ExSemaphoreObjectType _ExSemaphoreObjectType +#define KdDebuggerEnabled _KdDebuggerEnabled +#define KdDebuggerNotPresent _KdDebuggerNotPresent +#define NlsOemLeadByteInfo _NlsOemLeadByteInfo +extern PUSHORT _NlsOemLeadByteInfo; +#define FsRtlLegalAnsiCharacterArray _FsRtlLegalAnsiCharacterArray +#undef LEGAL_ANSI_CHARACTER_ARRAY +#undef NLS_MB_CODE_PAGE_TAG +#undef NLS_OEM_LEAD_BYTE_INFO +#define LEGAL_ANSI_CHARACTER_ARRAY FsRtlLegalAnsiCharacterArray +#define NLS_MB_CODE_PAGE_TAG NlsMbOemCodePageTag +#define NLS_OEM_LEAD_BYTE_INFO _NlsOemLeadByteInfo +#undef KD_DEBUGGER_ENABLED +#undef KD_DEBUGGER_NOT_PRESENT +#define KD_DEBUGGER_ENABLED KdDebuggerEnabled +#define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent +#define HalDispatchTable _HalDispatchTable +#undef HALDISPATCH +#define HALDISPATCH (&HalDispatchTable) +#define ExRaiseStatus RtlRaiseStatus diff --git a/reactos/ntoskrnl/include/precomp.h b/reactos/ntoskrnl/include/precomp.h deleted file mode 100644 index 8948bae44f0..00000000000 --- a/reactos/ntoskrnl/include/precomp.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * COPYRIGHT: See COPYING in the top level directory - * PROJECT: ReactOS Kernel - * FILE: ntoskrnl/include/ntoskrnl.h - * PURPOSE: Main Kernel Header - * PROGRAMMER: Alex Ionescu (alex@relsoft.net) - */ - -/* INCLUDES ******************************************************************/ - -/* ARM Bringup Hack */ -#ifdef _M_ARM -#define DbgPrint DbgPrintEarly -#endif - -/* Version Data */ -#undef __MSVCRT__ -#include - -/* DDK/IFS/NDK Headers */ -#define _REALLY_GET_CALLERS_CALLER -#include -#include -#undef DECLSPEC_IMPORT -#define DECLSPEC_IMPORT -#include -#include -#include -#undef NTHALAPI -#define NTHALAPI __declspec(dllimport) -#include -#undef TEXT -#define TEXT(s) L##s -#include - -/* FIXME: Temporary until Winldr is used */ -#include - -/* C Headers */ -#include -#include -#include -#include -#include - -/* SEH support with PSEH */ -#include - -/* ReactOS Headers */ -#include -#include - -/* SetupLDR Support */ -#include - -/* KD Support */ -#define NOEXTAPI -#include -#include -#include -#ifndef _WINKD_ -#include -#endif - -/* PNP GUIDs */ -#include - -/* Internal Headers */ -#include "internal/ntoskrnl.h" -#include "config.h" - -// -// Define the internal versions of external and public global data -// -#define IoFileObjectType _IoFileObjectType -#define PsThreadType _PsThreadType -#define PsProcessType _PsProcessType -#define ExEventObjectType _ExEventObjectType -#define ExSemaphoreObjectType _ExSemaphoreObjectType -#define KdDebuggerEnabled _KdDebuggerEnabled -#define KdDebuggerNotPresent _KdDebuggerNotPresent -#define NlsOemLeadByteInfo _NlsOemLeadByteInfo -extern PUSHORT _NlsOemLeadByteInfo; -#define FsRtlLegalAnsiCharacterArray _FsRtlLegalAnsiCharacterArray -#undef LEGAL_ANSI_CHARACTER_ARRAY -#undef NLS_MB_CODE_PAGE_TAG -#undef NLS_OEM_LEAD_BYTE_INFO -#define LEGAL_ANSI_CHARACTER_ARRAY FsRtlLegalAnsiCharacterArray -#define NLS_MB_CODE_PAGE_TAG NlsMbOemCodePageTag -#define NLS_OEM_LEAD_BYTE_INFO _NlsOemLeadByteInfo -#undef KD_DEBUGGER_ENABLED -#undef KD_DEBUGGER_NOT_PRESENT -#define KD_DEBUGGER_ENABLED KdDebuggerEnabled -#define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent -#define HalDispatchTable _HalDispatchTable -#undef HALDISPATCH -#define HALDISPATCH (&HalDispatchTable) -#define ExRaiseStatus RtlRaiseStatus diff --git a/reactos/ntoskrnl/ntoskrnl-generic.rbuild b/reactos/ntoskrnl/ntoskrnl-generic.rbuild index 2a308d433b5..0de8a3faaa4 100644 --- a/reactos/ntoskrnl/ntoskrnl-generic.rbuild +++ b/reactos/ntoskrnl/ntoskrnl-generic.rbuild @@ -30,11 +30,9 @@ bootvid wdmguid bugcodes - @@ -502,7 +500,4 @@ ntoskrnl.rc ntoskrnl_$(ARCH).lnk - - - -fno-unit-at-a-time diff --git a/reactos/subsystems/win32/win32k/objects/gdiobj.c b/reactos/subsystems/win32/win32k/objects/gdiobj.c index 1c0dc8e8b3c..5af1413e69a 100644 --- a/reactos/subsystems/win32/win32k/objects/gdiobj.c +++ b/reactos/subsystems/win32/win32k/objects/gdiobj.c @@ -30,7 +30,7 @@ #include "gdidbg.c" -/* static */ /* FIXME: -fno-unit-at-a-time breaks this */ +static BOOL INTERNAL_CALL GDI_CleanupDummy(PVOID ObjectBody); /** GLOBALS *******************************************************************/ @@ -140,7 +140,7 @@ DeAllocTypeDataDump(INT TypeInfo) /* * Dummy GDI Cleanup Callback */ -/* static */ /* FIXME: -fno-unit-at-a-time breaks this */ +static BOOL INTERNAL_CALL GDI_CleanupDummy(PVOID ObjectBody) { diff --git a/reactos/subsystems/win32/win32k/win32k.rbuild b/reactos/subsystems/win32/win32k/win32k.rbuild index b5658babf67..eaefbff9ee0 100644 --- a/reactos/subsystems/win32/win32k/win32k.rbuild +++ b/reactos/subsystems/win32/win32k/win32k.rbuild @@ -20,9 +20,7 @@ /wd4276 - dib8gen.c @@ -205,8 +203,5 @@ stubs.c umpdstubs.c - - - -fno-unit-at-a-time diff --git a/reactos/tools/rbuild/backend/mingw/compilers/gcc.mak b/reactos/tools/rbuild/backend/mingw/compilers/gcc.mak index ad4aebf9351..36857302df9 100644 --- a/reactos/tools/rbuild/backend/mingw/compilers/gcc.mak +++ b/reactos/tools/rbuild/backend/mingw/compilers/gcc.mak @@ -12,6 +12,12 @@ CPPFLAG_UNICODE:=-DUNICODE -D_UNICODE BUILTIN_CFLAGS+= -fno-optimize-sibling-calls BUILTIN_CXXFLAGS+= -fno-optimize-sibling-calls +# Add -fno-set-stack-executable required for x86/MinGW +ifneq (,$(filter $(ARCH),amd64 i386)) + BUILTIN_CFLAGS+= -fno-set-stack-executable + BUILTIN_CXXFLAGS+= -fno-set-stack-executable +endif + #(module, source, dependencies, cflags, output) define RBUILD_DEPENDS diff --git a/reactos/tools/rbuild/backend/mingw/linkers/ld.mak b/reactos/tools/rbuild/backend/mingw/linkers/ld.mak index dbba33ea4f6..cbcc2bc0edb 100644 --- a/reactos/tools/rbuild/backend/mingw/linkers/ld.mak +++ b/reactos/tools/rbuild/backend/mingw/linkers/ld.mak @@ -1,5 +1,6 @@ -LDFLAG_DLL:=-shared -LDFLAG_DRIVER:=-shared --subsystem=native +# -exclude-all-symbols disables autoexporting all symbols *if none were found* (either in a DEF file or using __declspec(dllexport) +LDFLAG_DLL:=-shared -exclude-all-symbols +LDFLAG_DRIVER:=-shared --subsystem=native -exclude-all-symbols LDFLAG_NOSTDLIB:=-nostartfiles -nostdlib LDFLAG_CONSOLE:=--subsystem=console LDFLAG_WINDOWS:=--subsystem=windows @@ -40,7 +41,7 @@ $(1)_CLEANFILES+=${call RBUILD_intermediate_dir,$(5)}$$(SEP)$(1)_objs.rsp $(5): ${call RBUILD_intermediate_dir,$(5)}$$(SEP)$(1)_objs.rsp $(7) $(3) $$(RSYM_TARGET) $$(PEFIXUP_TARGET) | ${call RBUILD_dir,$(5)} $$(ECHO_LD) #~ $${ld} --entry=$(8) --image-base=$(9) @${call RBUILD_intermediate_dir,$(5)}$$(SEP)$(1)_objs.rsp $(7) ${call RBUILD_ldflags,$(1),$(4)} -o $$@ - $${ld} --entry=$(8) --image-base=$(9) @${call RBUILD_intermediate_dir,$(5)}$$(SEP)$(1)_objs.rsp $(10) $(7) $(10) ${call RBUILD_ldflags,$(1),$(4)} -o $$@ + $${ld} --entry=$(8) --image-base=$(9) @${call RBUILD_intermediate_dir,$(5)}$$(SEP)$(1)_objs.rsp --start-group $(10) $(7) --end-group ${call RBUILD_ldflags,$(1),$(4)} -o $$@ ifneq ($(or $(6),$$(MODULETYPE$$($(1)_TYPE)_KMODE)),) $$(ECHO_PEFIXUP) $$(Q)$$(PEFIXUP_TARGET) $$@ $(if $(6),-exports) $$(if $$(MODULETYPE$($(1)_TYPE)_KMODE),-sections) diff --git a/reactos/tools/rbuild/backend/mingw/mingw.cpp b/reactos/tools/rbuild/backend/mingw/mingw.cpp index 770e395562d..597b26baad5 100644 --- a/reactos/tools/rbuild/backend/mingw/mingw.cpp +++ b/reactos/tools/rbuild/backend/mingw/mingw.cpp @@ -480,8 +480,11 @@ MingwBackend::GenerateGlobalVariables () const fputs ( "BUILTIN_CXXINCLUDES+= $(TARGET_CPPFLAGS)\n", fMakefile ); fprintf ( fMakefile, "PROJECT_CCLIBS := \"$(shell ${TARGET_CC} -print-libgcc-file-name)\"\n" ); - fprintf ( fMakefile, "PROJECT_CXXLIBS := \"$(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" ); - + + // We use our proprietary "ofmt_stub.a" to implement a stub for "_get_output_format" required by "libmingwex.a". + // This archive just contains the compiled "ofmt_stub.s" supplied with the MinGW Runtime sources. + fprintf ( fMakefile, "PROJECT_CXXLIBS := \"$(shell ${TARGET_CPP} -print-file-name=libstdc++.a)\" \"$(shell ${TARGET_CPP} -print-libgcc-file-name)\" \"$(shell ${TARGET_CPP} -print-file-name=libmingw32.a)\" \"$(shell ${TARGET_CPP} -print-file-name=libmingwex.a)\" \"$(shell ${TARGET_CPP} -print-file-name=ofmt_stub.a)\" \"$(shell ${TARGET_CPP} -print-file-name=libcoldname.a)\"\n" ); + /* hack to get libgcc_eh.a, should check mingw version or something */ if (Environment::GetArch() == "amd64") { @@ -844,7 +847,7 @@ MingwBackend::GetVersionString ( const string& versionCommand ) buffer[i] = '\0'; pclose ( fp ); - char separators[] = " ()"; + char separators[] = " ()\n"; char *token; char *prevtoken = NULL; @@ -888,7 +891,7 @@ MingwBackend::GetNetwideAssemblerVersion ( const string& nasmCommand ) string MingwBackend::GetCompilerVersion ( const string& compilerCommand ) { - string versionCommand = ssprintf ( "%s --version gcc", + string versionCommand = ssprintf ( "%s --version", compilerCommand.c_str (), NUL, NUL ); @@ -908,7 +911,7 @@ MingwBackend::GetBinutilsVersion ( const string& binutilsCommand ) bool MingwBackend::IsSupportedCompilerVersion ( const string& compilerVersion ) { - if ( strcmp ( compilerVersion.c_str (), "3.4.2") < 0 ) + if ( strcmp ( compilerVersion.c_str (), "4.4.0") < 0 ) return false; else return true; @@ -970,27 +973,32 @@ MingwBackend::GetBinutilsVersionDate ( const string& binutilsCommand ) bool MingwBackend::IsSupportedBinutilsVersion ( const string& binutilsVersion ) { - if ( manualBinutilsSetting ) return true; - - /* linux */ - if ( binutilsVersion.find('.') != std::string::npos ) + int digit = binutilsVersion.find_last_of("."); + if(digit == -1) { - /* TODO: blacklist versions on version number instead of date */ - return true; - } - - /* - * - Binutils older than 2003/10/01 have broken windres which can't handle - * icons with alpha channel. - * - Binutils between 2004/09/02 and 2004/10/08 have broken handling of - * forward exports in dlltool. - */ - if ( ( ( strcmp ( binutilsVersion.c_str (), "20040902") >= 0 ) && - ( strcmp ( binutilsVersion.c_str (), "20041008") <= 0 ) ) || - ( strcmp ( binutilsVersion.c_str (), "20031001") < 0 ) ) + printf("Unable to detect binutils version!\n"); return false; + } + + string date = string(binutilsVersion, digit + 1); + if(date.length() == 8) + { + /* This is a real date in the format YYYYMMDD. + Check whether we have at least Binutils 20091016 (the oldest one + we were still using after upgrading to RosBE 1.5). */ + if(strcmp(date.c_str(), "20091016") < 0) + return false; + } else - return true; + { + /* This is no date, so binutilsVersion should just contain the version + number. + Binutils 2.20 will hopefully contain the required features. */ + if(strcmp(binutilsVersion.c_str(), "2.20") < 0) + return false; + } + + return true; } void diff --git a/reactos/tools/rbuild/backend/mingw/rules.mak b/reactos/tools/rbuild/backend/mingw/rules.mak index 13da68a5c77..f83f84fe25d 100644 --- a/reactos/tools/rbuild/backend/mingw/rules.mak +++ b/reactos/tools/rbuild/backend/mingw/rules.mak @@ -263,7 +263,7 @@ ${call RBUILD_intermediate_path_noext,$(2)}_c: $(2) $(3) $$(widl_TARGET) | ${cal $$(Q)$$(widl_TARGET) ${call RBUILD_midlflags,$(1),$(4),-I${call RBUILD_dir,$(2)}} -h -H ${call RBUILD_intermediate_path_noext,$(2)}_c.h -c -C ${call RBUILD_intermediate_path_noext,$(2)}_c.c $(2) $${checkpoint} $$@>$(NUL) -${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_c.c,,-fno-unit-at-a-time,${call RBUILD_intermediate_path_noext,$(2)}_c.o} +${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_c.c,,,${call RBUILD_intermediate_path_noext,$(2)}_c.o} endef @@ -279,7 +279,7 @@ ${call RBUILD_intermediate_path_noext,$(2)}_s: $(2) $(3) $$(widl_TARGET) | ${cal $$(Q)$$(widl_TARGET) ${call RBUILD_midlflags,$(1),$(4),-I${call RBUILD_dir,$(2)}} -h -H ${call RBUILD_intermediate_path_noext,$(2)}_s.h -s -S ${call RBUILD_intermediate_path_noext,$(2)}_s.c $(2) $${checkpoint} $$@>$(NUL) -${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_s.c,,-fno-unit-at-a-time,${call RBUILD_intermediate_path_noext,$(2)}_s.o} +${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_s.c,,,${call RBUILD_intermediate_path_noext,$(2)}_s.o} endef @@ -295,7 +295,7 @@ ${call RBUILD_intermediate_path_noext,$(2)}_p: $(2) $(3) $$(widl_TARGET) | ${cal $$(Q)$$(widl_TARGET) ${call RBUILD_midlflags,$(1),$(4),-I${call RBUILD_dir,$(2)}} -h -H ${call RBUILD_intermediate_path_noext,$(2)}_p.h -p -P ${call RBUILD_intermediate_path_noext,$(2)}_p.c $(2) $${checkpoint} $$@>$(NUL) -${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_p.c,,-fno-unit-at-a-time,${call RBUILD_intermediate_path_noext,$(2)}_p.o} +${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_p.c,,,${call RBUILD_intermediate_path_noext,$(2)}_p.o} endef @@ -308,7 +308,7 @@ ${call RBUILD_intermediate_path_noext,$(2)}_i.c: $(2) $(3) $$(widl_TARGET) | ${c $$(ECHO_WIDL) $$(Q)$$(widl_TARGET) ${call RBUILD_midlflags,$(1),$(4),-I${call RBUILD_dir,$(2)}} -u -U $$@ $$< -${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_i.c,,-fno-unit-at-a-time,${call RBUILD_intermediate_path_noext,$(2)}_i.o} +${call RBUILD_CC,$(1),${call RBUILD_intermediate_path_noext,$(2)}_i.c,,,${call RBUILD_intermediate_path_noext,$(2)}_i.o} endef