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

Side by Side Diff: tools/trusted_cross_toolchains/trusted-toolchain-creator.mipsel.wheezy.sh

Issue 16880002: [MIPS] Switch the script to use packages from Debian Wheezy (Closed) Base URL: http://git.chromium.org/native_client/src/native_client.git@master
Patch Set: Created 7 years, 6 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 | « tools/trusted_cross_toolchains/trusted-toolchain-creator.mipsel.squeeze.sh ('k') | no next file » | 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
Mark Seaborn 2013/06/18 15:26:21 Can you rename this file to remove "wheezy" from t
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 creates the mips trusted SDK. 6 #@ This script creates the mips trusted SDK.
7 #@ It must be run from the native_client directory. 7 #@ It must be run from the native_client directory.
8 8
9 # This script is intended to build a mipsel-linux-gnu cross compilation 9 # This script is intended to build a mipsel-linux-gnu cross compilation
10 # toolchain that runs on x86 linux and generates code for a little-endian, 10 # toolchain that runs on x86 linux and generates code for a little-endian,
11 # hard-float, mips32 target. 11 # hard-float, mips32 target.
12 #
13 # It expects the host machine to have relatively recent versions of GMP (4.2.0
14 # or later), MPFR (2.4.2), and MPC (0.8.1) in order to build the GCC.
15 #
16 # Common way to get those is:
17 # sudo apt-get install libmpfr-dev libmpc-dev libgmp3-dev
18 12
19 ###################################################################### 13 ######################################################################
20 # Config 14 # Config
21 ###################################################################### 15 ######################################################################
22 16
23 set -o nounset 17 set -o nounset
24 set -o errexit 18 set -o errexit
25 set -o xtrace 19 set -o xtrace
26 20
27 readonly SCRIPT_DIR=$(dirname $0) 21 readonly SCRIPT_DIR=$(dirname $0)
28 22
29 readonly MAKE_OPTS="-j8" 23 readonly MAKE_OPTS="-j8"
30 readonly ARCH="mips32" 24 readonly ARCH="mips32"
31 25
26 readonly GMP_URL="http://ftp.gnu.org/gnu/gmp/gmp-4.3.2.tar.bz2"
27 readonly GMP_SHA1SUM="c011e8feaf1bb89158bd55eaabd7ef8fdd101a2c"
28
29 readonly MPFR_URL="http://ftp.gnu.org/gnu/mpfr/mpfr-2.4.2.tar.bz2"
30 readonly MPFR_SHA1SUM="7ca93006e38ae6e53a995af836173cf10ee7c18c"
31
32 readonly MPC_URL="http://ftp.gnu.org/gnu/mpc/mpc-1.0.1.tar.gz"
33 readonly MPC_SHA1SUM="8c7e19ad0dd9b3b5cc652273403423d6cf0c5edf"
34
32 readonly GCC_URL="http://ftp.gnu.org/gnu/gcc/gcc-4.7.2/gcc-4.7.2.tar.bz2" 35 readonly GCC_URL="http://ftp.gnu.org/gnu/gcc/gcc-4.7.2/gcc-4.7.2.tar.bz2"
33 readonly GCC_SHA1SUM="a464ba0f26eef24c29bcd1e7489421117fb9ee35" 36 readonly GCC_SHA1SUM="a464ba0f26eef24c29bcd1e7489421117fb9ee35"
34 37
35 readonly BINUTILS_URL="http://ftp.gnu.org/gnu/binutils/binutils-2.22.tar.bz2" 38 readonly BINUTILS_URL="http://ftp.gnu.org/gnu/binutils/binutils-2.22.tar.bz2"
36 readonly BINUTILS_SHA1SUM="65b304a0b9a53a686ce50a01173d1f40f8efe404" 39 readonly BINUTILS_SHA1SUM="65b304a0b9a53a686ce50a01173d1f40f8efe404"
37 40
38 readonly KERNEL_URL="http://www.linux-mips.org/pub/linux/mips/kernel/v2.6/linux- 2.6.38.4.tar.gz" 41 readonly KERNEL_URL="http://www.linux-mips.org/pub/linux/mips/kernel/v2.6/linux- 2.6.38.4.tar.gz"
39 readonly KERNEL_SHA1SUM="377fa5cf5f1d0c396759b1c4d147330e7e5b6d7f" 42 readonly KERNEL_SHA1SUM="377fa5cf5f1d0c396759b1c4d147330e7e5b6d7f"
40 43
41 readonly GDB_URL="http://ftp.gnu.org/gnu/gdb/gdb-7.5.tar.bz2" 44 readonly GDB_URL="http://ftp.gnu.org/gnu/gdb/gdb-7.5.tar.bz2"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 local url=$1 94 local url=$1
92 local revision=$2 95 local revision=$2
93 local filename="${TMP}/${url##*/}" 96 local filename="${TMP}/${url##*/}"
94 local filetype="${url%%:*}" 97 local filetype="${url%%:*}"
95 98
96 if [ "${filename}" == "" ]; then 99 if [ "${filename}" == "" ]; then
97 echo "Unknown error occured. Aborting." 100 echo "Unknown error occured. Aborting."
98 exit 1 101 exit 1
99 fi 102 fi
100 103
101 if [ "${filetype}" == "svn" ]; then 104 if [ ! -f "${filename}/completed" ]; then
102 SubBanner "checkout from ${url} -> ${filename}" 105 if [ "${filetype}" == "svn" ]; then
103 svn --force export -r ${revision} ${url} ${filename} 106 SubBanner "checkout from ${url} -> ${filename}"
104 else 107 svn --force export -r ${revision} ${url} ${filename}
105 SubBanner "copying from ${url}" 108 else
106 cp ${url} ${filename} 109 SubBanner "copying from ${url}"
110 cp ${url} ${filename}
111 fi
112 touch ${filename}/completed
107 fi 113 fi
108 } 114 }
109 115
110 DownloadOrCopy() { 116 DownloadOrCopy() {
111 local url=$1 117 local url=$1
112 local filename="${TMP}/${url##*/}" 118 local filename="${TMP}/${url##*/}"
113 local filetype="${url%%:*}" 119 local filetype="${url%%:*}"
114 120
115 if [ "${filename}" == "" ]; then 121 if [ "${filename}" == "" ]; then
116 echo "Unknown error occured. Aborting." 122 echo "Unknown error occured. Aborting."
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 if [[ $(basename $(pwd)) != "native_client" ]] ; then 174 if [[ $(basename $(pwd)) != "native_client" ]] ; then
169 echo "ERROR: run this script from the native_client/ dir" 175 echo "ERROR: run this script from the native_client/ dir"
170 exit -1 176 exit -1
171 fi 177 fi
172 178
173 if ! mkdir -p "${INSTALL_ROOT}" ; then 179 if ! mkdir -p "${INSTALL_ROOT}" ; then
174 echo "ERROR: ${INSTALL_ROOT} can't be created." 180 echo "ERROR: ${INSTALL_ROOT} can't be created."
175 exit -1 181 exit -1
176 fi 182 fi
177 183
178 for tool in cleanlinks wget ; do 184 for tool in wget ; do
179 if ! which ${tool} ; then 185 if ! which ${tool} ; then
180 echo "Required binary $tool not found." 186 echo "Required binary $tool not found."
181 echo "Exiting." 187 echo "Exiting."
182 exit 1 188 exit 1
183 fi 189 fi
184 done 190 done
185 } 191 }
186 192
187 193
188 ClearInstallDir() { 194 ClearInstallDir() {
189 Banner "clearing dirs in ${INSTALL_ROOT}" 195 Banner "clearing dirs in ${INSTALL_ROOT}"
190 rm -rf ${INSTALL_ROOT}/* 196 rm -rf ${INSTALL_ROOT}/*
197
Mark Seaborn 2013/06/18 15:26:21 Did you intend to add this empty line? It seems s
petarj 2013/06/19 23:12:33 Removed.
191 mkdir -p ${JAIL_MIPS32} 198 mkdir -p ${JAIL_MIPS32}
192 } 199 }
193 200
194 ClearBuildDir() { 201 ClearBuildDir() {
195 Banner "clearing dirs in ${BUILD_DIR}" 202 Banner "clearing dirs in ${BUILD_DIR}"
196 rm -rf ${BUILD_DIR}/* 203 rm -rf ${BUILD_DIR}/*
197 } 204 }
198 205
199 CreateTarBall() { 206 CreateTarBall() {
200 local tarball=$1 207 local tarball=$1
201 Banner "creating tar ball ${tarball}" 208 Banner "creating tar ball ${tarball}"
202 tar cfz ${tarball}.tgz -C ${INSTALL_ROOT} . 209 tar cfz ${tarball}.tgz -C ${INSTALL_ROOT} .
203 } 210 }
204 211
205 212
206 # Download the toolchain source tarballs or use a local copy when available. 213 # Download the toolchain source tarballs or use a local copy when available.
207 DownloadOrCopyAndInstallToolchain() { 214 DownloadOrCopyAndInstallToolchain() {
208 Banner "Installing toolchain" 215 Banner "Installing toolchain"
209 216
217 tarball="${TMP}/${GCC_URL##*/}"
218 DownloadOrCopyAndVerify ${GCC_URL} ${GCC_SHA1SUM}
219 SubBanner "extracting from ${tarball}"
220 tar jxf ${tarball} -C ${TMP}
221
222 pushd ${TMP}/gcc-*
223
224 local tarball="${TMP}/${GMP_URL##*/}"
225 DownloadOrCopyAndVerify ${GMP_URL} ${GMP_SHA1SUM}
226 SubBanner "extracting from ${tarball}"
227 tar jxf ${tarball}
228 local filename=`ls | grep gmp\-`
229 rm -f gmp
230 ln -s ${filename} gmp
231
232 local tarball="${TMP}/${MPFR_URL##*/}"
233 DownloadOrCopyAndVerify ${MPFR_URL} ${MPFR_SHA1SUM}
234 SubBanner "extracting from ${tarball}"
235 tar jxf ${tarball}
236 local filename=`ls | grep mpfr\-`
237 rm -f mpfr
238 ln -s ${filename} mpfr
239
240 local tarball="${TMP}/${MPC_URL##*/}"
241 DownloadOrCopyAndVerify ${MPC_URL} ${MPC_SHA1SUM}
242 SubBanner "extracting from ${tarball}"
243 tar zxf ${tarball}
244 local filename=`ls | grep mpc\-`
245 rm -f mpc
246 ln -s ${filename} mpc
247
248 popd
249
210 local tarball="${TMP}/${BINUTILS_URL##*/}" 250 local tarball="${TMP}/${BINUTILS_URL##*/}"
211 DownloadOrCopyAndVerify ${BINUTILS_URL} ${BINUTILS_SHA1SUM} 251 DownloadOrCopyAndVerify ${BINUTILS_URL} ${BINUTILS_SHA1SUM}
212 SubBanner "extracting from ${tarball}" 252 SubBanner "extracting from ${tarball}"
213 tar jxf ${tarball} -C ${TMP} 253 tar jxf ${tarball} -C ${TMP}
214 254
215 tarball="${TMP}/${GCC_URL##*/}"
216 DownloadOrCopyAndVerify ${GCC_URL} ${GCC_SHA1SUM}
217 SubBanner "extracting from ${tarball}"
218 tar jxf ${tarball} -C ${TMP}
219
220 tarball="${TMP}/${GDB_URL##*/}" 255 tarball="${TMP}/${GDB_URL##*/}"
221 DownloadOrCopyAndVerify ${GDB_URL} ${GDB_SHA1SUM} 256 DownloadOrCopyAndVerify ${GDB_URL} ${GDB_SHA1SUM}
222 SubBanner "extracting from ${tarball}" 257 SubBanner "extracting from ${tarball}"
223 tar jxf ${tarball} -C ${TMP} 258 tar jxf ${tarball} -C ${TMP}
224 259
225 tarball="${TMP}/${KERNEL_URL##*/}" 260 tarball="${TMP}/${KERNEL_URL##*/}"
226 DownloadOrCopyAndVerify ${KERNEL_URL} ${KERNEL_SHA1SUM} 261 DownloadOrCopyAndVerify ${KERNEL_URL} ${KERNEL_SHA1SUM}
227 SubBanner "extracting from ${tarball}" 262 SubBanner "extracting from ${tarball}"
228 tar zxf ${tarball} -C ${TMP} 263 tar zxf ${tarball} -C ${TMP}
229 264
(...skipping 11 matching lines...) Expand all
241 local OLD_TEXT="as_warn_where (fragp->fr_file, fragp->fr_line, msg);" 276 local OLD_TEXT="as_warn_where (fragp->fr_file, fragp->fr_line, msg);"
242 local NEW_TEXT="as_warn_where (fragp->fr_file, fragp->fr_line, \"%s\", msg);" 277 local NEW_TEXT="as_warn_where (fragp->fr_file, fragp->fr_line, \"%s\", msg);"
243 local FILE_NAME="${TMP}/binutils-2.22/gas/config/tc-mips.c" 278 local FILE_NAME="${TMP}/binutils-2.22/gas/config/tc-mips.c"
244 sed -i "s/${OLD_TEXT}/${NEW_TEXT}/g" "${FILE_NAME}" 279 sed -i "s/${OLD_TEXT}/${NEW_TEXT}/g" "${FILE_NAME}"
245 280
246 export PATH=${INSTALL_ROOT}/bin:$PATH 281 export PATH=${INSTALL_ROOT}/bin:$PATH
247 282
248 283
249 Banner "Building binutils" 284 Banner "Building binutils"
250 285
286 rm -rf ${BUILD_DIR}/binutils/
251 mkdir -p ${BUILD_DIR}/binutils/ 287 mkdir -p ${BUILD_DIR}/binutils/
252 pushd ${BUILD_DIR}/binutils/ 288 pushd ${BUILD_DIR}/binutils/
253 289
254 SubBanner "Configuring" 290 SubBanner "Configuring"
255 ${TMP}/binutils-2.22/configure \ 291 ${TMP}/binutils-2.22/configure \
256 --prefix=${INSTALL_ROOT} \ 292 --prefix=${INSTALL_ROOT} \
257 --target=mipsel-linux-gnu \ 293 --target=mipsel-linux-gnu \
258 --with-sysroot=${JAIL_MIPS32} 294 --with-sysroot=${JAIL_MIPS32}
259 295
260 SubBanner "Make" 296 SubBanner "Make"
261 make ${MAKE_OPTS} all-binutils all-gas all-ld 297 make ${MAKE_OPTS} all-binutils all-gas all-ld
262 298
263 SubBanner "Install" 299 SubBanner "Install"
264 make ${MAKE_OPTS} install-binutils install-gas install-ld 300 make ${MAKE_OPTS} install-binutils install-gas install-ld
265 301
266 popd 302 popd
267 303
268 304
269 Banner "Building GCC (initial)" 305 Banner "Building GCC (initial)"
270 306
307 rm -rf ${BUILD_DIR}/gcc/initial
271 mkdir -p ${BUILD_DIR}/gcc/initial 308 mkdir -p ${BUILD_DIR}/gcc/initial
272 pushd ${BUILD_DIR}/gcc/initial 309 pushd ${BUILD_DIR}/gcc/initial
273 310
274 SubBanner "Configuring" 311 SubBanner "Configuring"
275 ${TMP}/gcc-4.7.2/configure \ 312 ${TMP}/gcc-4.7.2/configure \
276 --prefix=${INSTALL_ROOT} \ 313 --prefix=${INSTALL_ROOT} \
277 --disable-libssp \ 314 --disable-libssp \
278 --disable-libgomp \ 315 --disable-libgomp \
279 --disable-libmudflap \ 316 --disable-libmudflap \
280 --disable-fixed-point \ 317 --disable-fixed-point \
(...skipping 21 matching lines...) Expand all
302 339
303 Banner "Installing Linux kernel headers" 340 Banner "Installing Linux kernel headers"
304 pushd ${TMP}/linux-2.6.38.4 341 pushd ${TMP}/linux-2.6.38.4
305 make headers_install ARCH=mips INSTALL_HDR_PATH=${JAIL_MIPS32}/usr 342 make headers_install ARCH=mips INSTALL_HDR_PATH=${JAIL_MIPS32}/usr
306 popd 343 popd
307 344
308 345
309 Banner "Building EGLIBC (initial)" 346 Banner "Building EGLIBC (initial)"
310 347
311 mkdir -p ${JAIL_MIPS32}/usr/lib 348 mkdir -p ${JAIL_MIPS32}/usr/lib
349
350 rm -rf ${BUILD_DIR}/eglibc/initial
312 mkdir -p ${BUILD_DIR}/eglibc/initial 351 mkdir -p ${BUILD_DIR}/eglibc/initial
313 pushd ${BUILD_DIR}/eglibc/initial 352 pushd ${BUILD_DIR}/eglibc/initial
314 353
315 SubBanner "Configuring" 354 SubBanner "Configuring"
316 BUILD_CC=gcc \ 355 BUILD_CC=gcc \
317 AR=mipsel-linux-gnu-ar \ 356 AR=mipsel-linux-gnu-ar \
318 RANLIB=mipsel-linux-gnu-ranlib \ 357 RANLIB=mipsel-linux-gnu-ranlib \
319 CC=mipsel-linux-gnu-gcc \ 358 CC=mipsel-linux-gnu-gcc \
320 CXX=mipsel-linux-gnu-g++ \ 359 CXX=mipsel-linux-gnu-g++ \
321 ${TMP}/eglibc-2_14/libc/configure \ 360 ${TMP}/eglibc-2_14/libc/configure \
(...skipping 17 matching lines...) Expand all
339 -nostartfiles \ 378 -nostartfiles \
340 -shared \ 379 -shared \
341 -x c /dev/null \ 380 -x c /dev/null \
342 -o ${JAIL_MIPS32}/usr/lib/libc.so 381 -o ${JAIL_MIPS32}/usr/lib/libc.so
343 382
344 popd 383 popd
345 384
346 385
347 Banner "Building GCC (intermediate)" 386 Banner "Building GCC (intermediate)"
348 387
388 rm -rf ${BUILD_DIR}/gcc/intermediate
349 mkdir -p ${BUILD_DIR}/gcc/intermediate 389 mkdir -p ${BUILD_DIR}/gcc/intermediate
350 pushd ${BUILD_DIR}/gcc/intermediate 390 pushd ${BUILD_DIR}/gcc/intermediate
351 391
352 SubBanner "Configuring" 392 SubBanner "Configuring"
353 ${TMP}/gcc-4.7.2/configure \ 393 ${TMP}/gcc-4.7.2/configure \
354 --prefix=${INSTALL_ROOT} \ 394 --prefix=${INSTALL_ROOT} \
355 --disable-libssp \ 395 --disable-libssp \
356 --disable-libgomp \ 396 --disable-libgomp \
357 --disable-libmudflap \ 397 --disable-libmudflap \
358 --disable-fixed-point \ 398 --disable-fixed-point \
(...skipping 11 matching lines...) Expand all
370 make ${MAKE_OPTS} all 410 make ${MAKE_OPTS} all
371 411
372 SubBanner "Install" 412 SubBanner "Install"
373 make ${MAKE_OPTS} install 413 make ${MAKE_OPTS} install
374 414
375 popd 415 popd
376 416
377 417
378 Banner "Building EGLIBC (final)" 418 Banner "Building EGLIBC (final)"
379 419
420 rm -rf ${BUILD_DIR}/eglibc/final
380 mkdir -p ${BUILD_DIR}/eglibc/final 421 mkdir -p ${BUILD_DIR}/eglibc/final
381 pushd ${BUILD_DIR}/eglibc/final 422 pushd ${BUILD_DIR}/eglibc/final
382 423
383 BUILD_CC=gcc \ 424 BUILD_CC=gcc \
384 AR=mipsel-linux-gnu-ar \ 425 AR=mipsel-linux-gnu-ar \
385 RANLIB=mipsel-linux-gnu-ranlibi \ 426 RANLIB=mipsel-linux-gnu-ranlibi \
386 CC=mipsel-linux-gnu-gcc \ 427 CC=mipsel-linux-gnu-gcc \
387 CXX=mipsel-linux-gnu-g++ \ 428 CXX=mipsel-linux-gnu-g++ \
388 ${TMP}/eglibc-2_14/libc/configure \ 429 ${TMP}/eglibc-2_14/libc/configure \
389 --prefix=/usr \ 430 --prefix=/usr \
390 --enable-add-ons \ 431 --enable-add-ons \
391 --host=mipsel-linux-gnu \ 432 --host=mipsel-linux-gnu \
392 --disable-profile \ 433 --disable-profile \
393 --without-gd \ 434 --without-gd \
394 --without-cvs \ 435 --without-cvs \
395 --build=i686-pc-linux-gnu \ 436 --build=i686-pc-linux-gnu \
396 --with-headers=${JAIL_MIPS32}/usr/include 437 --with-headers=${JAIL_MIPS32}/usr/include
397 438
398 SubBanner "Make" 439 SubBanner "Make"
399 make ${MAKE_OPTS} all 440 make ${MAKE_OPTS} all
400 441
401 SubBanner "Install" 442 SubBanner "Install"
402 make ${MAKE_OPTS} install install_root=${JAIL_MIPS32} 443 make ${MAKE_OPTS} install install_root=${JAIL_MIPS32}
403 444
404 popd 445 popd
405 446
406 447
407 Banner "Building GCC (final)" 448 Banner "Building GCC (final)"
408 449
450 rm -rf ${BUILD_DIR}/gcc/final
409 mkdir -p ${BUILD_DIR}/gcc/final 451 mkdir -p ${BUILD_DIR}/gcc/final
410 pushd ${BUILD_DIR}/gcc/final 452 pushd ${BUILD_DIR}/gcc/final
411 453
412 ${TMP}/gcc-4.7.2/configure \ 454 ${TMP}/gcc-4.7.2/configure \
413 --prefix=${INSTALL_ROOT} \ 455 --prefix=${INSTALL_ROOT} \
414 --disable-libssp \ 456 --disable-libssp \
415 --disable-libgomp \ 457 --disable-libgomp \
416 --disable-libmudflap \ 458 --disable-libmudflap \
417 --disable-fixed-point \ 459 --disable-fixed-point \
418 --disable-decimal-float \ 460 --disable-decimal-float \
419 --with-mips-plt \ 461 --with-mips-plt \
420 --with-endian=little \ 462 --with-endian=little \
421 --with-arch=${ARCH} \ 463 --with-arch=${ARCH} \
422 --target=mipsel-linux-gnu \ 464 --target=mipsel-linux-gnu \
423 --enable-__cxa_atexit \ 465 --enable-__cxa_atexit \
424 --enable-languages=c,c++ \ 466 --enable-languages=c,c++ \
425 --with-sysroot=${JAIL_MIPS32} 467 --with-sysroot=${JAIL_MIPS32}
426 468
427 SubBanner "Make" 469 SubBanner "Make"
428 make ${MAKE_OPTS} all 470 make ${MAKE_OPTS} all
429 471
430 SubBanner "Install" 472 SubBanner "Install"
431 make ${MAKE_OPTS} install 473 make ${MAKE_OPTS} install
432 474
433 popd 475 popd
434 476
435 477
436 Banner "Building GDB" 478 Banner "Building GDB"
437 479
480 rm -rf ${BUILD_DIR}/gdb/
438 mkdir -p ${BUILD_DIR}/gdb/ 481 mkdir -p ${BUILD_DIR}/gdb/
439 pushd ${BUILD_DIR}/gdb/ 482 pushd ${BUILD_DIR}/gdb/
440 483
441 ${TMP}/gdb-7.5/configure \ 484 ${TMP}/gdb-7.5/configure \
442 --prefix=${INSTALL_ROOT} \ 485 --prefix=${INSTALL_ROOT} \
443 --target=mipsel-linux-gnu 486 --target=mipsel-linux-gnu
444 487
445 SubBanner "Make" 488 SubBanner "Make"
446 make ${MAKE_OPTS} all-gdb 489 make ${MAKE_OPTS} all-gdb
447 490
(...skipping 17 matching lines...) Expand all
465 grep -v "=======" |\ 508 grep -v "=======" |\
466 sed -e 's/0400000/70000000/g' > ${trusted_ld_script} 509 sed -e 's/0400000/70000000/g' > ${trusted_ld_script}
467 } 510 }
468 511
469 512
470 # ---------------------------------------------------------------------- 513 # ----------------------------------------------------------------------
471 # mips32 deb files to complete our code sourcery jail 514 # mips32 deb files to complete our code sourcery jail
472 # ---------------------------------------------------------------------- 515 # ----------------------------------------------------------------------
473 516
474 readonly REPO_DEBIAN=http://ftp.debian.org/debian 517 readonly REPO_DEBIAN=http://ftp.debian.org/debian
475 readonly MIPS32_PACKAGES=${REPO_DEBIAN}/dists/squeeze/main/binary-mipsel/Package s.bz2 518 readonly MIPS32_PACKAGES=${REPO_DEBIAN}/dists/wheezy/main/binary-mipsel/Packages .bz2
476 519
477 readonly BASE_PACKAGELIST_MIPS32=${SCRIPT_DIR}/packagelist.squeeze.mipsel.base 520 readonly BASE_PACKAGELIST_MIPS32=${SCRIPT_DIR}/packagelist.wheezy.mipsel.base
478 readonly EXTRA_PACKAGELIST_MIPS32=${SCRIPT_DIR}/packagelist.squeeze.mipsel.extra 521 readonly EXTRA_PACKAGELIST_MIPS32=${SCRIPT_DIR}/packagelist.wheezy.mipsel.extra
479 readonly TMP_BASE_PKG_MIPS32=${TMP}/packagelist.generated.squeeze.mipsel.base 522 readonly TMP_BASE_PKG_MIPS32=${TMP}/packagelist.generated.wheezy.mipsel.base
480 readonly TMP_EXTRA_PKG_MIPS32=${TMP}/packagelist.generated.squeeze.mipsel.extra 523 readonly TMP_EXTRA_PKG_MIPS32=${TMP}/packagelist.generated.wheezy.mipsel.extra
481 524
482 GeneratePackageLists() { 525 GeneratePackageLists() {
483 local sdk_target=$1 526 local sdk_target=$1
484 local packages= 527 local packages=
485 local TMP_PACKAGELIST= 528 local TMP_PACKAGELIST=
486 Banner "generating ${sdk_target} package lists for mips32" 529 Banner "generating ${sdk_target} package lists for mips32"
530 rm -f ${TMP}/Packages.bz2
487 DownloadOrCopy ${MIPS32_PACKAGES} 531 DownloadOrCopy ${MIPS32_PACKAGES}
488 bzcat ${TMP}/Packages.bz2\ 532 bzcat ${TMP}/Packages.bz2\
489 | egrep '^(Package:|Filename:)' > ${TMP}/Packages_mipsel 533 | egrep '^(Package:|Filename:)' > ${TMP}/Packages_mipsel
490 534
491 if [ ${sdk_target} == "nacl_sdk" ] ; then 535 if [ ${sdk_target} == "nacl_sdk" ] ; then
492 echo -n > ${TMP_BASE_PKG_MIPS32} 536 echo -n > ${TMP_BASE_PKG_MIPS32}
493 TMP_PACKAGELIST=${TMP_BASE_PKG_MIPS32} 537 TMP_PACKAGELIST=${TMP_BASE_PKG_MIPS32}
494 packages=$(cat ${BASE_PACKAGELIST_MIPS32}) 538 packages=$(cat ${BASE_PACKAGELIST_MIPS32})
495 elif [ ${sdk_target} == "chrome_sdk" ] ; then 539 elif [ ${sdk_target} == "chrome_sdk" ] ; then
496 echo -n > ${TMP_EXTRA_PKG_MIPS32} 540 echo -n > ${TMP_EXTRA_PKG_MIPS32}
(...skipping 24 matching lines...) Expand all
521 fi 565 fi
522 566
523 for file in ${DEP_FILES_NEEDED_MIPS32} ; do 567 for file in ${DEP_FILES_NEEDED_MIPS32} ; do
524 local package="${TMP}/${file##*/}" 568 local package="${TMP}/${file##*/}"
525 Banner "installing ${file}" 569 Banner "installing ${file}"
526 DownloadOrCopy ${REPO_DEBIAN}/${file} 570 DownloadOrCopy ${REPO_DEBIAN}/${file}
527 SubBanner "extracting to ${JAIL_MIPS32}" 571 SubBanner "extracting to ${JAIL_MIPS32}"
528 dpkg --fsys-tarfile ${package}\ 572 dpkg --fsys-tarfile ${package}\
529 | tar -xvf - --exclude=./usr/share -C ${JAIL_MIPS32} 573 | tar -xvf - --exclude=./usr/share -C ${JAIL_MIPS32}
530 done 574 done
575 }
531 576
532 Banner "some cleanup" 577 FixIncludes() {
578 Banner "Fixing includes"
Mark Seaborn 2013/06/18 15:26:21 Is this doing something that the Debian packages'
petarj 2013/06/19 23:12:33 No, it is not a postinst step. The Wheezy version
Mark Seaborn 2013/06/20 01:38:17 OK, maybe you could add a comment that this is don
579 pushd ${JAIL_MIPS32}/usr/include/glib-2.0
580 ln -s ../../lib/glib-2.0/include/glibconfig.h .
581 popd
582
583 pushd ${JAIL_MIPS32}/usr/include/gtk-2.0
584 ln -s ../../lib/gtk-2.0/include/gdkconfig.h .
585 popd
586
587 pushd ${JAIL_MIPS32}/usr/include/dbus-1.0/dbus
588 ln -s ../../../lib/dbus-1.0/include/dbus/dbus-arch-deps.h .
589 popd
590 }
591
592 FixLinks() {
593 Banner "Fixing links"
594 pushd ${JAIL_MIPS32}/lib/
595 mv mipsel-linux-gnu/* .
596 rm -rf mipsel-linux-gnu
597 ln -s . mipsel-linux-gnu
598 popd
533 599
534 pushd ${JAIL_MIPS32}/usr/lib/ 600 pushd ${JAIL_MIPS32}/usr/lib/
535 cleanlinks > /dev/null 2> /dev/null 601 mkdir -p pkgconfig
536 FixLibs 602 mv mipsel-linux-gnu/pkgconfig/* pkgconfig/
603 rm -rf mipsel-linux-gnu/pkgconfig
604 mv mipsel-linux-gnu/* .
605 rm -rf mipsel-linux-gnu
606 ln -s . mipsel-linux-gnu
607 popd
608
609 pushd ${JAIL_MIPS32}/usr/lib/
610 rm -f libstdc++.so*
611 ln -s ../../../mipsel-linux-gnu/lib/libstdc++.so.6.0.17 .
612 ln -s libstdc++.so.6.0.17 libstdc++.so.6
613 ln -s libstdc++.so.6.0.17 libstdc++.so
614
615 rm -f libgcc_s.so*
616 ln -s ../../../mipsel-linux-gnu/lib/libgcc_s.so.1 .
617 ln -s libgcc_s.so.1 libgcc_s.so
537 popd 618 popd
538 } 619 }
539 620
540 FixLibs() { 621 FixLibs() {
541 Banner "Fixing libraries" 622 Banner "Fixing libraries"
542 623
543 rm -f libbz2.so 624 readonly liblist="libbz2.so \
Mark Seaborn 2013/06/18 15:26:21 Make this '\' consistent with the following lines
petarj 2013/06/19 23:12:33 Done.
544 ln -s ../../lib/libbz2.so.1 libbz2.so 625 libcom_err.so \
626 libdbus-1.so \
627 libexpat.so \
628 libglib-2.0.so \
629 libgpg-error.so \
630 libkeyutils.so \
631 libpamc.so \
632 libpam_misc.so \
633 libpam.so \
634 libpci.so \
635 libpcre.so \
636 libpng12.so \
637 libudev.so \
638 libz.so"
545 639
546 rm -f libm.so 640 pushd ${JAIL_MIPS32}/usr/lib/
547 ln -s ../../lib/libm.so.6 libm.so 641 for library in ${liblist}; do
548 642 rm -f ${library}
549 rm -f libdl.so 643 ln -s ../../lib/${library}.[0123] ${library}
550 ln -s ../../lib/libdl.so.2 libdl.so 644 done
551 645 popd
552 rm -f librt.so
553 ln -s ../../lib/librt.so.1 librt.so
554
555 rm -f libpcre.so
556 ln -s ../../lib/libpcre.so.3 libpcre.so
557
558 rm -f libresolv.so
559 ln -s ../../lib/libresolv.so.2 libresolv.so
560
561 rm -f libglib-2.0.so
562 ln -s ../../lib/libglib-2.0.so.0 libglib-2.0.so
563
564 rm -f libudev.so
565 ln -s ../../lib/libudev.so.0 libudev.so
566
567 rm -f libcom_err.so
568 ln -s ../../lib/libcom_err.so.2 libcom_err.so
569
570 rm -f libXdmcp.so
571 ln -s ../../lib/libXdmcp.so.6 libXdmcp.so
572
573 rm -f libstdc++.so*
574 ln -s ../../../mipsel-linux-gnu/lib/libstdc++.so.6.0.17 .
575 ln -s libstdc++.so.6.0.17 libstdc++.so.6
576 ln -s libstdc++.so.6.0.17 libstdc++.so
577
578 rm -f libgcc_s.so*
579 ln -s ../../../mipsel-linux-gnu/lib/libgcc_s.so.1 .
580 ln -s libgcc_s.so.1 libgcc_s.so
581 } 646 }
582 647
583 BuildAndInstallQemu() { 648 BuildAndInstallQemu() {
584 local saved_dir=$(pwd) 649 local saved_dir=$(pwd)
585 local tmpdir="${TMP}/qemu-mips.nacl" 650 local tmpdir="${TMP}/qemu-mips.nacl"
586 local tarball="qemu-0.12.5.tar.gz" 651 local tarball="qemu-0.12.5.tar.gz"
587 652
588 Banner "Building qemu in ${tmpdir}" 653 Banner "Building qemu in ${tmpdir}"
589 654
590 rm -rf ${tmpdir} 655 rm -rf ${tmpdir}
(...skipping 17 matching lines...) Expand all
608 SubBanner "Configuring" 673 SubBanner "Configuring"
609 env -i PATH=/usr/bin/:/bin \ 674 env -i PATH=/usr/bin/:/bin \
610 ./configure \ 675 ./configure \
611 --cc=${CC32} \ 676 --cc=${CC32} \
612 --disable-system \ 677 --disable-system \
613 --enable-linux-user \ 678 --enable-linux-user \
614 --disable-darwin-user \ 679 --disable-darwin-user \
615 --disable-bsd-user \ 680 --disable-bsd-user \
616 --target-list=mipsel-linux-user \ 681 --target-list=mipsel-linux-user \
617 --disable-sdl \ 682 --disable-sdl \
618 --disable-linux-aio \ 683 --disable-linux-aio
619 --static
Mark Seaborn 2013/06/18 15:26:21 Please add "BUG=https://code.google.com/p/nativecl
petarj 2013/06/19 23:12:33 Done.
620 684
621 SubBanner "Make" 685 SubBanner "Make"
622 env -i PATH=/usr/bin/:/bin \ 686 env -i PATH=/usr/bin/:/bin \
623 make MAKE_OPTS=${MAKE_OPTS} 687 make MAKE_OPTS=${MAKE_OPTS}
624 688
625 SubBanner "Install" 689 SubBanner "Install"
626 cp mipsel-linux-user/qemu-mipsel ${INSTALL_ROOT}/qemu-mips32 690 cp mipsel-linux-user/qemu-mipsel ${INSTALL_ROOT}/qemu-mips32
627 cd ${saved_dir} 691 cd ${saved_dir}
628 cp tools/trusted_cross_toolchains/qemu_tool_mips32.sh ${INSTALL_ROOT} 692 cp tools/trusted_cross_toolchains/qemu_tool_mips32.sh ${INSTALL_ROOT}
629 ln -sf qemu_tool_mips32.sh ${INSTALL_ROOT}/run_under_qemu_mips32 693 ln -sf qemu_tool_mips32.sh ${INSTALL_ROOT}/run_under_qemu_mips32
(...skipping 10 matching lines...) Expand all
640 exit -1 704 exit -1
641 705
642 elif [[ $1 == "nacl_sdk" || $1 == "chrome_sdk" ]] ; then 706 elif [[ $1 == "nacl_sdk" || $1 == "chrome_sdk" ]] ; then
643 mkdir -p ${TMP} 707 mkdir -p ${TMP}
644 SanityCheck 708 SanityCheck
645 ClearInstallDir 709 ClearInstallDir
646 ClearBuildDir 710 ClearBuildDir
647 DownloadOrCopyAndInstallToolchain 711 DownloadOrCopyAndInstallToolchain
648 GeneratePackageLists $1 712 GeneratePackageLists $1
649 InstallMissingLibraries $1 713 InstallMissingLibraries $1
714 FixLinks
650 if [[ $1 == "nacl_sdk" ]] ; then 715 if [[ $1 == "nacl_sdk" ]] ; then
651 InstallTrustedLinkerScript 716 InstallTrustedLinkerScript
652 BuildAndInstallQemu 717 BuildAndInstallQemu
653 CreateTarBall $1 718 CreateTarBall $1
654 else 719 else
720 FixLibs
721 FixIncludes
655 CreateTarBall ${CROSS_TARBALL} 722 CreateTarBall ${CROSS_TARBALL}
656 fi 723 fi
657 724
658 else 725 else
659 Usage 726 Usage
660 exit -1 727 exit -1
661 728
662 fi 729 fi
663 730
OLDNEW
« no previous file with comments | « tools/trusted_cross_toolchains/trusted-toolchain-creator.mipsel.squeeze.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698