[PATCH] D15207: [test-suite] Add some cross-compile options.
Chad Rosier via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 3 14:12:23 PST 2015
mcrosier created this revision.
mcrosier added reviewers: MatzeB, rnk.
mcrosier added a subscriber: llvm-commits.
The variables HOST_C_COMPILER and HOST_CXX_COMPILER define the compiler
used for compiling timeit and fpcmp, if defined, otherwise they default
to the compiler under test.
The value of variable TEST_SUITE_EXE_WRAPPER, if present, is passed to
RunSafely.sh 's -u parameter, to wrap the test execution within. This is
mainly intended to be used while cross-compiling to run under an
emulator.
(I'm submitting this on behalf of a fellow engineer, so please be kind to the messenger :)
Chad
http://reviews.llvm.org/D15207
Files:
CMakeLists.txt
lit.cfg
lit.site.cfg.in
tools/CMakeLists.txt
Index: tools/CMakeLists.txt
===================================================================
--- tools/CMakeLists.txt
+++ tools/CMakeLists.txt
@@ -1,6 +1,18 @@
add_executable(timeit-target timeit.c)
-# FIXME: These need to be host-compiled, if we're cross compiling.
+# FIXME: Set the host compiler more properly
+if(NOT HOST_C_COMPILER)
+ SET(HOST_C_COMPILER "cc")
+endif()
+if(NOT HOST_CXX_COMPILER)
+ SET(HOST_CXX_COMPILER "c++")
+endif()
+
+SET(CMAKE_C_COMPILER ${HOST_C_COMPILER})
+SET(CMAKE_CXX_COMPILER ${HOST_CXX_COMPILER})
+SET(CMAKE_C_FLAGS "-O2")
+SET(CMAKE_CXX_FLAGS "-O2")
+
# FIXME: Replicate Makefile.tools's logic for determining whether to use fpcmp/fpcmp.sh
add_executable(fpcmp fpcmp.c)
add_executable(timeit timeit.c)
Index: lit.site.cfg.in
===================================================================
--- lit.site.cfg.in
+++ lit.site.cfg.in
@@ -6,5 +6,6 @@
config.remote_host = "@TEST_SUITE_REMOTE_HOST@"
config.remote_user = "@TEST_SUITE_REMOTE_USER@"
config.remote_port = "@TEST_SUITE_REMOTE_PORT@"
+config.exe_wrapper = "@TEST_SUITE_EXE_WRAPPER@"
lit_config.load_config(config, "@CMAKE_SOURCE_DIR@/lit.cfg")
Index: lit.cfg
===================================================================
--- lit.cfg
+++ lit.cfg
@@ -118,6 +118,8 @@
runsafely_prefix += [ "-rc", config.remote_client ]
if config.remote_port:
runsafely_prefix += [ "-rp", config.remote_port ]
+ if config.exe_wrapper:
+ runsafely_prefix += [ "-u", config.exe_wrapper ]
timeit = "%s/tools/timeit-target" % config.test_source_root
timeout = "7200"
runsafely_prefix += [ "-t", timeit, timeout, stdin, outfile ]
Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -39,6 +39,9 @@
set(TEST_SUITE_REMOTE_PORT "" CACHE STRING "Remote execution port")
mark_as_advanced(TEST_SUITE_REMOTE_USER TEST_SUITE_REMOTE_PORT)
+# Execution wrapper configuration (will be set in lit.site.cfg)
+set(TEST_SUITE_EXE_WRAPPER "" CACHE STRING "Execution wrapper")
+
include(MakefileFunctions)
include(SingleMultiSource)
find_package(YACC)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15207.41801.patch
Type: text/x-patch
Size: 2177 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151203/69655030/attachment.bin>
More information about the llvm-commits
mailing list