Lines Matching +full:build +full:- +full:riscv64 +full:- +full:efi
3 if [ -z "${BASH_VERSINFO[0]}" ] || [ "${BASH_VERSINFO[0]}" -lt 4 ] ; then
4 echo "Error: Bash version 4 or newer is required for the kvm-unit-tests"
15 echo "cortex-a15"
18 echo "cortex-a57"
33 echo "cortex-a15"
35 "arm64" | "riscv32" | "riscv64")
51 arch=$(uname -m | sed -e 's/i.86/i386/;s/arm64/aarch64/;s/arm.*/arm/;s/ppc64.*/ppc64/')
68 efi=
72 # Enable -Werror by default for git repositories only (i.e. developer builds)
73 if [ -e "$srcdir"/.git ]; then
74 werror=-Werror
81 [ -z "$processor" ] && processor=$(get_default_processor $arch)
82 cat <<-EOF
86 --arch=ARCH architecture to compile for ($arch). ARCH can be one of:
87 arm, arm64, i386, ppc64, riscv32, riscv64, s390x, x86_64
88 --processor=PROCESSOR processor to compile for ($processor)
89 --target-cpu=CPU the CPU model to run on. If left unset, the run script
92 --target=TARGET target platform that the tests will be running on (qemu or
94 --cross-prefix=PREFIX cross compiler prefix
95 --cc=CC c compiler to use ($cc)
96 --cflags=FLAGS extra options to be passed to the c compiler
97 --ld=LD ld linker to use ($ld)
98 --prefix=PREFIX where to install things ($prefix)
99 --endian=ENDIAN endianness to compile for (little or big, ppc64 only)
100 --[enable|disable]-pretty-print-stacks
102 --[enable|disable]-default-environ
105 --erratatxt=FILE specify a file to use instead of errata.txt. Use
106 '--erratatxt=' to ensure no file is used.
107 --host-key-document=HOST_KEY_DOCUMENT
108 Specify the machine-specific host-key document for creating
110 --gen-se-header=GEN_SE_HEADER
112 requires --host-key-document. (s390x-snippets only)
113 --[enable|disable]-dump
116 --page-size=PAGE_SIZE
120 --earlycon=EARLYCON
123 the --target option. EARLYCON can be one of (case sensitive):
131 (arm/arm64 and riscv32/riscv64 only)
132 --console=CONSOLE
135 --[enable|disable]-efi Boot and run from UEFI (disabled by default, x86_64 and arm64 only)
136 --[enable|disable]-werror
137 Select whether to compile with the -Werror compiler flag
138 --[enable|disable]-efi-direct
139 Select whether to run EFI tests directly with QEMU's -kernel
140 option. When not enabled, tests will be placed in an EFI file
141 system and run from the UEFI shell. Ignored when efi isn't enabled
142 and defaults to enabled when efi is enabled for riscv64.
143 (arm64 and riscv64 only)
150 while [[ $optno -le $argc ]]; do
159 --prefix)
162 --arch)
165 --processor)
168 --target-cpu)
171 --target)
174 --cross-prefix)
177 --endian)
180 --cc)
184 --cflags)
187 --ld)
190 --enable-pretty-print-stacks)
193 --disable-pretty-print-stacks)
196 --enable-default-environ)
199 --disable-default-environ)
202 --erratatxt)
206 --host-key-document)
209 --gen-se-header)
212 --enable-dump)
215 --disable-dump)
218 --page-size)
221 --earlycon)
224 --console)
227 --enable-efi)
228 efi=y
230 --disable-efi)
231 efi=n
233 --enable-efi-direct)
236 --disable-efi-direct)
239 --enable-werror)
240 werror=-Werror
242 --disable-werror)
245 --help)
256 if [ -z "$cc_selected" ] && [ "$cross_prefix" ]; then
260 if [ -z "$efi" ] || [ "$efi" = "n" ]; then
264 if [ -n "$host_key_document" ] && [ ! -f "$host_key_document" ]; then
269 if [ "$erratatxt" ] && [ ! -f "$erratatxt" ]; then
280 echo "riscv32 or riscv64 must be specified"
284 if [ -z "$target" ]; then
288 echo "--target is not supported for $arch"
293 if [ "$efi" ] && [ "$arch" != "x86_64" ] &&
294 [ "$arch" != "arm64" ] && [ "$arch" != "riscv64" ]; then
295 echo "--[enable|disable]-efi is not supported for $arch"
299 if [ "$efi" ] && [ "$arch" = "riscv64" ] && [ -z "$efi_direct" ]; then
303 if [ -z "$page_size" ]; then
310 if [ "${page_size: -1}" = "K" ] || [ "${page_size: -1}" = "k" ]; then
320 if [ "$efi" = 'y' ] && [ "$page_size" != "4096" ]; then
321 echo "efi must use 4K pages"
330 echo "--page-size is not supported for $arch"
336 IFS=, read -r name type_addr addr <<<"$earlycon"
343 if [ -z "$addr" ]; then
358 if [ -z "$addr" ]; then
362 if [[ $addr =~ ^0(x|X)[0-9a-fA-F]+$ ]] || [[ $addr =~ ^[0-9]+$ ]]; then
370 # $arch will have changed when cross-compiling.
371 [ -z "$processor" ] && processor=$(get_default_processor $arch)
382 echo "--target must be one of 'qemu' or 'kvmtool'!"
392 elif [ "$arch" = "riscv32" ] || [ "$arch" = "riscv64" ]; then
403 if [ ! -d "$srcdir/$testdir" ]; then
408 if [ "$efi" = "y" ] && [ -f "$srcdir/$testdir/efi/run" ]; then
409 ln -fs "$srcdir/$testdir/efi/run" $testdir-run
410 elif [ -f "$srcdir/$testdir/run" ]; then
411 ln -fs "$srcdir/$testdir/run" $testdir-run
415 if [ "$efi" = "y" ]; then
416 testsubdir=$testdir/efi
420 cat << EOF > lib-test.c
423 u32_long=$("$cc" $cflags -E lib-test.c | grep -v '^#' | grep -q long && echo yes)
424 rm -f lib-test.c
428 cat << EOF > lib-test.S
432 wa_divide=$("$cc" $cflags -c lib-test.S >/dev/null 2>&1 || echo yes)
433 rm -f lib-test.{o,S}
437 getopt -T > /dev/null
438 if [ $? -ne 4 ]; then
443 # Are we in a separate build tree? If so, link the Makefile
445 if test ! -e Makefile; then
447 ln -s "$srcdir/Makefile" .
450 mkdir -p $testsubdir
451 ln -sf "$srcdir/$testdir/run" $testdir/
453 ln -sf "$srcdir/$testsubdir/run" $testsubdir/
455 ln -sf "$srcdir/$testdir/unittests.cfg" $testdir/
456 ln -sf "$srcdir/run_tests.sh"
458 if [ -d "$srcdir/$testdir/snippets" ]; then
459 mkdir -p "$testdir/snippets/c"
463 ln -sf "$srcdir/scripts"
467 rm -f lib/asm
468 asm="asm-generic"
469 if [ -d "$srcdir/lib/$arch/asm" ]; then
471 mkdir -p "lib/$arch"
472 elif [ -d "$srcdir/lib/$arch_libdir/asm" ]; then
474 mkdir -p "lib/$arch_libdir"
475 elif [ -d "$srcdir/lib/$testdir/asm" ]; then
477 mkdir -p "lib/$testdir"
479 ln -sf "$asm" lib/asm
480 mkdir -p lib/generated lib/libfdt
514 GENPROTIMG=${GENPROTIMG-genprotimg}
517 CONFIG_EFI=$efi
550 elif [ "$arch" = "riscv32" ] || [ "$arch" = "riscv64" ]; then