From fa8aa172ad066ba37dec6b9333e63c93478ec581 Mon Sep 17 00:00:00 2001 From: Robert Flack Date: Mon, 20 Apr 2015 18:07:55 +0000 Subject: [PATCH] Allow specifying tool path/prefix for tests with CROSS_COMPILE. CROSS_COMPILE environment variable is a common convention to specify the path and/or prefix to cross compilation tools (e.g. ar, objcopy). Test Plan: dotest.py $DOTEST_OPTS -t -p 'TestBSDArchives.py|TestBreakpointCommandsFromPython.py|TestFormats.py|TestObjCDynamicValue.py' All of these tests now compile successfully and pass running macosx -> linux using a cross compilation toolchain prefixed by CROSS_COMPILE without requiring changing your PATH. They still pass when run locally on macosx. Differential Revision: http://reviews.llvm.org/D9072 llvm-svn: 235320 --- lldb/test/make/Makefile.rules | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lldb/test/make/Makefile.rules b/lldb/test/make/Makefile.rules index 796e16c..2d146a5 100644 --- a/lldb/test/make/Makefile.rules +++ b/lldb/test/make/Makefile.rules @@ -14,9 +14,10 @@ # # Also might be of interest: # FRAMEWORK_INCLUDES (Darwin only) := -# CFLAGS_EXTRAS += +# CFLAGS_EXTRAS := # LD_EXTRAS := # SPLIT_DEBUG_SYMBOLS := YES +# CROSS_COMPILE := # # And test/functionalities/archives/Makefile: # MAKE_DSYM := NO @@ -84,9 +85,10 @@ ifeq "$(OS)" "Darwin" DS := $(shell xcrun -find -toolchain default dsymutil) DSFLAGS = DSYM = $(EXE).dSYM - AR := libtool + AR := $(CROSS_COMPILE)libtool ARFLAGS := -static -o else + AR := $(CROSS_COMPILE)ar # On non-Apple platforms, -arch becomes -m ARCHFLAG := -m @@ -188,7 +190,7 @@ cxx_linker_notdir = $(if $(findstring clang,$(1)), \ $(subst cc,c++,$(1)))))) cxx_linker = $(if $(findstring /,$(1)),$(join $(dir $(1)), $(call cxx_linker_notdir,$(notdir $(1)))),$(call cxx_linker_notdir,$(1))) -OBJCOPY = objcopy +OBJCOPY := $(CROSS_COMPILE)objcopy #---------------------------------------------------------------------- # Windows specific options -- 2.7.4