3 # Copyright (c) 2012 The Native Client Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
10 # The script is located in "native_client/tests/spec2k"
13 if [[ $(basename "$(pwd)") != "spec2k" ]] ; then
14 echo "ERROR: cannot find the spec2k/ directory"
18 # TODO(pdox): Remove this dependency.
19 source ../../pnacl/scripts/common-tools.sh
20 readonly NACL_ROOT="$(GetAbsolutePath "../../")"
21 SetScriptPath "$(pwd)/run_all.sh"
22 SetLogDirectory "${NACL_ROOT}/toolchain/test-log"
23 readonly TESTS_ARCHIVE=arm-spec.tar.gz
25 ######################################################################
27 ######################################################################
28 # TODO(robertm): make this configurable from the commandline
30 readonly LIST_INT_C="164.gzip 175.vpr 176.gcc 181.mcf 186.crafty 197.parser \
31 253.perlbmk 254.gap 255.vortex 256.bzip2 300.twolf"
33 readonly LIST_FP_C="177.mesa 179.art 183.equake 188.ammp"
35 readonly LIST_INT_CPP="252.eon"
37 SPEC2K_BENCHMARKS="${LIST_FP_C} ${LIST_INT_C} ${LIST_INT_CPP}"
39 # One of {./run.train.sh, ./run.ref.sh}
40 SPEC2K_SCRIPT="./run.train.sh"
42 # uncomment this to disable verification
43 # verification time will be part of overall benchmarking time
45 export VERIFY=${VERIFY:-yes}
46 export MAKEOPTS=${MAKEOPTS:-}
48 # Helper script to process timing / other perf data.
49 # Export these paths to Makefile.common, which will be included by other
50 # Makefiles in random sub-directories (where pwd will be different).
51 export PERF_LOGGER="$(pwd)/emit_perf_log.sh"
52 export COMPILE_REPEATER="$(pwd)/compile_repeater.sh"
53 # Number of times to repeat a timed step.
54 export SPEC_RUN_REPETITIONS=${SPEC_RUN_REPETITIONS:-1}
55 export SPEC_COMPILE_REPETITIONS=${SPEC_COMPILE_REPETITIONS:-1}
57 export PNACL_LIBMODE=${PNACL_LIBMODE:-newlib}
61 ######################################################################
63 ######################################################################
65 readonly SCONS_OUT="${NACL_ROOT}/scons-out"
66 readonly TC_ROOT="${NACL_ROOT}/toolchain"
68 readonly ARM_TRUSTED_TC="${TC_ROOT}/linux_arm-trusted"
69 readonly QEMU_TOOL="${ARM_TRUSTED_TC}/run_under_qemu_arm"
72 "${TC_ROOT}/pnacl_${BUILD_PLATFORM}_${BUILD_ARCH}/${PNACL_LIBMODE}"
73 readonly ARM_LLC_NEXE=${TC_ROOT}/pnacl_translator/armv7/bin/pnacl-llc.nexe
75 readonly NNACL_TC="${TC_ROOT}/${SCONS_BUILD_PLATFORM}_x86"
76 readonly RUNNABLE_LD_X8632="${NNACL_TC}/x86_64-nacl/lib32/runnable-ld.so"
77 readonly RUNNABLE_LD_X8664="${NNACL_TC}/x86_64-nacl/lib/runnable-ld.so"
83 # If the PNaCl toolchain is installed, prefer to use its "size".
84 # TODO(robertm): standardize on one of the pnacl dirs
85 if [ -d "${PNACL_TC}/../host/bin/" ] ; then
86 GNU_SIZE="${PNACL_TC}/../host/bin/arm-pc-nacl-size"
87 elif [ -d "${PNACL_TC}/../pkg/binutils/bin/" ] ; then
88 GNU_SIZE="${PNACL_TC}/../pkg/binutils/bin/arm-pc-nacl-size"
89 elif ${BUILD_PLATFORM_LINUX} ; then
92 # There's nothing we can run here.
93 # The system might have "size" installed, but if it is not GNU,
94 # there's no guarantee it can handle ELF.
100 ######################################################################
102 ######################################################################
104 #@ run_all.sh <mode> <mode-arg>*
106 #@ ------------------------------------------------------------
108 #@ ------------------------------------------------------------
110 # Setups for building (but not running) Pexes only. Used for arm-hw translator
111 # testing where pexes are build on x86 and translated on arm
112 SetupPnaclPexeOpt() {
113 SUFFIX=opt.stripped.pexe
117 SUFFIX=unopt.stripped.pexe
122 #@ use system compiler for x86-32
130 #@ use system compiler for x86-32 with optimization
138 #@ use system compiler for x86-64
146 #@ use system compiler for x86-64 with optimization
154 #@ use Emscripten emcc compiler for Asm.js JavaScript generation
156 PREFIX=../run_asmjs.sh
162 ######################################################################
164 SetupNaclX8632Common() {
170 #@ use nacl-gcc compiler
178 #@ use nacl-gcc compiler with optimizations
179 SetupNaclX8632Opt() {
181 SUFFIX=nacl.opt.x8632
184 SetupNaclX8664Common() {
190 #@ use nacl-gcc64 compiler
198 #@ use nacl-gcc64 compiler with optimizations
199 SetupNaclX8664Opt() {
201 SUFFIX=nacl.opt.x8664
204 SetupNaclDynX8632Common() {
205 SetupSelLdr x86-32 "" "-s" "${RUNNABLE_LD_X8632}"
210 #@ use nacl-gcc compiler with glibc toolchain and dynamic linking
211 SetupNaclDynX8632() {
212 SetupNaclDynX8632Common
213 SUFFIX=nacl.dyn.x8632
217 #@ SetupNaclDynX8632Opt
218 #@ use nacl-gcc compiler with glibc toolchain and dynamic linking
219 SetupNaclDynX8632Opt() {
220 SetupNaclDynX8632Common
221 SUFFIX=nacl.dyn.opt.x8632
224 SetupNaclDynX8664Common() {
225 SetupSelLdr x86-64 "" "-s" "${RUNNABLE_LD_X8664}"
230 #@ use nacl64-gcc compiler with glibc toolchain and dynamic linking
231 SetupNaclDynX8664() {
232 SetupNaclDynX8664Common
233 SUFFIX=nacl.dyn.x8664
237 #@ SetupNaclDynX8664Opt
238 #@ use nacl64-gcc compiler with glibc toolchain and dynamic linking
239 SetupNaclDynX8664Opt() {
240 SetupNaclDynX8664Common
241 SUFFIX=nacl.dyn.opt.x8664
244 ######################################################################
246 SetupPnaclX8664Common() {
252 #@ use pnacl x86-64 compiler (no lto)
254 SetupPnaclX8664Common
259 #@ SetupPnaclX8664Opt
260 #@ use pnacl x86-64 compiler (with lto)
261 SetupPnaclX8664Opt() {
262 SetupPnaclX8664Common
263 SUFFIX=pnacl.opt.x8664
267 #@ SetupPnaclX8664ZBSOpt
268 #@ use pnacl x86-64 compiler (with lto)
269 #@ use x86-64 zero-based sandbox
270 SetupPnaclX8664ZBSOpt() {
271 SetupSelLdr x86-64 "" "-c"
272 # TODO(arbenson): Give this a different suffix to differentitate
273 # from the existing x86-64 build, and make the corresponding
274 # changes to the build process.
275 SUFFIX=pnacl.opt.x8664
279 #@ SetupPnaclTranslatorX8664
280 #@ use pnacl x8664 translator (no lto)
281 SetupPnaclTranslatorX8664() {
282 SetupPnaclX8664Common
283 SUFFIX=pnacl_translator.x8664
287 #@ SetupPnaclTranslatorX8664Opt
288 #@ use pnacl x8664 translator (with lto)
289 SetupPnaclTranslatorX8664Opt() {
290 SetupPnaclX8664Common
291 SUFFIX=pnacl_translator.opt.x8664
295 #@ SetupPnaclTranslatorFastX8664Opt
296 #@ use pnacl x8664 translator fast mode (with lto)
297 SetupPnaclTranslatorFastX8664Opt() {
298 SetupPnaclX8664Common
299 SUFFIX=pnacl_translator_fast.opt.x8664
304 SetupPnaclTranslatorJITX8632Common() {
305 SetupSelLdr x86-32 "" "-S" "${RUNNABLE_LD_X8632} -- --library-path ${NNACL_TC}/x86_64-nacl/lib32 ${NACL_ROOT}/toolchain/pnacl_linux_x86/glibc/tools-sb/x8632/nonsrpc/bin/lli.x8632.nexe -asm-verbose=false -march=x86 -mcpu=pentium4 -mtriple=i686-none-nacl-gnu -jit-emit-debug=false -disable-lazy-compilation"
311 #@ SetupPnaclTranslatorJITX8632
312 #@ use pnacl x8632 JIT translator (no lto)
313 SetupPnaclTranslatorJITX8632() {
314 SetupPnaclTranslatorJITX8632Common
319 #@ SetupPnaclTranslatorJITX8632Opt
320 #@ use pnacl x8632 JIT translator
321 SetupPnaclTranslatorJITX8632Opt() {
322 SetupPnaclTranslatorJITX8632Common
323 SUFFIX=opt.stripped.pexe
326 SetupPnaclX8632Common() {
332 #@ use pnacl x86-32 compiler (no lto)
334 SetupPnaclX8632Common
339 #@ SetupPnaclX8632Opt
340 #@ use pnacl x86-32 compiler (with lto)
341 SetupPnaclX8632Opt() {
342 SetupPnaclX8632Common
343 SUFFIX=pnacl.opt.x8632
348 #@ SetupPnaclTranslatorX8632
349 #@ use pnacl x8632 translator (no lto)
350 SetupPnaclTranslatorX8632() {
351 SetupPnaclX8632Common
352 SUFFIX=pnacl_translator.x8632
356 #@ SetupPnaclTranslatorX8632Opt
357 #@ use pnacl x8632 translator (with lto)
358 SetupPnaclTranslatorX8632Opt() {
359 SetupPnaclX8632Common
360 SUFFIX=pnacl_translator.opt.x8632
364 #@ SetupPnaclTranslatorFastX8632Opt
365 #@ use pnacl x8632 translator fast mode (with lto)
366 SetupPnaclTranslatorFastX8632Opt() {
367 SetupPnaclX8632Common
368 SUFFIX=pnacl_translator_fast.opt.x8632
374 #@ use gcc cross compiler
376 PREFIX="${QEMU_TOOL}"
382 #@ use gcc cross compiler
384 PREFIX="${QEMU_TOOL}"
389 SetupPnaclArmCommon() {
390 SetupSelLdr arm "${QEMU_TOOL}" "-Q"
395 #@ use pnacl arm compiler (with lto) -- run with QEMU
403 #@ use pnacl arm compiler (no lto) -- run with QEMU
410 #@ SetupPnaclTranslatorArm
411 #@ use pnacl arm translator (no lto)
412 SetupPnaclTranslatorArm() {
414 SUFFIX=pnacl_translator.arm
418 #@ SetupPnaclTranslatorArmOpt
419 #@ use pnacl arm translator (with lto)
420 SetupPnaclTranslatorArmOpt() {
422 SUFFIX=pnacl_translator.opt.arm
426 #@ SetupPnaclTranslatorFastArmOpt
427 #@ use pnacl arm translator fast mode (with lto)
428 SetupPnaclTranslatorFastArmOpt() {
430 SUFFIX=pnacl_translator_fast.opt.arm
435 SetupPnaclArmCommonHW() {
440 #@ SetupPnaclArmOptHW
441 #@ use pnacl arm compiler (with lto) -- run on ARM hardware
442 SetupPnaclArmOptHW() {
443 SetupPnaclArmCommonHW
449 #@ use pnacl arm compiler (no lto) -- run on ARM hardware
451 SetupPnaclArmCommonHW
456 #@ SetupPnaclTranslatorArmHW
457 #@ use pnacl arm translator (no lto) -- run on ARM hardware
458 SetupPnaclTranslatorArmHW() {
459 SetupPnaclArmCommonHW
460 SUFFIX=pnacl_translator.hw.arm
464 #@ SetupPnaclTranslatorArmOptHW
465 #@ use pnacl arm translator (with lto) -- run on ARM hardware
466 SetupPnaclTranslatorArmOptHW() {
467 SetupPnaclArmCommonHW
468 SUFFIX=pnacl_translator.opt.hw.arm
472 #@ SetupPnaclTranslatorFastArmOptHW
473 #@ use pnacl arm translator fast mode (with lto) -- run on ARM hardware
474 SetupPnaclTranslatorFastArmOptHW() {
475 SetupPnaclArmCommonHW
476 SUFFIX=pnacl_translator_fast.opt.hw.arm
481 SubBanner "Config Info"
482 echo "benchmarks: $(GetBenchmarkList "$@")"
483 echo "script: $(GetInputSize "$@")"
484 echo "suffix ${SUFFIX}"
485 echo "verify ${VERIFY}"
486 echo "prefix ${PREFIX}"
490 ######################################################################
491 # Functions intended to be called
492 ######################################################################
494 #@ ------------------------------------------------------------
496 #@ ------------------------------------------------------------
501 #@ Show available benchmarks
503 if [[ $# -ge 1 ]]; then
504 if [[ ($1 == "ref") || ($1 == "train") ]]; then
509 if [[ ($# == 0) || ($1 == "all") ]] ; then
510 echo "${SPEC2K_BENCHMARKS[@]}"
517 #+ GetInputSize [train|ref]
519 #+ Picks input size for spec runs (train or ref)
521 if [[ $# -ge 1 ]]; then
524 echo "./run.train.sh"
533 echo ${SPEC2K_SCRIPT}
537 #+ CheckFileBuilt <depname> <file> -
539 #+ Check that a dependency is actually built.
543 if [[ ! -x "${filename}" ]] ; then
544 echo "You have not built ${depname} yet (${filename})!" 1>&2
550 #+ SetupSelLdr <arch> <prefix> <extra_flags> <preload>
552 #+ Set up PREFIX to run sel_ldr on <arch>.
553 #+ <prefix> precedes sel_ldr in the command.
554 #+ <extra_flags> are additional flags to sel_ldr.
555 #+ <preload> is used as the actual nexe to load, making the real nexe an arg.
559 local extra_flags="${3-}"
560 local preload="${4-}"
562 local staging="${SCONS_OUT}/opt-${SCONS_BUILD_PLATFORM}-${arch}/staging"
563 SEL_LDR="${staging}/sel_ldr"
564 SEL_LDR_BOOTSTRAP="${staging}/nacl_helper_bootstrap"
565 CheckFileBuilt "sel_ldr" "${SEL_LDR}"
566 CheckFileBuilt "bootstrap" "${SEL_LDR_BOOTSTRAP}"
568 IRT_IMAGE="${SCONS_OUT}/nacl_irt-${arch}/staging/irt_core.nexe"
569 CheckFileBuilt "IRT image" "${IRT_IMAGE}"
571 local validator_bin="ncval"
572 if [[ ${arch} = "arm" ]]; then
573 validator_bin="arm-ncval-core"
575 VALIDATOR="${staging}/${validator_bin}"
576 # We don't CheckFileBuilt for VALIDATOR because we currently don't build
579 TEMPLATE_DIGITS="XXXXXXXXXXXXXXXX"
580 PREFIX="${prefix} ${SEL_LDR_BOOTSTRAP} \
581 ${SEL_LDR} --r_debug=0x${TEMPLATE_DIGITS} \
582 --reserved_at_zero=0x${TEMPLATE_DIGITS} -B ${IRT_IMAGE} \
583 -a ${extra_flags} -f ${preload}"
587 SCONS_COMMON="./scons --mode=opt-host,nacl -j8 --verbose"
589 EnableX8664ZeroBasedSandbox() {
590 export NACL_ENABLE_INSECURE_ZERO_BASED_SANDBOX=1
595 local runtime_pieces=$2
596 local extra_flags="${3-}"
597 for platform in ${platforms} ; do
598 echo "build-runtime: scons ${runtime_pieces} [${platform}]"
600 ${SCONS_COMMON} ${extra_flags} platform=${platform} ${runtime_pieces})
607 for platform in ${platforms} ; do
608 echo "build-libs-nacl: scons build_lib [${platform}] $*"
610 ${SCONS_COMMON} platform=${platform} build_lib "$@")
616 # TODO(dschuff/jvoung): fix this circular dependency with the toolchain build
617 TOOLCHAIN_LABEL=pnacl_linux_x86 pnacl/build.sh sdk newlib
622 #@ CleanBenchmarks <benchmark>*
624 #@ this is a deep clean and you have to rerun PopulateFromSpecHarness
626 local list=$(GetBenchmarkList "$@")
628 for i in ${list} ; do
629 SubBanner "Cleaning: $i"
638 #@ BuildBenchmarks <do_timing> <setup> <benchmark>*
640 #@ Build all benchmarks according to the setup
641 #@ First arg should be either 0 (no timing) or 1 (run timing measure).
642 #@ Results are delivered to {execname}.compile_time
650 local list=$(GetBenchmarkList "$@")
652 for i in ${list} ; do
653 SubBanner "Building: $i"
655 # SPEC_COMPONENT is used for Asm.js builds in Makefile.common.
656 export SPEC_COMPONENT="${i}"
658 make ${MAKEOPTS} measureit=${timeit} \
659 PERF_LOGGER="${PERF_LOGGER}" \
660 REPETITIONS="${SPEC_COMPILE_REPETITIONS}" \
661 COMPILE_REPEATER="${COMPILE_REPEATER}" \
662 BUILD_PLATFORM=${BUILD_PLATFORM} \
663 SCONS_BUILD_PLATFORM=${SCONS_BUILD_PLATFORM} \
664 BUILD_ARCH=${BUILD_ARCH} \
665 PNACL_LIBMODE=${PNACL_LIBMODE} \
672 #@ TimedRunCmd <time_result_file> {actual_cmd }
674 #@ Run the command under time and dump time data to file.
678 /usr/bin/time -f "%U %S %e %C" --append -o "${target}" "$@"
682 #@ RunBenchmarks <setup> [ref|train] <benchmark>*
684 #@ Run all benchmarks according to the setup.
690 local list=$(GetBenchmarkList "$@")
691 local script=$(GetInputSize "$@")
693 for i in ${list} ; do
694 SubBanner "Benchmarking: $i"
696 target_file=./${i#*.}.${SUFFIX}
697 gnu_size ${target_file}
698 # SCRIPTNAME is needed by run_asmjs.sh so that it knows
699 # which version of the prepackaged files to use.
700 export SCRIPTNAME="${script}"
701 ${script} ${target_file}
708 #@ RunTimedBenchmarks <setup> [ref|train] <benchmark>*
710 #@ Run all benchmarks according to the setup.
711 #@ All timing related files are stored in {execname}.run_time
712 #@ Note that the VERIFY variable effects the timing!
713 RunTimedBenchmarks() {
717 local list=$(GetBenchmarkList "$@")
718 local script=$(GetInputSize "$@")
721 for i in ${list} ; do
722 SubBanner "Benchmarking: $i"
724 local benchname=${i#*.}
725 local target_file=./${benchname}.${SUFFIX}
726 local time_file=${target_file}.run_time
727 gnu_size ${target_file}
728 # SCRIPTNAME is needed by run_asmjs.sh so that it knows
729 # which version of the prepackaged files to use.
730 export SCRIPTNAME="${script}"
731 # Clear out the previous times.
733 echo "Running benchmark ${SPEC_RUN_REPETITIONS} times"
734 for ((i=0; i<${SPEC_RUN_REPETITIONS}; i++))
736 TimedRunCmd ${time_file} ${script} ${target_file}
738 # TODO(jvoung): split runtimes by arch as well
739 # i.e., pull "arch" out of SUFFIX and add to the "runtime" label.
740 "${PERF_LOGGER}" LogRealTime "${time_file}" "runtime" \
741 ${benchname} ${SUFFIX}
750 local list=$(GetBenchmarkList "$@")
752 SubBanner "Validating: $i"
754 local benchname=${i#*.}
755 local target_file=./${benchname}.${SUFFIX}
756 local time_file=${target_file}.validation_time
758 for ((i=0; i<${SPEC_RUN_REPETITIONS}; i++))
760 TimedRunCmd ${time_file} "${VALIDATOR}" ${target_file}
762 "${PERF_LOGGER}" LogRealTime "${time_file}" "validationtime" \
763 ${benchname} ${SUFFIX}
766 if [[ ${setup_func} =~ "Arm" ]]; then
767 TimedRunCmd llc.validation_time "${VALIDATOR}" "${ARM_LLC_NEXE}"
768 "${PERF_LOGGER}" LogRealTime llc.validation_time "validationtime" \
774 #@ BuildAndRunBenchmarks <setup> [ref|train] <benchmark>*
776 #@ Builds and run all benchmarks according to the setup
777 BuildAndRunBenchmarks() {
780 BuildBenchmarks 0 ${setup} "$@"
781 RunBenchmarks ${setup} "$@"
785 #@ TimedBuildAndRunBenchmarks <setup> [ref|train] <benchmark>*
787 #@ Builds and run all benchmarks according to the setup, using
788 #@ and records the time spent at each task..
789 #@ Results are saved in {execname}.compile_time and
790 #@ {execname}.run_time for each benchmark executable
791 #@ Note that the VERIFY variable effects the timing!
792 TimedBuildAndRunBenchmarks() {
795 BuildBenchmarks 1 ${setup} "$@"
796 RunTimedBenchmarks ${setup} "$@"
800 #@ PackageArmBinaries [usual var-args for RunBenchmarks]
802 #@ Archives ARM binaries built from a local QEMU run of spec
804 #@ Note: <setup> should be the QEMU setup (e.g., SetupPnaclArmOpt)
805 #@ Note: As with the other modes in this script, this script should be
806 #@ run from the directory of the script (not the native_client directory).
808 PackageArmBinaries() {
809 local BENCH_LIST=$(GetBenchmarkList "$@")
811 local UNZIPPED_TAR=$(basename ${TESTS_ARCHIVE} .gz)
813 # Switch to native_client directory (from tests/spec2k) so that
814 # when we extract, the builder will have a more natural directory layout.
816 # Carefully tar only the parts of the spec harness that we need.
818 find tests/spec2k -name '*.bc' -delete
819 find tests/spec2k -maxdepth 1 -type f -print |
820 xargs tar --no-recursion -cvf ${UNZIPPED_TAR}
821 tar -rvf ${UNZIPPED_TAR} tests/spec2k/bin
822 for i in ${BENCH_LIST} ; do
823 tar -rvf ${UNZIPPED_TAR} tests/spec2k/$i
825 gzip -f ${UNZIPPED_TAR}
830 #@ Unpack a packaged archive of ARM SPEC binaries. The archive is
831 #@ located in the nacl root directory, but the script is run from the spec dir.
832 UnpackArmBinaries() {
834 tar xvzf ${TESTS_ARCHIVE})
837 GetTestArchiveName() {
838 echo ${TESTS_ARCHIVE}
842 #@ PopulateFromSpecHarness <path> <benchmark>*
844 #@ populate a few essential directories (src, date) from
845 #@ the given spec2k harness
846 PopulateFromSpecHarness() {
849 cp -r ${harness}/bin .
850 local list=$(GetBenchmarkList "$@")
852 for i in ${list} ; do
853 SubBanner "Populating: $i"
854 # fix the dir with the same name inside spec harness
855 src=$(find -H ${harness} -name $i)
856 # copy relevant dirs over
859 cp -r ${src}/data ${src}/src $i
861 if [[ -e $i/diff ]] ; then
863 patch -d $i --verbose -p0 < $i/diff
871 #@ BuildPrerequisites <platform> <bitcode>
873 #@ Invoke scons to build some potentially missing components, e.g.
874 #@ sel_ldr, sel_universal, irt, some untrusted libraries.
875 #@ Those compoents should be present in the SDK but are not in the
876 #@ standard toolchain tarballs.
877 BuildPrerequisites() {
880 local extrabuild="${3-}"
881 local extra_flags="${4-}"
882 # Sel universal is only used for the pnacl sandboxed translator,
883 # but prepare it just in case.
884 # IRT is used both to run the tests and to run the pnacl sandboxed translator.
885 build-runtime "${platforms}" "sel_ldr sel_universal irt_core ${extrabuild}" \
887 if [ ${bitcode} == "bitcode" ] ; then
890 # libs may be unnecessary for the glibc build, but build it just in case.
891 build-libs-nacl "${platforms}"
896 #@ BuildPrerequisitesSetupBased <setup>
898 #@ Convenience wrapper for BuildPrerequisites
899 BuildPrerequisitesSetupBased() {
902 if [[ "$1" == SetupPnacl* ]] ; then
905 if [[ "$1" == Setup*Arm* ]] ; then
907 elif [[ "$1" == Setup*X8632* ]] ; then
909 elif [[ "$1" == Setup*X8664* ]] ; then
912 echo "Bad setup [$1]"
915 BuildPrerequisites "${platforms}" "${bitcode}"
917 ######################################################################
919 ######################################################################
921 [ $# = 0 ] && set -- help # Avoid reference to undefined $1.
923 if [ "$(type -t $1)" != "function" ]; then
925 echo "ERROR: unknown mode '$1'." >&2