Index: CMakeLists.txt =================================================================== --- CMakeLists.txt +++ CMakeLists.txt @@ -19,6 +19,12 @@ set(LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION ${LLDB_DEFAULT_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION} CACHE BOOL "Enables using new Python scripts for SWIG API generation .") +# Determine the native architecture. +string(TOLOWER "${LLVM_TARGET_ARCH}" LLDB_TARGET_ARCH) +if( LLDB_TARGET_ARCH STREQUAL "host" ) + string(REGEX MATCH "^[^-]*" LLDB_TARGET_ARCH ${LLVM_HOST_TRIPLE}) +endif () + # If we are not building as a part of LLVM, build LLDB as an # standalone project, using LLVM as an external library: if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) Index: test/CMakeLists.txt =================================================================== --- test/CMakeLists.txt +++ test/CMakeLists.txt @@ -15,17 +15,15 @@ string(REGEX REPLACE ".*ccache\ +" "" LLDB_TEST_COMPILER ${CMAKE_C_COMPILER} ${CMAKE_C_COMPILER_ARG1}) endif() -# Users can override LLDB_TEST_ARGS to modify the way LLDB tests are run. See help below. -set(LLDB_TEST_ARGS - -C - ${LLDB_TEST_COMPILER} - CACHE STRING "Specify compiler(s) and architecture(s) with which run LLDB tests. For example: '-C gcc -C clang -A i386 -A x86_64'" - ) -string(REPLACE " " ";" LLDB_TEST_ARGS ${LLDB_TEST_ARGS}) -set(LLDB_TRACE_DIR "${CMAKE_BINARY_DIR}/lldb-test-traces" - CACHE STRING "Set directory to output LLDB test traces (for tests that do not pass.)" - ) +set(LLDB_TEST_EXECUTABLE_ARCH ${LLDB_TARGET_ARCH}) +STRING(TOLOWER "${LLDB_TEST_EXECUTABLE_ARCH}" LLDB_TEST_EXECUTABLE_ARCH) + +set(LLDB_TEST_EXECUTABLE_ARCH_ARGS "--arch=${LLDB_TEST_EXECUTABLE_ARCH}") + +# Users can override LLDB_TEST_ARGS to modify the way LLDB tests are run. See help below. +set(LLDB_TEST_ARGS ${LLDB_TEST_EXECUTABLE_ARCH_ARGS} -C ${LLDB_TEST_COMPILER}) +set(LLDB_TRACE_DIR "${CMAKE_BINARY_DIR}/lldb-test-traces") set(LLDB_COMMON_TEST_ARGS --executable @@ -36,15 +34,15 @@ -u CFLAGS ) +set(LLDB_TEST_ARGS ${LLDB_COMMON_TEST_ARGS} ${LLDB_TEST_ARGS}) + add_python_test_target(check-lldb-single ${LLDB_SOURCE_DIR}/test/dotest.py - "${LLDB_COMMON_TEST_ARGS};${LLDB_TEST_ARGS}" - "Testing LLDB with args: ${LLDB_COMMON_TEST_ARGS};${LLDB_TEST_ARGS}" + "${LLDB_TEST_ARGS}" + "Testing LLDB with args: ${LLDB_TEST_ARGS}" ) -set(LLDB_DOSEP_ARGS - -o;\"-q;${LLDB_COMMON_TEST_ARGS};${LLDB_TEST_ARGS}\" - ) +set(LLDB_DOSEP_ARGS -o;\"-q;${LLDB_TEST_ARGS}\") # If tests crash cause LLDB to crash, or things are otherwise unstable, or if machine-parsable # output is desired (i.e. in continuous integration contexts) check-lldb-sep is a better target. Index: test/dotest.py =================================================================== --- test/dotest.py +++ test/dotest.py @@ -578,10 +578,7 @@ if arch.startswith('arm') and platform_system == 'Darwin': os.environ['SDKROOT'] = commands.getoutput('xcodebuild -version -sdk iphoneos.internal Path') else: - if (platform_system == 'Darwin' or (platform_system == 'Linux' and compilers == ['clang'])) and platform_machine == 'x86_64': - archs = ['x86_64', 'i386'] - else: - archs = [platform_machine] + archs = [platform_machine] if args.categoriesList: categoriesList = set(validate_categories(args.categoriesList)) Index: test/make/Makefile.rules =================================================================== --- test/make/Makefile.rules +++ test/make/Makefile.rules @@ -73,15 +73,22 @@ # On non-Apple platforms, -arch becomes -m ARCHFLAG := -m - # i386 becomes 32, and amd64 or x86_64 becomes 64 + # i386,i686 -> 32 + # amd64, x86_64, x64 -> 64 ifeq "$(ARCH)" "amd64" - override ARCH := $(subst amd64,64,$(ARCH)) + override ARCH := $(subst amd64,64,$(ARCH)) endif ifeq "$(ARCH)" "x86_64" - override ARCH := $(subst x86_64,64,$(ARCH)) + override ARCH := $(subst x86_64,64,$(ARCH)) + endif + ifeq "$(ARCH)" "x64" + override ARCH := $(subst x64,64,$(ARCH)) endif ifeq "$(ARCH)" "i386" - override ARCH := $(subst i386,32,$(ARCH)) + override ARCH := $(subst i386,32,$(ARCH)) + endif + ifeq "$(ARCH)" "i686" + override ARCH := $(subst i686,32,$(ARCH)) endif ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES"