From 26774f2b729d791c9dbf5ba0f7fcf4a59e3795a5 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Sat, 21 Nov 2009 19:54:02 +0000 Subject: Make the kconfig-style build work in mingw: * use relative paths in ldscript.ld and crt0_includes.h * avoid use of dd(1) in xcompile * build libregex for kconfig, if necessary * work around missing utsname on win32 * unlink targets before rename on win32 * implement (crude) mkstemp for win32 * avoid open/read/close, use fopen/fread/fclose instead * don't free certain data structures in romcc on win32 to avoid crashes (likely use-after-free()) * handle "\CRLF" and win32 style absolute paths (X:/ or X:\) in romcc * make lzma (part of cbfstool) build on XP * implement ntohl/htonl on win32 * handle CRLF in awk script * set larger stack for romcc on win32 Signed-off-by: Patrick Georgi Acked-by: Peter Stuge git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4952 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/cbfstool/cbfs-mkpayload.c | 1 - util/cbfstool/common.h | 6 ++++++ util/cbfstool/lzma/C/Common/Alloc.cpp | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'util/cbfstool') diff --git a/util/cbfstool/cbfs-mkpayload.c b/util/cbfstool/cbfs-mkpayload.c index cdc5ffbb4f..baa92ff237 100644 --- a/util/cbfstool/cbfs-mkpayload.c +++ b/util/cbfstool/cbfs-mkpayload.c @@ -27,7 +27,6 @@ #include #include #include -#include #include "common.h" #include "cbfs.h" diff --git a/util/cbfstool/common.h b/util/cbfstool/common.h index ede06e5340..e149444d38 100644 --- a/util/cbfstool/common.h +++ b/util/cbfstool/common.h @@ -17,6 +17,12 @@ */ #include +#ifndef WIN32 +#include +#else +#define ntohl(x) (((x)>>24) | ((x)<<24) | (((x)>>8)&0xff00) | (((x)<<8)&0xff0000)) +#define htonl ntohl +#endif extern void *offset; extern struct cbfs_header *master_header; diff --git a/util/cbfstool/lzma/C/Common/Alloc.cpp b/util/cbfstool/lzma/C/Common/Alloc.cpp index e2b8c3d289..6220a84f23 100644 --- a/util/cbfstool/lzma/C/Common/Alloc.cpp +++ b/util/cbfstool/lzma/C/Common/Alloc.cpp @@ -96,7 +96,7 @@ void *BigAlloc(size_t size) throw() if (size >= (1 << 18)) { void *res = ::VirtualAlloc(0, (size + g_LargePageSize - 1) & (~(g_LargePageSize - 1)), - MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE); + MEM_COMMIT, PAGE_READWRITE); if (res != 0) return res; } -- cgit v1.2.3