auto merge of #9254 : vadimcn/rust/fix-mingw-v4, r=brson

Fix Rust build on mingw v4.0
See #9246 for details.
This commit is contained in:
bors 2013-09-18 02:25:57 -07:00
commit adb638f54d
11 changed files with 44 additions and 3 deletions

View File

@ -28,7 +28,7 @@ LLVM_STAMP_$(1) = $$(CFG_LLVM_BUILD_DIR_$(1))/llvm-auto-clean-stamp
$$(LLVM_CONFIG_$(1)): $$(LLVM_DEPS) $$(LLVM_STAMP_$(1)) $$(LLVM_CONFIG_$(1)): $$(LLVM_DEPS) $$(LLVM_STAMP_$(1))
@$$(call E, make: llvm) @$$(call E, make: llvm)
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV) $$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV_$(1))
$$(Q)touch $$(LLVM_CONFIG_$(1)) $$(Q)touch $$(LLVM_CONFIG_$(1))
endif endif

View File

@ -352,7 +352,7 @@ AR_i686-pc-mingw32=$(AR)
CFG_LIB_NAME_i686-pc-mingw32=$(1).dll CFG_LIB_NAME_i686-pc-mingw32=$(1).dll
CFG_LIB_GLOB_i686-pc-mingw32=$(1)-*.dll CFG_LIB_GLOB_i686-pc-mingw32=$(1)-*.dll
CFG_LIB_DSYM_GLOB_i686-pc-mingw32=$(1)-*.dylib.dSYM CFG_LIB_DSYM_GLOB_i686-pc-mingw32=$(1)-*.dylib.dSYM
CFG_GCCISH_CFLAGS_i686-pc-mingw32 := -Wall -Werror -g -m32 -march=i686 -D_WIN32_WINNT=0x0600 CFG_GCCISH_CFLAGS_i686-pc-mingw32 := -Wall -Werror -g -m32 -march=i686 -D_WIN32_WINNT=0x0600 -I$(CFG_SRC_DIR)src/etc/mingw-fix-include
CFG_GCCISH_CXXFLAGS_i686-pc-mingw32 := -fno-rtti CFG_GCCISH_CXXFLAGS_i686-pc-mingw32 := -fno-rtti
CFG_GCCISH_LINK_FLAGS_i686-pc-mingw32 := -shared -fPIC -g -m32 CFG_GCCISH_LINK_FLAGS_i686-pc-mingw32 := -shared -fPIC -g -m32
CFG_GCCISH_DEF_FLAG_i686-pc-mingw32 := CFG_GCCISH_DEF_FLAG_i686-pc-mingw32 :=
@ -361,6 +361,7 @@ CFG_GCCISH_POST_LIB_FLAGS_i686-pc-mingw32 :=
CFG_DEF_SUFFIX_i686-pc-mingw32 := .mingw32.def CFG_DEF_SUFFIX_i686-pc-mingw32 := .mingw32.def
CFG_INSTALL_NAME_i686-pc-mingw32 = CFG_INSTALL_NAME_i686-pc-mingw32 =
CFG_LIBUV_LINK_FLAGS_i686-pc-mingw32 := -lWs2_32 -lpsapi -liphlpapi CFG_LIBUV_LINK_FLAGS_i686-pc-mingw32 := -lWs2_32 -lpsapi -liphlpapi
CFG_LLVM_BUILD_ENV_i686-pc-mingw32 := CPATH=$(CFG_SRC_DIR)src/etc/mingw-fix-include
CFG_EXE_SUFFIX_i686-pc-mingw32 := .exe CFG_EXE_SUFFIX_i686-pc-mingw32 := .exe
CFG_WINDOWSY_i686-pc-mingw32 := 1 CFG_WINDOWSY_i686-pc-mingw32 := 1
CFG_UNIXY_i686-pc-mingw32 := CFG_UNIXY_i686-pc-mingw32 :=

View File

@ -24,7 +24,7 @@
# working under these assumptions). # working under these assumptions).
# Hack for passing flags into LIBUV, see below. # Hack for passing flags into LIBUV, see below.
LIBUV_FLAGS_i386 = -m32 -fPIC LIBUV_FLAGS_i386 = -m32 -fPIC -I$(S)src/etc/mingw-fix-include
LIBUV_FLAGS_x86_64 = -m64 -fPIC LIBUV_FLAGS_x86_64 = -m64 -fPIC
ifeq ($(OSTYPE_$(1)), linux-androideabi) ifeq ($(OSTYPE_$(1)), linux-androideabi)
LIBUV_FLAGS_arm = -fPIC -DANDROID -std=gnu99 LIBUV_FLAGS_arm = -fPIC -DANDROID -std=gnu99

View File

@ -0,0 +1,6 @@
The purpose of these headers is to fix issues with mingw v4.0, as described in #9246.
This works by adding this directory to GCC include search path before mingw system headers directories,
so we can intercept their inclusions and add missing definitions without having to modify files in mingw/include.
Once mingw fixes all 3 issues mentioned in #9246, this directory and all references to it from rust/mk/* may be removed.

View File

@ -0,0 +1,8 @@
#ifndef _FIX_CXXCONFIG_H
#define _FIX_CXXCONFIG_H 1
#define _GLIBCXX_HAVE_FENV_H 1
#include_next <bits/c++config.h>
#endif

View File

@ -0,0 +1,8 @@
#ifndef _FIX_WINBASE_H
#define _FIX_WINBASE_H 1
#define NTDDK_VERSION NTDDI_VERSION
#include_next <winbase.h>
#endif

View File

@ -0,0 +1,12 @@
#ifndef _FIX_WINSOCK2_H
#define _FIX_WINSOCK2_H 1
#include_next <winsock2.h>
typedef struct pollfd {
SOCKET fd;
short events;
short revents;
} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;
#endif

View File

@ -9,6 +9,7 @@
// except according to those terms. // except according to those terms.
// Test that we ignore modes when calling extern functions. // Test that we ignore modes when calling extern functions.
// xfail-fast #9205
#[deriving(Eq)] #[deriving(Eq)]
struct TwoU64s { struct TwoU64s {

View File

@ -14,6 +14,7 @@
// xfail-fast This works standalone on windows but not with check-fast. // xfail-fast This works standalone on windows but not with check-fast.
// possibly because there is another test that uses this extern fn but gives it // possibly because there is another test that uses this extern fn but gives it
// a different signature // a different signature
// xfail-fast #9205
#[deriving(Eq)] #[deriving(Eq)]
struct TwoU64s { struct TwoU64s {

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// xfail-fast #9205
struct TwoU64s { struct TwoU64s {
one: u64, two: u64 one: u64, two: u64
} }

View File

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// xfail-fast #9205
pub struct Quad { a: u64, b: u64, c: u64, d: u64 } pub struct Quad { a: u64, b: u64, c: u64, d: u64 }
pub struct Floats { a: f64, b: u8, c: f64 } pub struct Floats { a: f64, b: u8, c: f64 }