| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright 2009 The Native Client Authors. All rights reserved. | 2 # Copyright 2009 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can | 3 # Use of this source code is governed by a BSD-style license that can |
| 4 # be found in the LICENSE file. | 4 # be found in the LICENSE file. |
| 5 # | 5 # |
| 6 #@ This script builds the arm untrusted SDK. | 6 #@ This script builds the arm untrusted SDK. |
| 7 #@ NOTE: It must be run from the native_client/ directory. | 7 #@ NOTE: It must be run from the native_client/ directory. |
| 8 #@ NOTE: you should source: set_arm_(un)trusted_toolchain.sh | 8 #@ NOTE: you should source: set_arm_(un)trusted_toolchain.sh |
| 9 #@ before running it | 9 #@ before running it |
| 10 ###################################################################### | 10 ###################################################################### |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 # Config | 23 # Config |
| 24 ###################################################################### | 24 ###################################################################### |
| 25 | 25 |
| 26 set -o nounset | 26 set -o nounset |
| 27 set -o errexit | 27 set -o errexit |
| 28 | 28 |
| 29 | 29 |
| 30 # NOTE: gcc and llvm have to be synchronized | 30 # NOTE: gcc and llvm have to be synchronized |
| 31 # we have chosen toolchains which both are based on gcc-4.2.1 | 31 # we have chosen toolchains which both are based on gcc-4.2.1 |
| 32 | 32 |
| 33 readonly CS_URL=http://www.codesourcery.com/sgpp/lite/arm/portal/package1787/pub
lic/arm-none-linux-gnueabi/arm-2007q3-51-arm-none-linux-gnueabi-i686-pc-linux-gn
u.tar.bz2 | 33 readonly CS_URL=http://www.codesourcery.com/sgpp/lite/arm/portal/package1787/\ |
| 34 public/arm-none-linux-gnueabi/\ |
| 35 arm-2007q3-51-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 |
| 34 | 36 |
| 35 | 37 |
| 36 readonly INSTALL_ROOT=$(pwd)/toolchain/linux_arm-untrusted | 38 readonly INSTALL_ROOT=$(pwd)/toolchain/linux_arm-untrusted |
| 37 readonly LLVM_PKG_PATH=$(readlink -f ../third_party/llvm) | 39 readonly LLVM_PKG_PATH=$(readlink -f ../third_party/llvm) |
| 38 readonly LLVM_SVN_REV=88663 | 40 readonly LLVM_SVN_REV=88663 |
| 39 readonly LLVMGCC_SVN_REV=88663 | 41 readonly LLVMGCC_SVN_REV=88663 |
| 40 readonly MAKE_OPTS="-j6 VERBOSE=1" | 42 readonly MAKE_OPTS="-j6 VERBOSE=1" |
| 41 | 43 |
| 42 export TMP=/tmp/crosstool-untrusted | 44 export TMP=/tmp/crosstool-untrusted |
| 43 export CODE_SOURCERY_PKG_PATH=${INSTALL_ROOT}/codesourcery | 45 export CODE_SOURCERY_PKG_PATH=${INSTALL_ROOT}/codesourcery |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 258 |
| 257 # we copy some useful tools after building them first | 259 # we copy some useful tools after building them first |
| 258 InstallMiscTools() { | 260 InstallMiscTools() { |
| 259 Banner "building and installing misc tools" | 261 Banner "building and installing misc tools" |
| 260 | 262 |
| 261 # TODO(robertm): revisit some of these options | 263 # TODO(robertm): revisit some of these options |
| 262 Run "sel loader" \ | 264 Run "sel loader" \ |
| 263 ./scons MODE=nacl,opt-linux \ | 265 ./scons MODE=nacl,opt-linux \ |
| 264 platform=arm \ | 266 platform=arm \ |
| 265 sdl=none \ | 267 sdl=none \ |
| 266 naclsdk_mode=manual \ | |
| 267 naclsdk_validate=0 \ | 268 naclsdk_validate=0 \ |
| 268 sysinfo= \ | 269 sysinfo= \ |
| 269 sel_ldr | 270 sel_ldr |
| 270 rm -rf ${INSTALL_ROOT}/tools-arm | 271 rm -rf ${INSTALL_ROOT}/tools-arm |
| 271 mkdir ${INSTALL_ROOT}/tools-arm | 272 mkdir ${INSTALL_ROOT}/tools-arm |
| 272 cp scons-out/opt-linux-arm/obj/src/trusted/service_runtime/sel_ldr\ | 273 cp scons-out/opt-linux-arm/obj/src/trusted/service_runtime/sel_ldr\ |
| 273 ${INSTALL_ROOT}/tools-arm | 274 ${INSTALL_ROOT}/tools-arm |
| 274 | 275 |
| 275 Run "validator" \ | 276 Run "validator" \ |
| 276 ./scons MODE=opt-linux \ | 277 ./scons MODE=opt-linux \ |
| 277 naclsdk_mode=manual \ | |
| 278 targetplatform=arm \ | 278 targetplatform=arm \ |
| 279 sysinfo= \ | 279 sysinfo= \ |
| 280 arm-ncval-core | 280 arm-ncval-core |
| 281 rm -rf ${INSTALL_ROOT}/tools-x86 | 281 rm -rf ${INSTALL_ROOT}/tools-x86 |
| 282 mkdir ${INSTALL_ROOT}/tools-x86 | 282 mkdir ${INSTALL_ROOT}/tools-x86 |
| 283 cp scons-out/opt-linux-x86-32-to-arm/obj/src/trusted/validator_arm/v2/arm-ncv
al-core\ | 283 cp scons-out/opt-linux-x86-32-to-arm/obj/src/trusted/validator_arm/v2/\ |
| 284 ${INSTALL_ROOT}/tools-x86 | 284 arm-ncval-core ${INSTALL_ROOT}/tools-x86 |
| 285 } | 285 } |
| 286 | 286 |
| 287 | 287 |
| 288 # the driver is a simple python script which changes its behavior | 288 # the driver is a simple python script which changes its behavior |
| 289 # depending under the name it is invoked as | 289 # depending under the name it is invoked as |
| 290 InstallDriver() { | 290 InstallDriver() { |
| 291 local dir=${INSTALL_ROOT}/arm-none-linux-gnueabi/ | 291 local dir=${INSTALL_ROOT}/arm-none-linux-gnueabi/ |
| 292 Banner "installing driver adaptors to ${dir}" | 292 Banner "installing driver adaptors to ${dir}" |
| 293 rm -f ${dir}/llvm-fake* | 293 rm -f ${dir}/llvm-fake* |
| 294 cp tools/llvm/llvm-fake.py ${dir}/ | 294 cp tools/llvm/llvm-fake.py ${dir}/ |
| (...skipping 16 matching lines...) Expand all Loading... |
| 311 | 311 |
| 312 SubBanner "building newib" | 312 SubBanner "building newib" |
| 313 rm -rf toolchain/linux_arm-untrusted/arm-newlib/ | 313 rm -rf toolchain/linux_arm-untrusted/arm-newlib/ |
| 314 tools/llvm/setup_arm_newlib.sh | 314 tools/llvm/setup_arm_newlib.sh |
| 315 | 315 |
| 316 SubBanner "building extra sdk libs" | 316 SubBanner "building extra sdk libs" |
| 317 rm -rf scons-out/nacl_extra_sdk-arm/ | 317 rm -rf scons-out/nacl_extra_sdk-arm/ |
| 318 ./scons MODE=nacl_extra_sdk \ | 318 ./scons MODE=nacl_extra_sdk \ |
| 319 platform=arm \ | 319 platform=arm \ |
| 320 sdl=none \ | 320 sdl=none \ |
| 321 naclsdk_mode=manual \ | |
| 322 naclsdk_validate=0 \ | 321 naclsdk_validate=0 \ |
| 323 extra_sdk_clean \ | 322 extra_sdk_clean \ |
| 324 extra_sdk_update_header \ | 323 extra_sdk_update_header \ |
| 325 install_libpthread \ | 324 install_libpthread \ |
| 326 extra_sdk_update | 325 extra_sdk_update |
| 327 } | 326 } |
| 328 | 327 |
| 329 | 328 |
| 330 InstallExamples() { | 329 InstallExamples() { |
| 331 Banner "installing examples into ${INSTALL_ROOT}/examples" | 330 Banner "installing examples into ${INSTALL_ROOT}/examples" |
| 332 rm -rf ${INSTALL_ROOT}/examples/ | 331 rm -rf ${INSTALL_ROOT}/examples/ |
| 333 cp -r tools/llvm/arm_examples ${INSTALL_ROOT}/examples/ | 332 cp -r tools/llvm/arm_examples ${INSTALL_ROOT}/examples/ |
| 334 } | 333 } |
| 335 | 334 |
| 336 | 335 |
| 337 # NOTE: Experiment x86-32 support | 336 # NOTE: Experiment x86-32 support |
| 338 AddX86Basics32() { | 337 AddX86Basics32() { |
| 339 Banner "installing experimental x86-32 support" | 338 Banner "installing experimental x86-32 support" |
| 340 local libdir="${INSTALL_ROOT}/x86-32sfi-lib" | 339 local libdir="${INSTALL_ROOT}/x86-32sfi-lib" |
| 341 mkdir -p ${libdir} | 340 mkdir -p ${libdir} |
| 342 | 341 |
| 343 SubBanner "rebuilding stubs for x86" | 342 SubBanner "rebuilding stubs for x86" |
| 344 rm -f scons-out/nacl_extra_sdk-x86-32/obj/src/untrusted/stubs/*.o | 343 rm -f scons-out/nacl_extra_sdk-x86-32/obj/src/untrusted/stubs/*.o |
| 345 # NOTE: this does way too much - we only want the stubs | 344 # NOTE: this does way too much - we only want the stubs |
| 346 ./scons MODE=nacl_extra_sdk platform=x86-32 \ | 345 ./scons MODE=nacl_extra_sdk platform=x86-32 \ |
| 347 extra_sdk_clean extra_sdk_update_header extra_sdk_update | 346 extra_sdk_clean extra_sdk_update_header extra_sdk_update |
| 348 cp scons-out/nacl_extra_sdk-x86-32/obj/src/untrusted/stubs/*.o ${libdir} | 347 cp scons-out/nacl_extra_sdk-x86-32/obj/src/untrusted/stubs/*.o ${libdir} |
| 349 | 348 |
| 350 SubBanner "installing x86 libgcc libs into ${libdir}" | 349 SubBanner "installing x86 libgcc libs into ${libdir}" |
| 351 cp -r toolchain/linux_x86-32/sdk/nacl-sdk/lib/gcc/nacl/4.2.2/libgcc.a ${libdir
} | 350 cp -r toolchain/linux_x86-32/sdk/nacl-sdk/lib/gcc/nacl/4.2.2/libgcc.a \ |
| 351 ${libdir} |
| 352 | 352 |
| 353 local toolsdir="${INSTALL_ROOT}/x86-32sfi-tools" | 353 local toolsdir="${INSTALL_ROOT}/x86-32sfi-tools" |
| 354 mkdir -p ${toolsdir} | 354 mkdir -p ${toolsdir} |
| 355 SubBanner "installing x86 linker script and tools into ${toolsdir}" | 355 SubBanner "installing x86 linker script and tools into ${toolsdir}" |
| 356 cp tools/llvm/ld_script_x86_untrusted ${toolsdir} | 356 cp tools/llvm/ld_script_x86_untrusted ${toolsdir} |
| 357 cp toolchain/linux_x86-32/sdk/nacl-sdk/bin/nacl-as ${toolsdir} | 357 cp toolchain/linux_x86-32/sdk/nacl-sdk/bin/nacl-as ${toolsdir} |
| 358 cp toolchain/linux_x86-32/sdk/nacl-sdk/bin/nacl-ld ${toolsdir} | 358 cp toolchain/linux_x86-32/sdk/nacl-sdk/bin/nacl-ld ${toolsdir} |
| 359 } | 359 } |
| 360 | 360 |
| 361 | 361 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 #@ tar <tarball> | 523 #@ tar <tarball> |
| 524 #@ | 524 #@ |
| 525 #@ tar everything up | 525 #@ tar everything up |
| 526 if [ ${MODE} = 'tar' ] ; then | 526 if [ ${MODE} = 'tar' ] ; then |
| 527 CreateTarBall $1 | 527 CreateTarBall $1 |
| 528 exit 0 | 528 exit 0 |
| 529 fi | 529 fi |
| 530 | 530 |
| 531 echo "ERROR: unknown mode ${MODE}" | 531 echo "ERROR: unknown mode ${MODE}" |
| 532 exit -1 | 532 exit -1 |
| OLD | NEW |