162306a36Sopenharmony_ci# 262306a36Sopenharmony_ci# Example config for cross compiling 362306a36Sopenharmony_ci# 462306a36Sopenharmony_ci# In this config, it is expected that the tool chains from: 562306a36Sopenharmony_ci# 662306a36Sopenharmony_ci# https://kernel.org/pub/tools/crosstool/files/bin/x86_64/ 762306a36Sopenharmony_ci# 862306a36Sopenharmony_ci# running on a x86_64 system have been downloaded and installed into: 962306a36Sopenharmony_ci# 1062306a36Sopenharmony_ci# /usr/local/ 1162306a36Sopenharmony_ci# 1262306a36Sopenharmony_ci# such that the compiler binaries are something like: 1362306a36Sopenharmony_ci# 1462306a36Sopenharmony_ci# /usr/local/gcc-4.5.2-nolibc/mips-linux/bin/mips-linux-gcc 1562306a36Sopenharmony_ci# 1662306a36Sopenharmony_ci# Some of the archs will use gcc-4.5.1 instead of gcc-4.5.2 1762306a36Sopenharmony_ci# this config uses variables to differentiate them. 1862306a36Sopenharmony_ci# 1962306a36Sopenharmony_ci# Comments describe some of the options, but full descriptions of 2062306a36Sopenharmony_ci# options are described in the samples.conf file. 2162306a36Sopenharmony_ci 2262306a36Sopenharmony_ci# ${PWD} is defined by ktest.pl to be the directory that the user 2362306a36Sopenharmony_ci# was in when they executed ktest.pl. It may be better to hardcode the 2462306a36Sopenharmony_ci# path name here. THIS_DIR is the variable used through out the config file 2562306a36Sopenharmony_ci# in case you want to change it. 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ciTHIS_DIR := ${PWD} 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ci# Update the BUILD_DIR option to the location of your git repo you want to test. 3062306a36Sopenharmony_ciBUILD_DIR = ${THIS_DIR}/linux.git 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ci# The build will go into this directory. It will be created when you run the test. 3362306a36Sopenharmony_ciOUTPUT_DIR = ${THIS_DIR}/cross-compile 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ci# The build will be compiled with -j8 3662306a36Sopenharmony_ciBUILD_OPTIONS = -j8 3762306a36Sopenharmony_ci 3862306a36Sopenharmony_ci# The test will not stop when it hits a failure. 3962306a36Sopenharmony_ciDIE_ON_FAILURE = 0 4062306a36Sopenharmony_ci 4162306a36Sopenharmony_ci# If you want to have ktest.pl store the failure somewhere, uncomment this option 4262306a36Sopenharmony_ci# and change the directory where ktest should store the failures. 4362306a36Sopenharmony_ci#STORE_FAILURES = ${THIS_DIR}/failures 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ci# The log file is stored in the OUTPUT_DIR called cross.log 4662306a36Sopenharmony_ci# If you enable this, you need to create the OUTPUT_DIR. It wont be created for you. 4762306a36Sopenharmony_ciLOG_FILE = ${OUTPUT_DIR}/cross.log 4862306a36Sopenharmony_ci 4962306a36Sopenharmony_ci# The log file will be cleared each time you run ktest. 5062306a36Sopenharmony_ciCLEAR_LOG = 1 5162306a36Sopenharmony_ci 5262306a36Sopenharmony_ci# As some archs do not build with the defconfig, they have been marked 5362306a36Sopenharmony_ci# to be ignored. If you want to test them anyway, change DO_FAILED to 1. 5462306a36Sopenharmony_ci# If a test that has been marked as DO_FAILED passes, then you should change 5562306a36Sopenharmony_ci# that test to be DO_DEFAULT 5662306a36Sopenharmony_ci 5762306a36Sopenharmony_ciDO_FAILED := 0 5862306a36Sopenharmony_ciDO_DEFAULT := 1 5962306a36Sopenharmony_ci 6062306a36Sopenharmony_ci# By setting both DO_FAILED and DO_DEFAULT to zero, you can pick a single 6162306a36Sopenharmony_ci# arch that you want to test. (uncomment RUN and chose your arch) 6262306a36Sopenharmony_ci#RUN := arm 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_ci# At the bottom of the config file exists a bisect test. You can update that 6562306a36Sopenharmony_ci# test and set DO_FAILED and DO_DEFAULT to zero, and uncomment this variable 6662306a36Sopenharmony_ci# to run the bisect on the arch. 6762306a36Sopenharmony_ci#RUN := bisect 6862306a36Sopenharmony_ci 6962306a36Sopenharmony_ci# By default all tests will be running gcc 4.5.2. Some tests are using 4.5.1 7062306a36Sopenharmony_ci# and they select that in the test. 7162306a36Sopenharmony_ci# Note: GCC_VER is declared as on option and not a variable ('=' instead of ':=') 7262306a36Sopenharmony_ci# This is important. A variable is used only in the config file and if it is set 7362306a36Sopenharmony_ci# it stays that way for the rest of the config file until it is change again. 7462306a36Sopenharmony_ci# Here we want GCC_VER to remain persistent and change for each test, as it is used in 7562306a36Sopenharmony_ci# the MAKE_CMD. By using '=' instead of ':=' we achieve our goal. 7662306a36Sopenharmony_ci 7762306a36Sopenharmony_ciGCC_VER = 4.5.2 7862306a36Sopenharmony_ciMAKE_CMD = PATH=/usr/local/gcc-${GCC_VER}-nolibc/${CROSS}/bin:$PATH CROSS_COMPILE=${CROSS}- make ARCH=${ARCH} 7962306a36Sopenharmony_ci 8062306a36Sopenharmony_ci# all tests are only doing builds. 8162306a36Sopenharmony_ciTEST_TYPE = build 8262306a36Sopenharmony_ci 8362306a36Sopenharmony_ci# If you want to add configs on top of the defconfig, you can add those configs into 8462306a36Sopenharmony_ci# the add-config file and uncomment this option. This is useful if you want to test 8562306a36Sopenharmony_ci# all cross compiles with PREEMPT set, or TRACING on, etc. 8662306a36Sopenharmony_ci#ADD_CONFIG = ${THIS_DIR}/add-config 8762306a36Sopenharmony_ci 8862306a36Sopenharmony_ci# All tests are using defconfig 8962306a36Sopenharmony_ciBUILD_TYPE = defconfig 9062306a36Sopenharmony_ci 9162306a36Sopenharmony_ci# The test names will have the arch and cross compiler used. This will be shown in 9262306a36Sopenharmony_ci# the results. 9362306a36Sopenharmony_ciTEST_NAME = ${ARCH} ${CROSS} 9462306a36Sopenharmony_ci 9562306a36Sopenharmony_ci# alpha 9662306a36Sopenharmony_ciTEST_START IF ${RUN} == alpha || ${DO_DEFAULT} 9762306a36Sopenharmony_ci# Notice that CROSS and ARCH are also options and not variables (again '=' instead 9862306a36Sopenharmony_ci# of ':='). This is because TEST_NAME and MAKE_CMD wil use them for each test. 9962306a36Sopenharmony_ci# Only options are available during runs. Variables are only present in parsing the 10062306a36Sopenharmony_ci# config file. 10162306a36Sopenharmony_ciCROSS = alpha-linux 10262306a36Sopenharmony_ciARCH = alpha 10362306a36Sopenharmony_ci 10462306a36Sopenharmony_ci# arm 10562306a36Sopenharmony_ciTEST_START IF ${RUN} == arm || ${DO_DEFAULT} 10662306a36Sopenharmony_ciCROSS = arm-unknown-linux-gnueabi 10762306a36Sopenharmony_ciARCH = arm 10862306a36Sopenharmony_ci 10962306a36Sopenharmony_ci# ia64 11062306a36Sopenharmony_ciTEST_START IF ${RUN} == ia64 || ${DO_DEFAULT} 11162306a36Sopenharmony_ciCROSS = ia64-linux 11262306a36Sopenharmony_ciARCH = ia64 11362306a36Sopenharmony_ci 11462306a36Sopenharmony_ci# m68k fails with error? 11562306a36Sopenharmony_ciTEST_START IF ${RUN} == m68k || ${DO_DEFAULT} 11662306a36Sopenharmony_ciCROSS = m68k-linux 11762306a36Sopenharmony_ciARCH = m68k 11862306a36Sopenharmony_ci 11962306a36Sopenharmony_ci# mips64 12062306a36Sopenharmony_ciTEST_START IF ${RUN} == mips || ${RUN} == mips64 || ${DO_DEFAULT} 12162306a36Sopenharmony_ciCROSS = mips64-linux 12262306a36Sopenharmony_ciARCH = mips 12362306a36Sopenharmony_ci 12462306a36Sopenharmony_ci# mips32 12562306a36Sopenharmony_ciTEST_START IF ${RUN} == mips || ${RUN} == mips32 || ${DO_DEFAULT} 12662306a36Sopenharmony_ciCROSS = mips-linux 12762306a36Sopenharmony_ciARCH = mips 12862306a36Sopenharmony_ci 12962306a36Sopenharmony_ci# parisc64 failed? 13062306a36Sopenharmony_ciTEST_START IF ${RUN} == hppa || ${RUN} == hppa64 || ${DO_FAILED} 13162306a36Sopenharmony_ciCROSS = hppa64-linux 13262306a36Sopenharmony_ciARCH = parisc 13362306a36Sopenharmony_ci 13462306a36Sopenharmony_ci# parisc 13562306a36Sopenharmony_ciTEST_START IF ${RUN} == hppa || ${RUN} == hppa32 || ${DO_FAILED} 13662306a36Sopenharmony_ciCROSS = hppa-linux 13762306a36Sopenharmony_ciARCH = parisc 13862306a36Sopenharmony_ci 13962306a36Sopenharmony_ci# ppc 14062306a36Sopenharmony_ciTEST_START IF ${RUN} == ppc || ${RUN} == ppc32 || ${DO_DEFAULT} 14162306a36Sopenharmony_ciCROSS = powerpc-linux 14262306a36Sopenharmony_ciARCH = powerpc 14362306a36Sopenharmony_ci 14462306a36Sopenharmony_ci# ppc64 14562306a36Sopenharmony_ciTEST_START IF ${RUN} == ppc || ${RUN} == ppc64 || ${DO_DEFAULT} 14662306a36Sopenharmony_ciCROSS = powerpc64-linux 14762306a36Sopenharmony_ciARCH = powerpc 14862306a36Sopenharmony_ci 14962306a36Sopenharmony_ci# s390 15062306a36Sopenharmony_ciTEST_START IF ${RUN} == s390 || ${DO_DEFAULT} 15162306a36Sopenharmony_ciCROSS = s390x-linux 15262306a36Sopenharmony_ciARCH = s390 15362306a36Sopenharmony_ci 15462306a36Sopenharmony_ci# sh 15562306a36Sopenharmony_ciTEST_START IF ${RUN} == sh || ${DO_DEFAULT} 15662306a36Sopenharmony_ciCROSS = sh4-linux 15762306a36Sopenharmony_ciARCH = sh 15862306a36Sopenharmony_ci 15962306a36Sopenharmony_ci# sparc64 16062306a36Sopenharmony_ciTEST_START IF ${RUN} == sparc || ${RUN} == sparc64 || ${DO_DEFAULT} 16162306a36Sopenharmony_ciCROSS = sparc64-linux 16262306a36Sopenharmony_ciARCH = sparc64 16362306a36Sopenharmony_ci 16462306a36Sopenharmony_ci# sparc 16562306a36Sopenharmony_ciTEST_START IF ${RUN} == sparc || ${RUN} == sparc32 || ${DO_DEFAULT} 16662306a36Sopenharmony_ciCROSS = sparc-linux 16762306a36Sopenharmony_ciARCH = sparc 16862306a36Sopenharmony_ci 16962306a36Sopenharmony_ci# xtensa failed 17062306a36Sopenharmony_ciTEST_START IF ${RUN} == xtensa || ${DO_FAILED} 17162306a36Sopenharmony_ciCROSS = xtensa-linux 17262306a36Sopenharmony_ciARCH = xtensa 17362306a36Sopenharmony_ci 17462306a36Sopenharmony_ci# UML 17562306a36Sopenharmony_ciTEST_START IF ${RUN} == uml || ${DO_DEFAULT} 17662306a36Sopenharmony_ciMAKE_CMD = make ARCH=um SUBARCH=x86_64 17762306a36Sopenharmony_ciARCH = uml 17862306a36Sopenharmony_ciCROSS = 17962306a36Sopenharmony_ci 18062306a36Sopenharmony_ciTEST_START IF ${RUN} == x86 || ${RUN} == i386 || ${DO_DEFAULT} 18162306a36Sopenharmony_ciMAKE_CMD = make ARCH=i386 18262306a36Sopenharmony_ciARCH = i386 18362306a36Sopenharmony_ciCROSS = 18462306a36Sopenharmony_ci 18562306a36Sopenharmony_ciTEST_START IF ${RUN} == x86 || ${RUN} == x86_64 || ${DO_DEFAULT} 18662306a36Sopenharmony_ciMAKE_CMD = make ARCH=x86_64 18762306a36Sopenharmony_ciARCH = x86_64 18862306a36Sopenharmony_ciCROSS = 18962306a36Sopenharmony_ci 19062306a36Sopenharmony_ci################################# 19162306a36Sopenharmony_ci 19262306a36Sopenharmony_ci# This is a bisect if needed. You need to give it a MIN_CONFIG that 19362306a36Sopenharmony_ci# will be the config file it uses. Basically, just copy the created defconfig 19462306a36Sopenharmony_ci# for the arch someplace and point MIN_CONFIG to it. 19562306a36Sopenharmony_ciTEST_START IF ${RUN} == bisect 19662306a36Sopenharmony_ciMIN_CONFIG = ${THIS_DIR}/min-config 19762306a36Sopenharmony_ciCROSS = s390x-linux 19862306a36Sopenharmony_ciARCH = s390 19962306a36Sopenharmony_ciTEST_TYPE = bisect 20062306a36Sopenharmony_ciBISECT_TYPE = build 20162306a36Sopenharmony_ciBISECT_GOOD = v3.1 20262306a36Sopenharmony_ciBISECT_BAD = v3.2 20362306a36Sopenharmony_ciCHECKOUT = v3.2 20462306a36Sopenharmony_ci 20562306a36Sopenharmony_ci################################# 20662306a36Sopenharmony_ci 20762306a36Sopenharmony_ci# These defaults are needed to keep ktest.pl from complaining. They are 20862306a36Sopenharmony_ci# ignored because the test does not go pass the build. No install or 20962306a36Sopenharmony_ci# booting of the target images. 21062306a36Sopenharmony_ci 21162306a36Sopenharmony_ciDEFAULTS 21262306a36Sopenharmony_ciMACHINE = crosstest 21362306a36Sopenharmony_ciSSH_USER = root 21462306a36Sopenharmony_ciBUILD_TARGET = cross 21562306a36Sopenharmony_ciTARGET_IMAGE = image 21662306a36Sopenharmony_ciPOWER_CYCLE = cycle 21762306a36Sopenharmony_ciCONSOLE = console 21862306a36Sopenharmony_ciLOCALVERSION = version 21962306a36Sopenharmony_ciGRUB_MENU = grub 22062306a36Sopenharmony_ci 22162306a36Sopenharmony_ciREBOOT_ON_ERROR = 0 22262306a36Sopenharmony_ciPOWEROFF_ON_ERROR = 0 22362306a36Sopenharmony_ciPOWEROFF_ON_SUCCESS = 0 22462306a36Sopenharmony_ciREBOOT_ON_SUCCESS = 0 22562306a36Sopenharmony_ci 226