embedded-test.sh 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734
  1. #!/bin/sh
  2. # Copyright © 2014
  3. # Waldemar Brodkorb <wbx@openadk.org>
  4. #
  5. # Provided that these terms and disclaimer and all copyright notices
  6. # are retained or reproduced in an accompanying document, permission
  7. # is granted to deal in this work without restriction, including un‐
  8. # limited rights to use, publicly perform, distribute, sell, modify,
  9. # merge, give away, or sublicence.
  10. #
  11. # This work is provided “AS IS” and WITHOUT WARRANTY of any kind, to
  12. # the utmost extent permitted by applicable law, neither express nor
  13. # implied; without malicious intent or gross negligence. In no event
  14. # may a licensor, author or contributor be held liable for indirect,
  15. # direct, other damage, loss, or other issues arising in any way out
  16. # of dealing in the work, even if advised of the possibility of such
  17. # damage or existence of a defect, except proven that it results out
  18. # of said person’s immediate fault when using the work as intended.
  19. #
  20. # Alternatively, this work may be distributed under the Terms of the
  21. # General Public License, any version as published by the Free Soft‐
  22. # ware Foundation.
  23. # architecture specific notes:
  24. # mips64n32/mips64eln32 produces segfaults on boot
  25. # xtensa needs uImage format for initrd
  26. # sheb network card get no ip
  27. ADK_ARCH_LIST="arm armhf m68k-nommu mips mipsel mips64 mips64eln32 mips64n32 mips64n64 mips64el mips64el mips64eln64 ppc-nofpu sh sheb sparc x86 x86_64 xtensa"
  28. BR_ARCH_LIST="bfin arm mips mipsel mips64 mips64el ppc sh sparc x86 x86_64 xtensa"
  29. topdir=$(pwd)
  30. tools='make git wget xz cpio tar awk sed'
  31. f=0
  32. for tool in $tools; do
  33. if ! which $tool >/dev/null; then
  34. echo "Checking if $tool is installed... failed"
  35. f=1
  36. fi
  37. done
  38. if [ $f -eq 1 ];then exit 1; fi
  39. help() {
  40. cat >&2 <<EOF
  41. Syntax: $0 -v <vendor> -l <libc> -s <source> -a <arch>
  42. Explanation:
  43. -v: vendor for buildsystem (openadk|buildroot)
  44. -l: c library to use (uclibc-ng|musl|glibc|uclibc)
  45. -a: architecture to check
  46. -u: update vendor source via git pull
  47. -s: use directory with source for C library
  48. -d: enable debug
  49. -c: clean build directory before build
  50. -n: set NTP server for test run
  51. -b: only run basic bootup test
  52. -t: run libc testsuite
  53. -p: run Linux test project (LTP)
  54. -h: help text
  55. EOF
  56. }
  57. clean=0
  58. shell=0
  59. update=0
  60. debug=0
  61. boot=0
  62. ltp=0
  63. test=0
  64. gcc=0
  65. ntp=time.fu-berlin.de
  66. while getopts "hgptumdcbn:a:v:s:l:" ch; do
  67. case $ch in
  68. b)
  69. boot=1
  70. ;;
  71. p)
  72. ltp=1
  73. ;;
  74. t)
  75. test=1
  76. ;;
  77. m)
  78. shell=1
  79. ;;
  80. g)
  81. gcc=1
  82. ;;
  83. c)
  84. clean=1
  85. ;;
  86. u)
  87. update=1
  88. ;;
  89. s)
  90. source=$OPTARG
  91. ;;
  92. d)
  93. debug=1
  94. ;;
  95. l)
  96. libc=$OPTARG
  97. ;;
  98. n)
  99. ntp=$OPTARG
  100. ;;
  101. a)
  102. archlist=$OPTARG
  103. ;;
  104. v)
  105. vendor=$OPTARG
  106. ;;
  107. h)
  108. help
  109. exit 1
  110. ;;
  111. esac
  112. done
  113. shift $((OPTIND - 1))
  114. if [ -z $vendor ];then
  115. echo "You need to provide a vendor/buildsystem"
  116. echo "Either openadk or buildroot is supported."
  117. exit 1
  118. fi
  119. if [ -z $libc ];then
  120. echo "You need to provide a C library"
  121. echo "Either uclibc-ng, musl, glibc or uClibc is supported."
  122. exit 1
  123. fi
  124. case $libc in
  125. uclibc-ng)
  126. version=1.0.0beta5
  127. libver=uClibc-ng-${version}
  128. ;;
  129. uclibc)
  130. version=0.9.33.2
  131. libver=uClibc-${version}
  132. ;;
  133. glibc)
  134. version=2.19
  135. libver=glibc-${version}
  136. ;;
  137. musl)
  138. version=1.1.4
  139. libver=musl-${version}
  140. ;;
  141. *)
  142. echo "c library not supported"
  143. exit 1
  144. esac
  145. if [ -z $archlist ];then
  146. if [ $vendor = "openadk" ];then
  147. archlist=$ADK_ARCH_LIST
  148. fi
  149. if [ $vendor = "buildroot" ];then
  150. archlist=$BR_ARCH_LIST
  151. fi
  152. fi
  153. case $vendor in
  154. openadk)
  155. echo "Using OpenADK to check $libc on $archlist"
  156. vendor_git=http://git.openadk.org/openadk.git
  157. ;;
  158. buildroot)
  159. echo "Using buildroot to check $libc on $archlist"
  160. vendor_git=http://git.buildroot.net/git/buildroot.git
  161. ;;
  162. *)
  163. echo "Vendor $vendor not supported"
  164. exit 1
  165. ;;
  166. esac
  167. if [ ! -d $vendor ];then
  168. git clone $vendor_git
  169. if [ $? -ne 0 ];then
  170. echo "Cloning from $vendor_git failed."
  171. exit 1
  172. fi
  173. if [ "$vendor" = "buildroot" ];then
  174. wget http://downloads.uclibc-ng.org/buildroot-uClibc-ng.patch
  175. (cd buildroot && patch -p1 <../buildroot-uClibc-ng.patch)
  176. fi
  177. else
  178. if [ $update -eq 1 ];then
  179. (cd $vendor && git pull)
  180. if [ $? -ne 0 ];then
  181. echo "Updating from $vendor_git failed."
  182. exit 1
  183. fi
  184. fi
  185. fi
  186. if [ ! -z $source ];then
  187. usrc=$(mktemp -d /tmp/XXXX)
  188. cp -a $source $usrc/$libver
  189. echo "Creating source tarball $vendor/dl/${libver}.tar.xz"
  190. mkdir -p $topdir/$vendor/dl 2>/dev/null
  191. (cd $usrc && tar cJf $topdir/$vendor/dl/${libver}.tar.xz ${libver} )
  192. fi
  193. runtest() {
  194. arch=$1
  195. qemu=qemu-system-${arch}
  196. qemu_args=
  197. qemu_append="ntp_server=$ntp"
  198. if [ $debug -eq 0 ];then
  199. qemu_append="$qemu_append quiet"
  200. fi
  201. if [ $shell -eq 1 ];then
  202. qemu_append="$qemu_append shell"
  203. fi
  204. suffix=
  205. psuffix=
  206. libdir=lib
  207. march=${arch}
  208. case ${arch} in
  209. arm)
  210. cpu_arch=arm
  211. qemu_machine=vexpress-a9
  212. qemu_args="${qemu_args} -cpu cortex-a9 -net user -net nic,model=lan9118"
  213. suffix=eabi
  214. psuffix=$suffix
  215. ;;
  216. armhf)
  217. cpu_arch=arm
  218. march=arm
  219. qemu=qemu-system-${cpu_arch}
  220. qemu_machine=vexpress-a9
  221. qemu_args="${qemu_args} -cpu cortex-a9 -net user -net nic,model=lan9118"
  222. suffix=eabihf
  223. psuffix=$suffix
  224. ;;
  225. mips)
  226. cpu_arch=mips
  227. qemu_machine=malta
  228. qemu_args="${qemu_args} -device e1000,netdev=adk0 -netdev user,id=adk0"
  229. ;;
  230. mipsel)
  231. cpu_arch=mipsel
  232. march=mips
  233. qemu_machine=malta
  234. qemu_args="${qemu_args} -device e1000,netdev=adk0 -netdev user,id=adk0"
  235. ;;
  236. mips64)
  237. cpu_arch=mips64
  238. qemu_machine=malta
  239. qemu_args="${qemu_args} -device e1000,netdev=adk0 -netdev user,id=adk0"
  240. suffix=abi32
  241. psuffix=o32
  242. ;;
  243. mips64n32)
  244. cpu_arch=mips64
  245. march=mips64
  246. qemu=qemu-system-${cpu_arch}
  247. qemu_machine=malta
  248. qemu_args="${qemu_args} -device e1000,netdev=adk0 -netdev user,id=adk0"
  249. suffix=abin32
  250. psuffix=n32
  251. ;;
  252. mips64n64)
  253. cpu_arch=mips64
  254. march=mips64
  255. qemu=qemu-system-${cpu_arch}
  256. qemu_machine=malta
  257. qemu_args="${qemu_args} -device e1000,netdev=adk0 -netdev user,id=adk0"
  258. suffix=abi64
  259. psuffix=n64
  260. ;;
  261. mips64el)
  262. cpu_arch=mips64el
  263. march=mips64
  264. qemu_machine=malta
  265. qemu_args="${qemu_args} -device e1000,netdev=adk0 -netdev user,id=adk0"
  266. suffix=abi32
  267. psuffix=o32
  268. ;;
  269. mips64eln32)
  270. cpu_arch=mips64el
  271. march=mips64
  272. qemu=qemu-system-${cpu_arch}
  273. qemu_machine=malta
  274. qemu_args="${qemu_args} -device e1000,netdev=adk0 -netdev user,id=adk0"
  275. suffix=abin32
  276. psuffix=n32
  277. ;;
  278. mips64eln64)
  279. cpu_arch=mips64el
  280. march=mips64
  281. qemu=qemu-system-${cpu_arch}
  282. qemu_machine=malta
  283. qemu_args="${qemu_args} -device e1000,netdev=adk0 -netdev user,id=adk0"
  284. suffix=abi64
  285. psuffix=n64
  286. ;;
  287. ppc-nofpu)
  288. cpu_arch=ppc
  289. march=ppc
  290. qemu=qemu-system-${cpu_arch}
  291. qemu_args="${qemu_args} -device e1000,netdev=adk0 -netdev user,id=adk0"
  292. qemu_machine=bamboo
  293. ;;
  294. ppc)
  295. cpu_arch=ppc
  296. march=ppc
  297. qemu=qemu-system-${cpu_arch}
  298. qemu_args="${qemu_args} -device e1000,netdev=adk0 -netdev user,id=adk0"
  299. qemu_machine=mac99
  300. ;;
  301. powerpc64|ppc64)
  302. cpu_arch=ppc64
  303. qemu=qemu-system-${cpu_arch}
  304. qemu_machine=pseries
  305. ;;
  306. sh)
  307. cpu_arch=sh4
  308. qemu=qemu-system-${cpu_arch}
  309. qemu_machine=r2d
  310. qemu_args="${qemu_args} -monitor null -serial null -serial stdio"
  311. ;;
  312. sheb)
  313. cpu_arch=sh4eb
  314. march=sh
  315. qemu=qemu-system-${cpu_arch}
  316. qemu_machine=r2d
  317. qemu_args="${qemu_args} -monitor null -serial null -serial stdio"
  318. ;;
  319. sparc)
  320. cpu_arch=sparc
  321. qemu_machine=SS-5
  322. ;;
  323. sparc64)
  324. cpu_arch=sparc64
  325. qemu_machine=sun4u
  326. qemu_args="${qemu_args} -net nic,model=virtio -net user"
  327. ;;
  328. x86)
  329. cpu_arch=i686
  330. qemu=qemu-system-i386
  331. qemu_machine=pc
  332. qemu_args="${qemu_args} -cpu pentium2"
  333. ;;
  334. x86_64)
  335. cpu_arch=x86_64
  336. qemu_machine=pc
  337. libdir=lib64
  338. ;;
  339. x86_64_x32)
  340. cpu_arch=x86_64
  341. qemu=qemu-system-${cpu_arch}
  342. qemu_machine=pc
  343. libdir=libx32
  344. suffix=x32
  345. ;;
  346. xtensa)
  347. cpu_arch=xtensa
  348. qemu=qemu-system-${cpu_arch}
  349. qemu_machine=lx60
  350. ;;
  351. *)
  352. echo "architecture ${arch} not supported"; exit 1;;
  353. esac
  354. if ! which $qemu >/dev/null; then
  355. echo "Checking if $qemu is installed... failed"
  356. exit 1
  357. fi
  358. qemuver=$(${qemu} -version|awk '{ print $4 }')
  359. if [ $(echo $qemuver |sed -e "s#\.##g" -e "s#,##") -lt 200 ];then
  360. echo "Your qemu version is too old. Please update to 2.0 or greater"
  361. exit 1
  362. fi
  363. if [ "$libc" = "uclibc-ng" ];then
  364. prefix=uclibc
  365. else
  366. prefix=$libc
  367. fi
  368. cross=${cpu_arch}-${vendor}-linux-${prefix}${suffix}
  369. if [ -z $psuffix ];then
  370. TCPATH=${topdir}/${vendor}/toolchain_qemu-${march}_${libc}_${cpu_arch}
  371. else
  372. TCPATH=${topdir}/${vendor}/toolchain_qemu-${march}_${libc}_${cpu_arch}_${psuffix}
  373. fi
  374. export PATH="${TCPATH}/usr/bin:$PATH"
  375. if ! which ${cross}-gcc >/dev/null; then
  376. echo "Checking if ${cross}-gcc is installed... failed"
  377. exit 1
  378. fi
  379. echo "Starting test for ${arch}"
  380. echo "Generating root filesystem for test run"
  381. root=$(mktemp -d /tmp/XXXX)
  382. if [ ! -f openadk/firmware/qemu-${march}_${libc}/qemu-${march}-${libc}-initramfsarchive.tar.gz ];then
  383. echo "No root filesystem available for architecture ${arch}"
  384. exit 1
  385. fi
  386. tar -xf openadk/firmware/qemu-${march}_${libc}/qemu-${march}-${libc}-initramfsarchive.tar.gz -C $root
  387. if [ $2 -eq 0 ];then
  388. cat > ${root}/run.sh << EOF
  389. #!/bin/sh
  390. uname -a
  391. rdate -n \$ntp_server
  392. file /bin/busybox
  393. for i in \$(ls /lib/*.so|grep -v libgcc);do
  394. size \$i
  395. done
  396. exit
  397. EOF
  398. fi
  399. if [ $2 -eq 1 ];then
  400. cat > ${root}/run.sh << EOF
  401. #!/bin/sh
  402. uname -a
  403. rdate -n \$ntp_server
  404. /opt/ltp/runltp
  405. exit
  406. EOF
  407. fi
  408. if [ $2 -eq 2 ];then
  409. cat > ${root}/run.sh << EOF
  410. #!/bin/sh
  411. uname -a
  412. rdate -n \$ntp_server
  413. cd /opt/$libc/test
  414. CROSS_COMPILE=": ||" make UCLIBC_ONLY=y -k run
  415. exit
  416. EOF
  417. fi
  418. chmod u+x ${root}/run.sh
  419. kernel=openadk/firmware/qemu-${march}_${libc}/qemu-${march}-initramfsarchive-kernel
  420. echo "Creating initramfs filesystem"
  421. (cd $root; find . | cpio -o -C512 -Hnewc --quiet |xz --check=crc32 --stdout > ${topdir}/initramfs.${arch})
  422. rm -rf $root
  423. echo "Now running the tests in qemu for architecture ${arch}"
  424. echo "${qemu} -M ${qemu_machine} ${qemu_args} -append ${qemu_append} -kernel ${kernel} -qmp tcp:127.0.0.1:4444,server,nowait -no-reboot -nographic -initrd initramfs.${arch}"
  425. ${qemu} -M ${qemu_machine} ${qemu_args} -append "${qemu_append}" -kernel ${kernel} -qmp tcp:127.0.0.1:4444,server,nowait -no-reboot -nographic -initrd initramfs.${arch} | tee REPORT.${arch}
  426. if [ $? -eq 0 ];then
  427. echo "Test for ${arch} finished. See REPORT.${arch}."
  428. echo
  429. else
  430. echo "Test failed for ${arch}."
  431. echo
  432. fi
  433. }
  434. create_buildroot_defconfig_arcle() {
  435. cat > configs/arcle_defconfig << EOD
  436. BR2_arcle=y
  437. BR2_TOOLCHAIN_BUILDROOT_UCLIBC_NG=y
  438. BR2_KERNEL_HEADERS_3_15=y
  439. BR2_DEFAULT_KERNEL_HEADERS="3.15.6"
  440. BR2_BINUTILS_VERSION_2_24=y
  441. BR2_GCC_VERSION_4_8_X=y
  442. BR2_TOOLCHAIN_HAS_THREADS=y
  443. EOD
  444. }
  445. create_buildroot_defconfig_arcbe() {
  446. cat > configs/arcbe_defconfig << EOD
  447. BR2_arcle=y
  448. BR2_TOOLCHAIN_BUILDROOT_UCLIBC_NG=y
  449. BR2_KERNEL_HEADERS_3_15=y
  450. BR2_DEFAULT_KERNEL_HEADERS="3.15.6"
  451. BR2_BINUTILS_VERSION_2_24=y
  452. BR2_GCC_VERSION_4_8_X=y
  453. BR2_TOOLCHAIN_HAS_THREADS=y
  454. EOD
  455. }
  456. create_buildroot_defconfig_bfin() {
  457. cat > configs/bfin_defconfig << EOD
  458. BR2_bfin=y
  459. BR2_BINFMT_FDPIC=y
  460. BR2_bf609=y
  461. BR2_TOOLCHAIN_BUILDROOT_UCLIBC_NG=y
  462. BR2_KERNEL_HEADERS_3_15=y
  463. BR2_DEFAULT_KERNEL_HEADERS="3.15.6"
  464. BR2_BINUTILS_VERSION_2_22=y
  465. BR2_GCC_VERSION_4_5_X=y
  466. BR2_TOOLCHAIN_HAS_THREADS=y
  467. EOD
  468. }
  469. build_buildroot() {
  470. cd buildroot
  471. case $1 in
  472. arcle)
  473. create_buildroot_defconfig_arcle
  474. make arcle_defconfig
  475. make clean all
  476. ;;
  477. arcbe)
  478. create_buildroot_defconfig_arcbe
  479. make arcbe_defconfig
  480. make clean all
  481. ;;
  482. arm)
  483. make qemu_arm_vexpress_defconfig
  484. make clean all
  485. ;;
  486. bfin)
  487. create_buildroot_defconfig_bfin
  488. make bfin_defconfig
  489. make clean all
  490. ;;
  491. mips)
  492. make qemu_mips_malta_defconfig
  493. make clean all
  494. ;;
  495. mipsel)
  496. make qemu_mipsel_malta_defconfig
  497. make clean all
  498. ;;
  499. mips64)
  500. make qemu_mips64_malta_defconfig
  501. make clean all
  502. ;;
  503. mips64el)
  504. make qemu_mips64el_malta_defconfig
  505. make clean all
  506. ;;
  507. ppc)
  508. make qemu_ppc_mpc8544ds_defconfig
  509. make clean all
  510. ;;
  511. sh)
  512. make qemu_sh4_r2d_defconfig
  513. make clean all
  514. ;;
  515. sparc)
  516. make qemu_sparc_ss10_defconfig
  517. make clean all
  518. ;;
  519. x86)
  520. make qemu_x86_defconfig
  521. make clean all
  522. ;;
  523. x86_64)
  524. make qemu_x86_64_defconfig
  525. make clean all
  526. ;;
  527. xtensa)
  528. make qemu_xtensa_lx60_defconfig
  529. make clean all
  530. ;;
  531. *)
  532. echo "architecture not supported in buildroot"
  533. exit 1
  534. ;;
  535. esac
  536. }
  537. build_openadk() {
  538. cd openadk
  539. # start with a clean dir
  540. if [ $clean -eq 1 ];then
  541. make cleandir
  542. fi
  543. DEFAULT="ADK_TARGET_LIBC=$libc ADK_TARGET_FS=initramfsarchive ADK_TARGET_COLLECTION=test"
  544. if [ $debug -eq 1 ];then
  545. DEFAULT="$DEFAULT VERBOSE=1"
  546. fi
  547. if [ ! -z $source ];then
  548. DEFAULT="$DEFAULT ADK_NO_CHECKSUM=1"
  549. fi
  550. if [ $2 -eq 0 ];then
  551. DEFAULT="$DEFAULT ADK_TEST_BASE=y"
  552. fi
  553. if [ $2 -eq 1 ];then
  554. DEFAULT="$DEFAULT ADK_TEST_LTP=y"
  555. fi
  556. if [ $2 -eq 2 ];then
  557. case $libc in
  558. uclibc-ng)
  559. DEFAULT="$DEFAULT ADK_TEST_UCLIBC_NG_TESTSUITE=y"
  560. ;;
  561. uclibc)
  562. DEFAULT="$DEFAULT ADK_TEST_UCLIBC_TESTSUITE=y"
  563. ;;
  564. *)
  565. echo "test suite not available"
  566. exit 1
  567. ;;
  568. esac
  569. make package=$libc clean
  570. fi
  571. if [ $2 -eq 3 ];then
  572. case $libc in
  573. uclibc-ng)
  574. DEFAULT="$DEFAULT ADK_TEST_UCLIBC_NG_NATIVE=y"
  575. ;;
  576. uclibc)
  577. DEFAULT="$DEFAULT ADK_TEST_UCLIBC_NATIVE=y"
  578. ;;
  579. *)
  580. echo "native build not available"
  581. exit 1
  582. ;;
  583. esac
  584. fi
  585. case $1 in
  586. arm)
  587. make $DEFAULT ADK_TARGET_ARCH=arm ADK_TARGET_SYSTEM=qemu-arm ADK_TARGET_ABI=eabi ADK_TARGET_ENDIAN=little defconfig all
  588. ;;
  589. armhf)
  590. make $DEFAULT ADK_TARGET_ARCH=arm ADK_TARGET_SYSTEM=qemu-arm ADK_TARGET_ABI=eabihf ADK_TARGET_ENDIAN=little defconfig all
  591. ;;
  592. m68k-nommu)
  593. make $DEFAULT ADK_TARGET_ARCH=m68k ADK_TARGET_SYSTEM=qemu-m68k defconfig all
  594. ;;
  595. mips)
  596. make $DEFAULT ADK_TARGET_ARCH=mips ADK_TARGET_SYSTEM=qemu-mips ADK_TARGET_ENDIAN=big defconfig all
  597. ;;
  598. mipsel)
  599. make $DEFAULT ADK_TARGET_ARCH=mips ADK_TARGET_SYSTEM=qemu-mips ADK_TARGET_ENDIAN=little defconfig all
  600. ;;
  601. mips64)
  602. make $DEFAULT ADK_TARGET_ARCH=mips64 ADK_TARGET_SYSTEM=qemu-mips64 ADK_TARGET_ENDIAN=big ADK_TARGET_ABI=o32 defconfig all
  603. ;;
  604. mips64n32)
  605. make $DEFAULT ADK_TARGET_ARCH=mips64 ADK_TARGET_SYSTEM=qemu-mips64 ADK_TARGET_ENDIAN=big ADK_TARGET_ABI=n32 defconfig all
  606. ;;
  607. mips64n64)
  608. make $DEFAULT ADK_TARGET_ARCH=mips64 ADK_TARGET_SYSTEM=qemu-mips64 ADK_TARGET_ENDIAN=big ADK_TARGET_ABI=n64 defconfig all
  609. ;;
  610. mips64el)
  611. make $DEFAULT ADK_TARGET_ARCH=mips64 ADK_TARGET_SYSTEM=qemu-mips64 ADK_TARGET_ENDIAN=little ADK_TARGET_ABI=o32 defconfig all
  612. ;;
  613. mips64eln32)
  614. make $DEFAULT ADK_TARGET_ARCH=mips64 ADK_TARGET_SYSTEM=qemu-mips64 ADK_TARGET_ENDIAN=little ADK_TARGET_ABI=n32 defconfig all
  615. ;;
  616. mips64eln64)
  617. make $DEFAULT ADK_TARGET_ARCH=mips64 ADK_TARGET_SYSTEM=qemu-mips64 ADK_TARGET_ENDIAN=little ADK_TARGET_ABI=n64 defconfig all
  618. ;;
  619. ppc-nofpu)
  620. make $DEFAULT ADK_TARGET_ARCH=ppc ADK_TARGET_SYSTEM=qemu-ppc defconfig all
  621. ;;
  622. sh)
  623. make $DEFAULT ADK_TARGET_ARCH=sh ADK_TARGET_SYSTEM=qemu-sh ADK_TARGET_ENDIAN=little defconfig all
  624. ;;
  625. sheb)
  626. make $DEFAULT ADK_TARGET_ARCH=sh ADK_TARGET_SYSTEM=qemu-sh ADK_TARGET_ENDIAN=big defconfig all
  627. ;;
  628. *)
  629. make $DEFAULT ADK_TARGET_ARCH=$1 ADK_TARGET_SYSTEM=qemu-$1 defconfig all
  630. ;;
  631. esac
  632. if [ $? -ne 0 ];then
  633. echo "build failed"
  634. exit 1
  635. fi
  636. cd ..
  637. }
  638. echo "compiling base system and toolchain"
  639. if [ "$vendor" = "buildroot" ];then
  640. for arch in ${archlist}; do
  641. build_buildroot $arch 0
  642. done
  643. fi
  644. if [ "$vendor" = "openadk" ];then
  645. for arch in ${archlist}; do
  646. build_openadk $arch 99
  647. if [ $boot -eq 1 ];then
  648. case $arch in
  649. m68k-nommu|ppc|sheb|xtensa|mips64eln32|mips64n32)
  650. echo "runtime tests disabled for $arch."
  651. ;;
  652. *)
  653. build_openadk $arch 0
  654. runtest $arch 0
  655. ;;
  656. esac
  657. fi
  658. if [ $ltp -eq 1 ];then
  659. case $arch in
  660. m68k-nommu|ppc|sheb|xtensa|mips64eln32|mips64n32)
  661. echo "runtime tests disabled for $arch."
  662. ;;
  663. *)
  664. build_openadk $arch 1
  665. runtest $arch 1
  666. ;;
  667. esac
  668. fi
  669. if [ $test -eq 1 ];then
  670. case $arch in
  671. m68k-nommu|ppc|sheb|xtensa|mips64eln32|mips64n32)
  672. echo "runtime tests disabled for $arch."
  673. ;;
  674. *)
  675. build_openadk $arch 2
  676. runtest $arch 2
  677. ;;
  678. esac
  679. fi
  680. if [ $gcc -eq 1 ];then
  681. case $arch in
  682. m68k-nommu|ppc|sheb|xtensa|mips64eln32|mips64n32)
  683. echo "runtime tests disabled for $arch."
  684. ;;
  685. *)
  686. build_openadk $arch 3
  687. runtest $arch 3
  688. ;;
  689. esac
  690. fi
  691. done
  692. fi
  693. echo "All tests finished."
  694. exit 0