OSDN Git Service

BUILD_HOST_64bit=1 to build host tools in 64-bit
authorAndrew Hsieh <andrewhsieh@google.com>
Tue, 28 Feb 2012 05:03:30 +0000 (21:03 -0800)
committerAndrew Hsieh <andrewhsieh@google.com>
Tue, 28 Feb 2012 18:24:39 +0000 (10:24 -0800)
By default we build tool in 32-bit.  This flag allow individual tool and its
dependencies to be built in 64-bit (eg. Emulator).  Fixes to resolve 64-bit
porting issues (in other git) will be submitted seperately.

Change-Id: I486cf7ddac727d3c374ed890857d497c3a69e598

core/combo/HOST_darwin-x86.mk
core/combo/HOST_linux-x86.mk
core/combo/HOST_windows-x86.mk

index 193ec16..198c53f 100644 (file)
 # Configuration for Darwin (Mac OS X) on x86.
 # Included by combo/select.mk
 
-# We build everything in 32-bit, because some host tools are
-# 32-bit-only anyway (emulator, acc), and because it gives us
+ifneq ($(strip $(BUILD_HOST_64bit)),)
+# By default we build everything in 32-bit, because it gives us
 # more consistency between the host tools and the target.
+# BUILD_HOST_64bit=1 overrides it for tool like emulator
+# which can benefit from 64-bit host arch.
+HOST_GLOBAL_CFLAGS += -m64
+HOST_GLOBAL_LDFLAGS += -m64
+else
 HOST_GLOBAL_CFLAGS += -m32
 HOST_GLOBAL_LDFLAGS += -m32
+endif # BUILD_HOST_64bit
 
 # Use the Mac OSX SDK 10.5 if the build host is 10.6
 build_mac_version := $(shell sw_vers -productVersion)
index 7df2893..5974fbf 100644 (file)
@@ -42,11 +42,17 @@ HOST_AR  := $(HOST_SDK_TOOLCHAIN_PREFIX)-ar
 endif # $(HOST_SDK_TOOLCHAIN_PREFIX)-gcc exists
 endif # TARGET_PRODUCT == sdk
 
-# We build everything in 32-bit, because some host tools are
-# 32-bit-only anyway (emulator, acc), and because it gives us
+ifneq ($(strip $(BUILD_HOST_64bit)),)
+# By default we build everything in 32-bit, because it gives us
 # more consistency between the host tools and the target.
+# BUILD_HOST_64bit=1 overrides it for tool like emulator
+# which can benefit from 64-bit host arch.
+HOST_GLOBAL_CFLAGS += -m64
+HOST_GLOBAL_LDFLAGS += -m64
+else
 HOST_GLOBAL_CFLAGS += -m32
 HOST_GLOBAL_LDFLAGS += -m32
+endif # BUILD_HOST_64bit
 
 HOST_GLOBAL_CFLAGS += -fPIC
 HOST_GLOBAL_CFLAGS += \
index 9870998..fe4bd66 100644 (file)
@@ -26,13 +26,19 @@ TOOLS_EXE_SUFFIX := .exe
 ifneq ($(findstring Linux,$(UNAME)),)
 ifneq ($(strip $(USE_MINGW)),)
 HOST_ACP_UNAVAILABLE := true
-TOOLS_PREFIX := /usr/bin/i586-mingw32msvc-
 TOOLS_EXE_SUFFIX :=
 HOST_GLOBAL_CFLAGS += -DUSE_MINGW
+ifneq ($(strip $(BUILD_HOST_64bit)),)
+TOOLS_PREFIX := /usr/bin/amd64-mingw32msvc-
+HOST_C_INCLUDES += /usr/lib/gcc/amd64-mingw32msvc/4.4.2/include
+HOST_GLOBAL_LD_DIRS += -L/usr/amd64-mingw32msvc/lib
+else
+TOOLS_PREFIX := /usr/bin/i586-mingw32msvc-
 HOST_C_INCLUDES += /usr/lib/gcc/i586-mingw32msvc/3.4.4/include
 HOST_GLOBAL_LD_DIRS += -L/usr/i586-mingw32msvc/lib
-endif
-endif
+endif # BUILD_HOST_64bit
+endif # USE_MINGW
+endif # Linux
 
 HOST_CC := $(TOOLS_PREFIX)gcc$(TOOLS_EXE_SUFFIX)
 HOST_CXX := $(TOOLS_PREFIX)g++$(TOOLS_EXE_SUFFIX)