Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 set -o xtrace | 6 set -o xtrace |
| 7 set -o nounset | 7 set -o nounset |
| 8 set -o errexit | 8 set -o errexit |
| 9 | 9 |
| 10 # Tell build.sh and test.sh that we're a bot. | 10 # Tell build.sh and test.sh that we're a bot. |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 echo "@@@BUILD_STEP untar_binaries@@@" | 191 echo "@@@BUILD_STEP untar_binaries@@@" |
| 192 rm -rf scons-out/ | 192 rm -rf scons-out/ |
| 193 tar xvfz arm-scons.tgz --no-same-owner | 193 tar xvfz arm-scons.tgz --no-same-owner |
| 194 } | 194 } |
| 195 | 195 |
| 196 # Build with gyp - this only exercises the trusted TC and hence this only | 196 # Build with gyp - this only exercises the trusted TC and hence this only |
| 197 # makes sense to run for ARM. | 197 # makes sense to run for ARM. |
| 198 gyp-arm-build() { | 198 gyp-arm-build() { |
| 199 local gypmode="Release" | 199 local gypmode="Release" |
| 200 if [ "${BUILD_MODE_HOST}" = "DEBUG" ] ; then | 200 if [ "${BUILD_MODE_HOST}" = "DEBUG" ] ; then |
| 201 gypmode="Debug" | 201 gypmode="Debug" |
| 202 fi | 202 fi |
| 203 local toolchain_dir=native_client/toolchain/linux_x86/arm_trusted | 203 local toolchain_dir=native_client/toolchain/linux_x86/arm_trusted |
| 204 local extra="-isystem ${toolchain_dir}/usr/include \ | 204 local extra="-isystem ${toolchain_dir}/usr/include \ |
| 205 -Wl,-rpath-link=${toolchain_dir}/lib/arm-linux-gnueabihf \ | 205 -Wl,-rpath-link=${toolchain_dir}/lib/arm-linux-gnueabihf \ |
| 206 -L${toolchain_dir}/lib \ | 206 -L${toolchain_dir}/lib \ |
| 207 -L${toolchain_dir}/lib/arm-linux-gnueabihf \ | 207 -L${toolchain_dir}/lib/arm-linux-gnueabihf \ |
| 208 -L${toolchain_dir}/usr/lib \ | 208 -L${toolchain_dir}/usr/lib \ |
| 209 -L${toolchain_dir}/usr/lib/arm-linux-gnueabihf" | 209 -L${toolchain_dir}/usr/lib/arm-linux-gnueabihf" |
| 210 # Setup environment for arm. | 210 # Setup environment for arm. |
| 211 | 211 |
| 212 export AR=arm-linux-gnueabihf-ar | 212 export AR=arm-linux-gnueabihf-ar |
| 213 export AS=arm-linux-gnueabihf-as | 213 export AS=arm-linux-gnueabihf-as |
| 214 export CC="arm-linux-gnueabihf-gcc ${extra} " | 214 export CC="arm-linux-gnueabihf-gcc ${extra}" |
| 215 export CXX="arm-linux-gnueabihf-g++ ${extra} " | 215 export CXX="arm-linux-gnueabihf-g++ ${extra}" |
| 216 export LD="arm-linux-gnueabihf-g++ ${extra} " | 216 export LD="arm-linux-gnueabihf-g++ ${extra}" |
| 217 export RANLIB=arm-linux-gnueabihf-ranlib | 217 export RANLIB=arm-linux-gnueabihf-ranlib |
| 218 export SYSROOT | |
| 219 export GYP_DEFINES="target_arch=arm \ | 218 export GYP_DEFINES="target_arch=arm \ |
| 220 sysroot=${toolchain_dir} \ | 219 sysroot=${toolchain_dir} \ |
| 221 linux_use_tcmalloc=0 armv7=1 arm_thumb=1" | 220 linux_use_tcmalloc=0 armv7=1 arm_thumb=1" |
| 222 export GYP_GENERATORS=make | 221 export GYP_GENERATORS=make |
| 223 | 222 |
| 224 # NOTE: this step is also run implicitly as part of | 223 # NOTE: this step is also run implicitly as part of |
| 225 # gclient runhooks --force | 224 # gclient runhooks --force |
| 226 # it uses the exported env vars so we have to run it again | 225 # it uses the exported env vars so we have to run it again |
| 227 # | 226 # |
| 228 echo "@@@BUILD_STEP gyp_configure [${gypmode}]@@@" | 227 echo "@@@BUILD_STEP gyp_configure [${gypmode}]@@@" |
| 229 cd .. | 228 cd .. |
| 230 native_client/build/gyp_nacl native_client/build/all.gyp | 229 native_client/build/gyp_nacl native_client/build/all.gyp |
| 231 cd native_client | 230 cd native_client |
| 232 | 231 |
| 233 echo "@@@BUILD_STEP gyp_compile [${gypmode}]@@@" | 232 echo "@@@BUILD_STEP gyp_compile [${gypmode}]@@@" |
| 234 make -C .. -k -j8 V=1 BUILDTYPE=${gypmode} | 233 make -C .. -k -j8 V=1 BUILDTYPE=${gypmode} |
| 235 } | 234 } |
| 236 | 235 |
| 236 # Build with gyp for MIPS. | |
| 237 gyp-mips32-build() { | |
| 238 local gypmode="Release" | |
| 239 if [ "${BUILD_MODE_HOST}" = "DEBUG" ] ; then | |
| 240 gypmode="Debug" | |
| 241 fi | |
| 242 local toolchain_dir=native_client/toolchain/linux_x86/mips_trusted | |
|
Mark Seaborn
2014/10/13 15:34:44
Maybe use "$(pwd)/toolchain..."? See other commen
petarj
2014/10/13 19:05:10
Done.
| |
| 243 local extra="-EL -isystem ${toolchain_dir}/usr/include \ | |
| 244 -Wl,-rpath-link=${toolchain_dir}/lib/mipsel-linux-gnu \ | |
| 245 -L${toolchain_dir}/lib \ | |
| 246 -L${toolchain_dir}/lib/mipsel-linux-gnu \ | |
| 247 -L${toolchain_dir}/usr/lib \ | |
| 248 -L${toolchain_dir}/usr/lib/mipsel-linux-gnu" | |
| 249 # Setup environment for mips32. | |
| 250 | |
| 251 # Check if MIPS TC has already been built. If not, build it. | |
| 252 if [ ! -f ${toolchain_dir}/bin/mipsel-linux-gnu-gcc ] | |
| 253 then tools/trusted_cross_toolchains/trusted-toolchain-creator.mipsel.debian. sh nacl_sdk | |
| 254 fi | |
| 255 | |
| 256 local bin=$(pwd)/toolchain/linux_x86/mips_trusted/bin | |
|
Mark Seaborn
2014/10/13 15:34:44
You could reuse $toolchain_dir from above. (Altho
petarj
2014/10/13 19:05:10
Done.
| |
| 257 | |
| 258 export AR="$bin/mipsel-linux-gnu-ar" | |
| 259 export AS="$bin/mipsel-linux-gnu-as" | |
| 260 export CC="$bin/mipsel-linux-gnu-gcc ${extra}" | |
| 261 export CXX="$bin/mipsel-linux-gnu-g++ ${extra}" | |
| 262 export LD="$bin/mipsel-linux-gnu-g++ ${extra}" | |
| 263 export RANLIB="$bin/mipsel-linux-gnu-ranlib" | |
| 264 export GYP_DEFINES="target_arch=mipsel mips_arch_variant=mips32r2" | |
| 265 export GYP_GENERATORS=make | |
| 266 | |
| 267 # NOTE: this step is also run implicitly as part of | |
| 268 # gclient runhooks --force | |
| 269 # it uses the exported env vars so we have to run it again | |
| 270 # | |
| 271 echo "@@@BUILD_STEP gyp_configure [${gypmode}]@@@" | |
| 272 cd .. | |
| 273 native_client/build/gyp_nacl native_client/build/all.gyp | |
| 274 cd native_client | |
| 275 | |
| 276 echo "@@@BUILD_STEP gyp_compile [${gypmode}]@@@" | |
| 277 make -C .. -k -j8 V=1 BUILDTYPE=${gypmode} | |
| 278 } | |
| 279 | |
| 237 build-sbtc-prerequisites() { | 280 build-sbtc-prerequisites() { |
| 238 local platform=$1 | 281 local platform=$1 |
| 239 # Sandboxed translators currently only require irt_core since they do not | 282 # Sandboxed translators currently only require irt_core since they do not |
| 240 # use PPAPI. | 283 # use PPAPI. |
| 241 ${SCONS_COMMON} platform=${platform} sel_ldr sel_universal irt_core | 284 ${SCONS_COMMON} platform=${platform} sel_ldr sel_universal irt_core |
| 242 } | 285 } |
| 243 | 286 |
| 244 # Run a single invocation of scons as its own buildbot stage and handle errors | 287 # Run a single invocation of scons as its own buildbot stage and handle errors |
| 245 scons-stage-irt() { | 288 scons-stage-irt() { |
| 246 local platform=$1 | 289 local platform=$1 |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 355 | 398 |
| 356 # Test Non-SFI Mode. | 399 # Test Non-SFI Mode. |
| 357 scons-stage-irt "arm" "${hwflags}" "${SCONS_NONSFI_NEWLIB}" | 400 scons-stage-irt "arm" "${hwflags}" "${SCONS_NONSFI_NEWLIB}" |
| 358 scons-stage-irt "arm" "${hwflags}" \ | 401 scons-stage-irt "arm" "${hwflags}" \ |
| 359 "${SCONS_NONSFI_NEWLIB_NOPNACL_GENERATE_PEXE}" | 402 "${SCONS_NONSFI_NEWLIB_NOPNACL_GENERATE_PEXE}" |
| 360 scons-stage-irt "arm" "${hwflags}" "${SCONS_NONSFI}" | 403 scons-stage-irt "arm" "${hwflags}" "${SCONS_NONSFI}" |
| 361 } | 404 } |
| 362 | 405 |
| 363 mode-trybot-qemu() { | 406 mode-trybot-qemu() { |
| 364 clobber | 407 clobber |
| 408 local arch=$1 | |
| 365 # TODO(dschuff): move the gyp build to buildbot_pnacl.py | 409 # TODO(dschuff): move the gyp build to buildbot_pnacl.py |
| 366 gyp-arm-build | 410 if [[ ${arch} == "arm" ]] ; then |
| 411 gyp-arm-build | |
| 412 elif [[ ${arch} == "mips32" ]] ; then | |
| 413 gyp-mips32-build | |
| 414 fi | |
| 367 | 415 |
| 368 buildbot/buildbot_pnacl.py opt arm pnacl | 416 # TODO(petarj): Enable this for MIPS arch too once all the tests pass. |
| 417 if [[ ${arch} == "arm" ]] ; then | |
| 418 buildbot/buildbot_pnacl.py opt $arch pnacl | |
| 419 fi | |
| 369 } | 420 } |
| 370 | 421 |
| 371 mode-buildbot-arm-dbg() { | 422 mode-buildbot-arm-dbg() { |
| 372 BUILD_MODE_HOST=DEDUG | 423 BUILD_MODE_HOST=DEDUG |
| 373 mode-buildbot-arm | 424 mode-buildbot-arm |
| 374 archive-for-hw-bots $(NAME_ARM_UPLOAD) regular | 425 archive-for-hw-bots $(NAME_ARM_UPLOAD) regular |
| 375 } | 426 } |
| 376 | 427 |
| 377 mode-buildbot-arm-opt() { | 428 mode-buildbot-arm-opt() { |
| 378 mode-buildbot-arm | 429 mode-buildbot-arm |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 498 exit 1 | 549 exit 1 |
| 499 fi | 550 fi |
| 500 | 551 |
| 501 "$@" | 552 "$@" |
| 502 | 553 |
| 503 if [[ ${RETCODE} != 0 ]]; then | 554 if [[ ${RETCODE} != 0 ]]; then |
| 504 echo "@@@BUILD_STEP summary@@@" | 555 echo "@@@BUILD_STEP summary@@@" |
| 505 echo There were failed stages. | 556 echo There were failed stages. |
| 506 exit ${RETCODE} | 557 exit ${RETCODE} |
| 507 fi | 558 fi |
| OLD | NEW |