From 188a9dd210e5cbc1db6a31992dc298d143d80526 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 28 Aug 2013 17:01:44 -0700 Subject: [PATCH] Fix compilation issues with libuv on OSX It turns out that gyp (libuv's new build system) wants x64 for a 64-bit x86 architecture and ia32 for a 32-bit architecture, so this performs the relevant mapping and then invokes libuv's configure script with the appropriate target architecture. This can be verified by running make with VERBOSE=1 and seeing that beforehand on a 64-bit build libuv was passed "-arch i386" and now it's passed "-arch x86_64" Closes #8826 --- mk/rt.mk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mk/rt.mk b/mk/rt.mk index 823dfd94c1a..366acb7e379 100644 --- a/mk/rt.mk +++ b/mk/rt.mk @@ -41,6 +41,11 @@ ifneq ($(strip $(findstring snap,$(MAKECMDGOALS))),) SNAP_DEFINES=-DRUST_SNAPSHOT endif +define DEF_LIBUV_ARCH_VAR + LIBUV_ARCH_$(1) = $$(subst i386,ia32,$$(subst x86_64,x64,$$(HOST_$(1)))) +endef +$(foreach t,$(CFG_TARGET_TRIPLES),$(eval $(call DEF_LIBUV_ARCH_VAR,$(t)))) + define DEF_RUNTIME_TARGETS ###################################################################### @@ -170,7 +175,7 @@ LIBUV_NO_LOAD = run-benchmarks.target.mk run-tests.target.mk \ $$(LIBUV_MAKEFILE_$(1)_$(2)): $$(LIBUV_GYP) (cd $(S)src/libuv/ && \ - $$(CFG_PYTHON) ./gyp_uv -f make -Dtarget_arch=$$(HOST_$(1)) -D ninja \ + $$(CFG_PYTHON) ./gyp_uv -f make -Dtarget_arch=$$(LIBUV_ARCH_$(1)) -D ninja \ -Goutput_dir=$$(@D) --generator-output $$(@D)) # XXX: Shouldn't need platform-specific conditions here