Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: tools/trusted_cross_toolchains/trusted-toolchain-creator.armhf.precise.sh

Issue 1115793002: Cleanup ARM trusted-toolchain-creator scripts (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | tools/trusted_cross_toolchains/trusted-toolchain-creator.armhf.trusty.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 # 5 #
6 #@ This script builds the (trusted) cross toolchain for arm. 6 #@ This script builds the (trusted) cross toolchain for arm.
7 #@ It must be run from the native_client/ directory. 7 #@ It must be run from the native_client/ directory.
8 #@ 8 #@
9 #@ The toolchain consists primarily of a jail with arm header and libraries. 9 #@ The toolchain consists primarily of a jail with arm header and libraries.
10 #@ It also provides additional tools such as QEMU. 10 #@ It also provides additional tools such as QEMU.
11 #@ It does NOT provide the actual cross compiler anymore. 11 #@ It does NOT provide the actual cross compiler anymore.
12 #@ The cross compiler is now comming straight from a debian package. 12 #@ The cross compiler is now coming straight from a Debian package.
13 #@ So there is a one-time step required for all machines using this TC. 13 #@ So there is a one-time step required for all machines using this TC:
14 #@ Which is especially true for build-bots:
15 #@ 14 #@
16 #@ tools/trusted_cross_toolchains/trusted-toolchain-creator.armhf.precise.sh I nstallCrossArmBasePackages 15 #@ tools/trusted_cross_toolchains/trusted-toolchain-creator.armhf.precise.sh In stallCrossArmBasePackages
17 #@ 16 #@
17 #@ Generally this script is invoked as:
18 #@ 18 #@
19 #@ Generally this script is invoked as:
20 #@ tools/trusted_cross_toolchains/trusted-toolchain-creator.armhf.precise.sh <m ode> <args>* 19 #@ tools/trusted_cross_toolchains/trusted-toolchain-creator.armhf.precise.sh <m ode> <args>*
21 #@ Available modes are shown below.
22 #@
23 #@ This Toolchain was tested with Ubuntu Precise
24 #@
25 #@ Usage of this TC:
26 #@ compile: arm-linux-gnueabihf-gcc -march=armv7-a -isystem ${JAIL}/usr/include
27 #@ link: arm-linux-gnueabihf-gcc -L${JAIL}/usr/lib -L${JAIL}/usr/lib/arm-lin ux-gnueabihf
28 #@ -L${JAIL}/lib -L${JAIL}/lib/arm-linux-gnueabi hf
29 #@
30 #@ Usage of QEMU
31 #@ TBD
32 #@ 20 #@
33 #@ List of modes: 21 #@ List of modes:
34 22
35 ###################################################################### 23 ######################################################################
36 # Config 24 # Config
37 ###################################################################### 25 ######################################################################
38 26
39 set -o nounset 27 set -o nounset
40 set -o errexit 28 set -o errexit
41 29
30 readonly DIST=precise
42 readonly SCRIPT_DIR=$(dirname $0) 31 readonly SCRIPT_DIR=$(dirname $0)
43 32 readonly NACL_ROOT=$(pwd)
44 # this where we create the ARMEL "jail" 33 # this where we create the ARMHF sysroot
45 readonly INSTALL_ROOT=$(pwd)/toolchain/linux_x86/arm_trusted 34 readonly INSTALL_ROOT=${NACL_ROOT}/toolchain/linux_x86/arm_trusted
46 35 readonly TAR_ARCHIVE=$(dirname ${NACL_ROOT})/out/sysroot_arm_trusted_${DIST}.tgz
47 readonly TMP=/tmp/armhf-crosstool-precise 36 readonly TMP=/tmp/sysroot_arm_trusted_${DIST}
48
49 readonly REQUIRED_TOOLS="wget" 37 readonly REQUIRED_TOOLS="wget"
50
51 readonly MAKE_OPTS="-j8" 38 readonly MAKE_OPTS="-j8"
52 39
53 ###################################################################### 40 ######################################################################
54 # Package Config 41 # Package Config
55 ###################################################################### 42 ######################################################################
56 43
57 # this where we get the cross toolchain from for the manual install: 44 # this where we get the cross toolchain from for the manual install:
58 readonly CROSS_ARM_TC_REPO=http://archive.ubuntu.com/ubuntu 45 readonly CROSS_ARM_TC_REPO=http://archive.ubuntu.com/ubuntu
59 # this is where we get all the armhf packages from 46 # this is where we get all the armhf packages from
60 readonly ARMEL_REPO=http://ports.ubuntu.com/ubuntu-ports 47 readonly ARMHF_REPO=http://ports.ubuntu.com/ubuntu-ports
61 48
62 readonly PACKAGE_LIST="${ARMEL_REPO}/dists/precise/main/binary-armhf/Packages.bz 2" 49 readonly PACKAGE_LIST="${ARMHF_REPO}/dists/${DIST}/main/binary-armhf/Packages.bz 2"
63 readonly PACKAGE_LIST2="${ARMEL_REPO}/dists/precise-security/main/binary-armhf/P ackages.bz2" 50 readonly PACKAGE_LIST2="${ARMHF_REPO}/dists/${DIST}-security/main/binary-armhf/P ackages.bz2"
64 51
65 # Packages for the host system 52 # Packages for the host system
66 # NOTE: at one point we should get rid of the 4.5 packages
67 readonly CROSS_ARM_TC_PACKAGES="\ 53 readonly CROSS_ARM_TC_PACKAGES="\
68 g++-arm-linux-gnueabihf \ 54 g++-arm-linux-gnueabihf"
69 libgomp1-dbg-armhf-cross \
70 libgcc1-dbg-armhf-cross \
71 libmudflap0-dbg-armhf-cross
72 "
73 55
74 # Jail packages: these are good enough for native client 56 # Jail packages: these are good enough for native client
75 # NOTE: the package listing here should be updated using the 57 # NOTE: the package listing here should be updated using the
76 # GeneratePackageListXXX() functions below 58 # GeneratePackageListXXX() functions below
77 readonly ARMEL_BASE_PACKAGES="\ 59 readonly ARMHF_BASE_PACKAGES="\
78 libssl-dev \ 60 libssl-dev \
79 libssl1.0.0 \ 61 libssl1.0.0 \
80 libgcc1 \ 62 libgcc1 \
81 libc6 \ 63 libc6 \
82 libc6-dev \ 64 libc6-dev \
83 libstdc++6 \ 65 libstdc++6 \
84 libx11-dev \ 66 libx11-dev \
85 libx11-6 \ 67 libx11-6 \
86 x11proto-core-dev \ 68 x11proto-core-dev \
87 libxt-dev \ 69 libxt-dev \
88 libxt6 \ 70 libxt6 \
89 zlib1g \ 71 zlib1g \
90 zlib1g-dev" 72 zlib1g-dev"
91 73
92 # Additional jail packages needed to build chrome 74 # Additional jail packages needed to build chrome
93 # NOTE: the package listing here should be updated using the 75 # NOTE: the package listing here should be updated using the
94 # GeneratePackageListXXX() functions below 76 # GeneratePackageListXXX() functions below
95 readonly ARMEL_BASE_DEP_LIST="${SCRIPT_DIR}/packagelist.precise.armhf.base" 77 readonly ARMHF_BASE_DEP_LIST="${SCRIPT_DIR}/packagelist.${DIST}.armhf.base"
96 readonly ARMEL_BASE_DEP_FILES="$(cat ${ARMEL_BASE_DEP_LIST})" 78 readonly ARMHF_BASE_DEP_FILES="$(cat ${ARMHF_BASE_DEP_LIST})"
97 79
98 readonly ARMEL_EXTRA_PACKAGES="\ 80 readonly ARMHF_EXTRA_PACKAGES="\
99 comerr-dev \ 81 comerr-dev \
100 krb5-multidev \ 82 krb5-multidev \
101 libasound2 \ 83 libasound2 \
102 libasound2-dev \ 84 libasound2-dev \
103 libatk1.0-0 \ 85 libatk1.0-0 \
104 libatk1.0-dev \ 86 libatk1.0-dev \
105 libcairo2 \ 87 libcairo2 \
106 libcairo2-dev \ 88 libcairo2-dev \
107 libcairo-gobject2 \ 89 libcairo-gobject2 \
108 libcairo-script-interpreter2 \ 90 libcairo-script-interpreter2 \
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 x11proto-input-dev \ 198 x11proto-input-dev \
217 x11proto-kb-dev \ 199 x11proto-kb-dev \
218 x11proto-randr-dev \ 200 x11proto-randr-dev \
219 x11proto-record-dev \ 201 x11proto-record-dev \
220 x11proto-render-dev \ 202 x11proto-render-dev \
221 x11proto-scrnsaver-dev \ 203 x11proto-scrnsaver-dev \
222 x11proto-xext-dev" 204 x11proto-xext-dev"
223 205
224 # NOTE: the package listing here should be updated using the 206 # NOTE: the package listing here should be updated using the
225 # GeneratePackageListXXX() functions below 207 # GeneratePackageListXXX() functions below
226 readonly ARMEL_EXTRA_DEP_LIST="${SCRIPT_DIR}/packagelist.precise.armhf.extra" 208 readonly ARMHF_EXTRA_DEP_LIST="${SCRIPT_DIR}/packagelist.${DIST}.armhf.extra"
227 readonly ARMEL_EXTRA_DEP_FILES="$(cat ${ARMEL_EXTRA_DEP_LIST})" 209 readonly ARMHF_EXTRA_DEP_FILES="$(cat ${ARMHF_EXTRA_DEP_LIST})"
228 210
229 ###################################################################### 211 ######################################################################
230 # Helper 212 # Helper
231 ###################################################################### 213 ######################################################################
232 214
233 Banner() { 215 Banner() {
234 echo "######################################################################" 216 echo "######################################################################"
235 echo $* 217 echo $*
236 echo "######################################################################" 218 echo "######################################################################"
237 } 219 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 282
301 283
302 # TODO(robertm): consider wiping all of ${BASE_DIR} 284 # TODO(robertm): consider wiping all of ${BASE_DIR}
303 ClearInstallDir() { 285 ClearInstallDir() {
304 Banner "clearing dirs in ${INSTALL_ROOT}" 286 Banner "clearing dirs in ${INSTALL_ROOT}"
305 rm -rf ${INSTALL_ROOT}/* 287 rm -rf ${INSTALL_ROOT}/*
306 } 288 }
307 289
308 290
309 CreateTarBall() { 291 CreateTarBall() {
310 local tarball=$1 292 Banner "creating tar ball ${TAR_ARCHIVE}"
311 Banner "creating tar ball ${tarball}" 293 tar cfz ${TAR_ARCHIVE} -C ${INSTALL_ROOT} .
312 tar cfz ${tarball} -C ${INSTALL_ROOT} .
313 } 294 }
314 295
315 ###################################################################### 296 ######################################################################
316 # One of these has to be run ONCE per machine 297 # One of these has to be run ONCE per machine
317 ###################################################################### 298 ######################################################################
318 299
319 #@ 300 #@
320 #@ InstallCrossArmBasePackages 301 #@ InstallCrossArmBasePackages
321 #@ 302 #@
322 #@ Install packages needed for arm cross compilation. 303 #@ Install packages needed for arm cross compilation.
(...skipping 20 matching lines...) Expand all
343 324
344 325
345 InstallMissingArmLibrariesAndHeadersIntoJail() { 326 InstallMissingArmLibrariesAndHeadersIntoJail() {
346 Banner "Install Libs And Headers Into Jail" 327 Banner "Install Libs And Headers Into Jail"
347 328
348 mkdir -p ${TMP}/armhf-packages 329 mkdir -p ${TMP}/armhf-packages
349 mkdir -p ${INSTALL_ROOT} 330 mkdir -p ${INSTALL_ROOT}
350 for file in $@ ; do 331 for file in $@ ; do
351 local package="${TMP}/armhf-packages/${file##*/}" 332 local package="${TMP}/armhf-packages/${file##*/}"
352 Banner "installing ${file}" 333 Banner "installing ${file}"
353 DownloadOrCopy ${ARMEL_REPO}/pool/${file} ${package} 334 DownloadOrCopy ${ARMHF_REPO}/pool/${file} ${package}
354 SubBanner "extracting to ${INSTALL_ROOT}" 335 SubBanner "extracting to ${INSTALL_ROOT}"
355 if [[ ! -s ${package} ]] ; then 336 if [[ ! -s ${package} ]] ; then
356 echo 337 echo
357 echo "ERROR: bad package ${package}" 338 echo "ERROR: bad package ${package}"
358 exit -1 339 exit -1
359 fi 340 fi
360 dpkg --fsys-tarfile ${package}\ 341 dpkg --fsys-tarfile ${package}\
361 | tar -xvf - --exclude=./usr/share -C ${INSTALL_ROOT} 342 | tar -xvf - --exclude=./usr/share -C ${INSTALL_ROOT}
362 done 343 done
363 } 344 }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 # --static 462 # --static
482 463
483 SubBanner "Make" 464 SubBanner "Make"
484 env -i PATH=/usr/bin/:/bin make MAKE_OPTS=${MAKE_OPTS} 465 env -i PATH=/usr/bin/:/bin make MAKE_OPTS=${MAKE_OPTS}
485 466
486 SubBanner "Install ${INSTALL_ROOT}" 467 SubBanner "Install ${INSTALL_ROOT}"
487 cp arm-linux-user/qemu-arm ${INSTALL_ROOT} 468 cp arm-linux-user/qemu-arm ${INSTALL_ROOT}
488 cd ${saved_dir} 469 cd ${saved_dir}
489 cp tools/trusted_cross_toolchains/qemu_tool_arm.sh ${INSTALL_ROOT} 470 cp tools/trusted_cross_toolchains/qemu_tool_arm.sh ${INSTALL_ROOT}
490 ln -sf qemu_tool_arm.sh ${INSTALL_ROOT}/run_under_qemu_arm 471 ln -sf qemu_tool_arm.sh ${INSTALL_ROOT}/run_under_qemu_arm
472 set +x
491 } 473 }
492 474
493 #@ 475 #@
494 #@ BuildJail <tarball-name> 476 #@ BuildJail
495 #@ 477 #@
496 #@ Build everything and package it 478 #@ Build everything and package it
497 BuildJail() { 479 BuildJail() {
498 ClearInstallDir 480 ClearInstallDir
499 InstallMissingArmLibrariesAndHeadersIntoJail \ 481 InstallMissingArmLibrariesAndHeadersIntoJail \
500 ${ARMEL_BASE_DEP_FILES} \ 482 ${ARMHF_BASE_DEP_FILES} \
501 ${ARMEL_EXTRA_DEP_FILES} 483 ${ARMHF_EXTRA_DEP_FILES}
502 CleanupJailSymlinks 484 CleanupJailSymlinks
503 HacksAndPatches 485 HacksAndPatches
504 BuildAndInstallQemu 486 BuildAndInstallQemu
505 CreateTarBall $1 487 CreateTarBall
506 } 488 }
507 489
508 # 490 #
509 # GeneratePackageList 491 # GeneratePackageList
510 # 492 #
511 # Looks up package names in ${TMP}/Packages and write list of URLs 493 # Looks up package names in ${TMP}/Packages and write list of URLs
512 # to output file. 494 # to output file.
513 # 495 #
514 GeneratePackageList() { 496 GeneratePackageList() {
515 local output_file=$1 497 local output_file=$1
(...skipping 12 matching lines...) Expand all
528 sort $output_file -o $output_file 510 sort $output_file -o $output_file
529 } 511 }
530 512
531 #@ 513 #@
532 #@ UpdatePackageLists 514 #@ UpdatePackageLists
533 #@ 515 #@
534 #@ Regenerate the armhf package lists such that they contain an up-to-date 516 #@ Regenerate the armhf package lists such that they contain an up-to-date
535 #@ list of URLs within the ubuntu archive. 517 #@ list of URLs within the ubuntu archive.
536 #@ 518 #@
537 UpdatePackageLists() { 519 UpdatePackageLists() {
538 local package_list="${TMP}/Packages.precise.bz2" 520 local package_list="${TMP}/Packages.${DIST}.bz2"
539 local package_list2="${TMP}/Packages.precise-security.bz2" 521 local package_list2="${TMP}/Packages.${DIST}-security.bz2"
540 DownloadOrCopy ${PACKAGE_LIST} ${package_list} 522 DownloadOrCopy ${PACKAGE_LIST} ${package_list}
541 DownloadOrCopy ${PACKAGE_LIST2} ${package_list2} 523 DownloadOrCopy ${PACKAGE_LIST2} ${package_list2}
542 bzcat ${package_list} ${package_list2} | egrep '^(Package:|Filename:)' > ${TMP }/Packages 524 bzcat ${package_list} ${package_list2} | egrep '^(Package:|Filename:)' > ${TMP }/Packages
543 525
544 GeneratePackageList ${ARMEL_BASE_DEP_LIST} "${ARMEL_BASE_PACKAGES}" 526 GeneratePackageList ${ARMHF_BASE_DEP_LIST} "${ARMHF_BASE_PACKAGES}"
545 GeneratePackageList ${ARMEL_EXTRA_DEP_LIST} "${ARMEL_EXTRA_PACKAGES}" 527 GeneratePackageList ${ARMHF_EXTRA_DEP_LIST} "${ARMHF_EXTRA_PACKAGES}"
546 } 528 }
547 529
548 if [[ $# -eq 0 ]] ; then 530 if [[ $# -eq 0 ]] ; then
549 echo "ERROR: you must specify a mode on the commandline" 531 echo "ERROR: you must specify a mode on the commandline"
550 echo 532 echo
551 Usage 533 Usage
552 exit -1 534 exit -1
553 elif [[ "$(type -t $1)" != "function" ]]; then 535 elif [[ "$(type -t $1)" != "function" ]]; then
554 echo "ERROR: unknown function '$1'." >&2 536 echo "ERROR: unknown function '$1'." >&2
555 echo "For help, try:" 537 echo "For help, try:"
556 echo " $0 help" 538 echo " $0 help"
557 exit 1 539 exit 1
558 else 540 else
559 ChangeDirectory 541 ChangeDirectory
560 SanityCheck 542 SanityCheck
561 "$@" 543 "$@"
562 fi 544 fi
OLDNEW
« no previous file with comments | « no previous file | tools/trusted_cross_toolchains/trusted-toolchain-creator.armhf.trusty.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698