Visual C++ backend for rbuild (for now just a hacked mingw backend) and related compilation fixes. Just run vcvars.bat from a RosBE console and "make"!

modified   dll/win32/aclui/guid.c
modified   dll/win32/aclui/precomp.h
modified   drivers/bus/acpi/include/actypes.h
modified   drivers/bus/acpi/include/platform/acenv.h
   Miscellaneous compilation fixes

modified   dll/win32/aclui/sidcache.c
   Damn, forgot to commit this to trunk

deleted    include/psdk/intrin.h
added      include/psdk/intrin.h.bak
   intrin.h is positively not a PSDK header

modified   lib/3rdparty/mingw/wcrt1.c
   Port to Visual C++

modified   ReactOS-generic.rbuild
   Use Visual C++'s built-in CRT headers for now

modified   ReactOS-i386.rbuild
   Translate global compiler flags to Visual C++

modified   tools/rbuild/backend/mingw/mingw.cpp
   No need for -pipe in Visual C++
   Disable precompiled headers for now
   Enable a whole lotta warnings, and disable a few. Should move this to a response file somewhere

modified   tools/rbuild/backend/mingw/modulehandler.cpp
   .a -> .lib
   .o -> .obj
   .coff -> .res.obj, fix windres command line to remove the ambiguity
   ${gcc}/${gpp} -> ${cl}, translate command line options
   ECHO_CC -> ECHO_CL
   Pass *_RCFLAGS to gas instead of *_CFLAGS, for now, so that gas only sees includes and defines (in the future we'll have something like *_ASFLAGS)
   Disabled some gcc-specific code for now

modified   tools/rbuild/module.cpp
   .a -> .lib, .o -> .obj, lib<name>.a -> <name>.lib; and why the hell is this in the front-end?

svn path=/branches/the-real-msvc/; revision=36963
This commit is contained in:
KJK::Hyperion
2008-10-25 18:13:25 +00:00
9 changed files with 47 additions and 18 deletions
+2 -2
View File
@@ -64,8 +64,8 @@
<include root="intermediate">include/psdk</include>
<include>include/dxsdk</include>
<include root="intermediate">include/dxsdk</include>
<include>include/crt</include>
<include>include/crt/mingw32</include>
<!--<include>include/crt</include>-->
<!--<include>include/crt/mingw32</include>-->
<include>include/ddk</include>
<include>include/GL</include>
<include>include/ndk</include>
+21 -7
View File
@@ -16,27 +16,41 @@
<property name="NTOSKRNL_SHARED" value="-file-alignment=0x1000 -section-alignment=0x1000 -shared"/>
<if property="OPTIMIZE" value="1">
<!--
<compilerflag>-Os</compilerflag>
<compilerflag>-ftracer</compilerflag>
<compilerflag>-momit-leaf-frame-pointer</compilerflag>
</if>
<if property="OPTIMIZE" value="2">
<compilerflag>-Os</compilerflag>
</if>
<if property="OPTIMIZE" value="3">
-->
<compilerflag>-O1</compilerflag>
</if>
<if property="OPTIMIZE" value="4">
<if property="OPTIMIZE" value="2">
<!--<compilerflag>-Os</compilerflag>-->
<compilerflag>-O2</compilerflag>
</if>
<if property="OPTIMIZE" value="3">
<!--<compilerflag>-O1</compilerflag>-->
<compilerflag>-Ox</compilerflag>
<compilerflag>-Os</compilerflag>
</if>
<if property="OPTIMIZE" value="4">
<!--<compilerflag>-O2</compilerflag>-->
<compilerflag>-Ox</compilerflag>
<compilerflag>-Os</compilerflag>
</if>
<if property="OPTIMIZE" value="5">
<compilerflag>-O3</compilerflag>
<!--<compilerflag>-O3</compilerflag>-->
<compilerflag>-Ox</compilerflag>
<compilerflag>-Os</compilerflag>
</if>
<!--
<compilerflag>-mpreferred-stack-boundary=2</compilerflag>
<compilerflag>-fno-strict-aliasing</compilerflag>
<compilerflag>-Wno-strict-aliasing</compilerflag>
<compilerflag>-Wpointer-arith</compilerflag>
-->
<compilerflag>-Oy-</compilerflag>
<compilerflag>-GS-</compilerflag>
<linkerflag>-disable-stdcall-fixup</linkerflag>
</project>
+4 -1
View File
@@ -19,8 +19,11 @@
/* DO NOT USE THE PRECOMPILED HEADER FOR THIS FILE! */
#include <initguid.h>
#include <windows.h>
#include <initguid.h>
#include <objbase.h>
#include <aclui.h>
#include <objsel.h>
+1 -1
View File
@@ -4,7 +4,7 @@
#include <windows.h>
#include <ndk/ntndk.h>
#include <commctrl.h>
#include <oleauto.h>
#include <ole2.h>
#include <objsel.h>
#include <prsht.h>
#include <aclui.h>
+1 -1
View File
@@ -178,7 +178,7 @@ OpenLSAPolicyHandle(IN LPWSTR SystemName,
if (SystemName != NULL && SystemName[0] != L'\0')
{
LsaSystemName.Buffer = SystemName;
LsaSystemName.Length = wcslen(SystemName) * sizeof(WCHAR);
LsaSystemName.Length = (USHORT)(wcslen(SystemName) * sizeof(WCHAR)); /* FIXME: possible overflow */
LsaSystemName.MaximumLength = LsaSystemName.Length + sizeof(WCHAR);
psn = &LsaSystemName;
}
+2 -2
View File
@@ -193,11 +193,11 @@ typedef UINT64 u64;
*/
#ifdef _MSC_VER
typedef ULONGLONG u64;
typedef ULONG u32;
//~ typedef ULONG u32;
typedef USHORT u16;
typedef UCHAR u8;
typedef LONGLONG s64;
typedef LONG s32;
//~ typedef LONG s32;
typedef SHORT s16;
typedef CHAR s8;
#endif
+2 -2
View File
@@ -111,10 +111,10 @@
#elif _AED_EFI
#include "acefi.h"
#elif WIN32
#elif defined(WIN32)
#include "acwin.h"
#elif __FreeBSD__
#elif defined(__FreeBSD__)
#include "acfreebsd.h"
#else
+14 -2
View File
@@ -42,7 +42,7 @@ extern int wmain (int, wchar_t **, wchar_t **);
#define __UNKNOWN_APP 0
#define __CONSOLE_APP 1
#define __GUI_APP 2
__MINGW_IMPORT void __set_app_type(int);
_CRTIMP void __set_app_type(int);
#endif /* __MSVCRT__ */
/* Global _fmode for this .exe, not the one in msvcrt.dll,
@@ -181,7 +181,7 @@ _gnu_exception_handler (EXCEPTION_POINTERS * exception_data)
/*
* The function mainCRTStartup is the entry point for all console programs.
*/
static void __attribute__((noreturn))
static void __declspec(noreturn)
__mingw_wCRTStartup (void)
{
int nRet;
@@ -218,6 +218,7 @@ __mingw_wCRTStartup (void)
_pei386_runtime_relocator ();
#endif
#if defined(__GNUC__)
#if defined(__i386__)
/* Align the stack to 16 bytes for the sake of SSE ops in main
or in functions inlined into main. */
@@ -230,6 +231,17 @@ __mingw_wCRTStartup (void)
asm __volatile__ ("li 0,15\n\tandc 1,1,0" : : : "r1");
#else
#error Unsupported architecture
#endif
#endif
#if defined(_MSC_VER)
#if defined(_M_IX86)
/* Align the stack to 16 bytes for the sake of SSE ops in main
or in functions inlined into main. */
__asm and esp, 0FFFFFFF0h
#else
#error Unsupported architecture
#endif
#endif
/*