diff --git a/Makefile.in b/Makefile.in index 7e84f9a49f9..564fd5ab0ba 100644 --- a/Makefile.in +++ b/Makefile.in @@ -196,6 +196,7 @@ COMPILER_INPUTS := $(wildcard $(addprefix $(S)src/comp/, \ # LLVM macros ###################################################################### +# Any rules that depend on LLVM should depend on LLVM_CONFIG LLVM_CONFIG:=$(CFG_LLVM_INST_DIR)/bin/llvm-config LLVM_VERSION=$(shell "$(LLVM_CONFIG)" --version) LLVM_BINDIR=$(shell "$(LLVM_CONFIG)" --bindir) @@ -206,8 +207,8 @@ LLVM_LDFLAGS=$(shell "$(LLVM_CONFIG)" --ldflags) LLVM_CXXFLAGS=$(shell "$(LLVM_CONFIG)" --cxxflags) LLVM_HOST_TRIPLE=$(shell "$(LLVM_CONFIG)" --host-target) -LLVM_AS=$(CFG_LLVM_BINDIR)/llvm-as$(X) -LLC=$(CFG_LLVM_BINDIR)/llc$(X) +LLVM_AS=$(LLVM_BINDIR)/llvm-as$(X) +LLC=$(LLVM_BINDIR)/llc$(X) ###################################################################### # Exports for sub-utilities diff --git a/configure b/configure index ebdea8c89be..c0625cf8601 100755 --- a/configure +++ b/configure @@ -204,7 +204,7 @@ esac case $CFG_CPUTYPE in i386 | i486 | i686 | i786 | x86) - CFG_CPUTYPE=i686 + CFG_CPUTYPE=i386 ;; xscale | arm) @@ -212,7 +212,8 @@ case $CFG_CPUTYPE in ;; x86_64 | x86-64 | x64) - CFG_CPUTYPE=x86_64 + # FIME: Once we do a 64-bit build this should be x86_64 + CFG_CPUTYPE=i386 ;; *) @@ -306,17 +307,17 @@ fi if [ ! -z "$CFG_LLVM_ROOT" -a -e "$CFG_LLVM_ROOT/bin/llvm-config" ] then - step_msg "using custom LLVM" + step_msg "using custom LLVM at $CFG_LLVM_ROOT" LLVM_CONFIG="$CFG_LLVM_ROOT/bin/llvm-config" - LLVM_VERSION=$($CFG_LLVM_CONFIG --version) + LLVM_VERSION=$($LLVM_CONFIG --version) case $LLVM_VERSION in (3.0svn | 3.0 | 3.1svn) - step_msg "found ok version of LLVM: $CFG_LLVM_VERSION" + step_msg "found ok version of LLVM: $LLVM_VERSION" ;; (*) - err "bad LLVM version: $CFG_LLVM_VERSION, need >=3.0svn" + err "bad LLVM version: $LLVM_VERSION, need >=3.0svn" ;; esac fi diff --git a/mk/platform.mk b/mk/platform.mk index f712e043cd4..f1dfd824e1e 100644 --- a/mk/platform.mk +++ b/mk/platform.mk @@ -39,7 +39,7 @@ endif ifneq ($(findstring linux,$(CFG_OSTYPE)),) CFG_LIB_NAME=lib$(1).so - CFG_GCCISH_CFLAGS += -fPIC -march=i686 + CFG_GCCISH_CFLAGS += -fPIC CFG_GCCISH_LINK_FLAGS += -shared -fPIC -ldl -lpthread -lrt CFG_GCCISH_DEF_FLAG := -Wl,--export-dynamic,--dynamic-list= CFG_GCCISH_PRE_LIB_FLAGS := -Wl,-whole-archive diff --git a/mk/rustllvm.mk b/mk/rustllvm.mk index 4b16bff7d30..0ed9c55e694 100644 --- a/mk/rustllvm.mk +++ b/mk/rustllvm.mk @@ -26,8 +26,7 @@ rustllvm/$(1)/$(CFG_RUSTLLVM): $$(RUSTLLVM_OBJS_OBJS_$(1)) \ $$(CFG_GCCISH_POST_LIB_FLAGS) \ $$(LLVM_LDFLAGS),$$(RUSTLLVM_DEF_$(1)),$$(CFG_RUSTLLVM)) -rustllvm/$(1)/%.o: rustllvm/%.cpp $$(MKFILES) \ - $$(CFG_LLVM_INST_DIR)/bin/llvm-config +rustllvm/$(1)/%.o: rustllvm/%.cpp $$(MKFILES) $$(LLVM_CONFIG) @$$(call E, compile: $$@) $$(Q)$$(call CFG_COMPILE_C_$(1), $$@, $$(LLVM_CXXFLAGS) $$(RUSTLLVM_INCS_$(1))) $$< endef diff --git a/mk/target.mk b/mk/target.mk index af31a937ec0..ad6b8cc31db 100644 --- a/mk/target.mk +++ b/mk/target.mk @@ -12,7 +12,8 @@ $$(TARGET_LIB$(1)$(2))/intrinsics.ll: \ @$$(call E, sed: $$@) $$(Q)sed s/@CFG_TARGET_TRIPLE@/$(2)/ $$< > $$@ -$$(TARGET_LIB$(1)$(2))/intrinsics.bc: $$(TARGET_LIB$(1)$(2))/intrinsics.ll +$$(TARGET_LIB$(1)$(2))/intrinsics.bc: $$(TARGET_LIB$(1)$(2))/intrinsics.ll \ + $$(LLVM_CONFIG) @$$(call E, llvms-as: $$@) $$(Q)$$(LLVM_AS) -o $$@ $$<