Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # exit on error
- set -e
- # print each line
- set -x
- # directory structure
- HOMEDIR=/home/kit
- NACLDIR=$HOMEDIR/nativeclient/native_client/tools
- SRCDIR=$NACLDIR/SRC
- BLDDIR=$NACLDIR/BUILD
- TRGDIR=$NACLDIR/out/nacl-sdk
- # TODO where we run the whole thing?
- # compile binutils
- cd $SRCDIR/binutils/
- CC="gcc -m32" \
- CFLAGS="" \
- LDFLAGS="-s " \
- $SRCDIR/binutils/configure \
- --prefix=$TRGDIR \
- --target=x86_64-nacl \
- --with-sysroot=$TRGDIR/x86_64-nacl \
- --disable-werror \
- make -C BUILD/build-binutils-x86_64-nacl all
- # compile gcc
- cd $SRCDIR/gcc
- CC="gcc -m32" \
- CFLAGS="-O2 -Dinhibit_libc -D__gthr_posix_h" \
- LDFLAGS="-s " \
- CFLAGS_FOR_TARGET="-O2 -g " \
- CXXFLAGS_FOR_TARGET="-O2 -g " \
- PATH=$PATH:$TRGDIR/bin: \
- export PATH
- $SRCDIR/gcc/configure \
- --prefix=$TRGDIR \
- --disable-decimal-float
- --disable-libgomp
- --disable-libmudflap
- --disable-libssp
- --disable-libstdcxx-pch
- --target=x86_64-nacl
- --with-gmp=$BLDDIR/.gcc-extra-install-gmp
- --with-mpfr=$BLDDIR/.gcc-extra-install-mpfr
- --with-ppl=$BLDDIR/.gcc-extra-install-ppl
- --with-host-libstdcxx="-lpwl -lstdc++ -lm"
- --with-cloog=$BLDDIR/.gcc-extra-install-cloog-ppl
- --disable-ppl-version-check \
- --disable-shared \
- --disable-threads \
- --enable-languages="c" \
- --without-headers \
- make -C BUILD/build-pregcc-x86_64-nacl all-gcc all-target-libgcc
- # compile newlib
- cd $SRCDIR/newlib
- CC="gcc -m32" \
- CFLAGS="-O2 " \
- CFLAGS_FOR_TARGET='-O2 -D_I386MACH_ALLOW_HW_INTERRUPTS -DSIGNAL_PROVIDED -mtls-use-call' \
- CXXFLAGS_FOR_TARGET='-O2 -D_I386MACH_ALLOW_HW_INTERRUPTS -DSIGNAL_PROVIDED -mtls-use-call' \
- PATH=$PATH:$TRGDIR/bin: \
- export PATH
- $SRCDIR/newlib/configure \
- --disable-libgloss \
- --enable-newlib-iconv \
- --enable-newlib-io-long-long \
- --enable-newlib-io-long-double \
- --enable-newlib-io-c99-formats \
- --enable-newlib-mb \
- --prefix=$TRGDIR \
- --target=x86_64-nacl \
- make -C BUILD/newlib \
- make DESTDIR= install
Add Comment
Please, Sign In to add comment