daily pastebin goal
36%
SHARE
TWEET

Untitled

a guest Apr 19th, 2018 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. # exit on error
  4. set -e
  5. # print each line
  6. set -x
  7.  
  8. # directory structure
  9. HOMEDIR=/home/kit
  10. NACLDIR=$HOMEDIR/nativeclient/native_client/tools
  11. SRCDIR=$NACLDIR/SRC
  12. BLDDIR=$NACLDIR/BUILD
  13. TRGDIR=$NACLDIR/out/nacl-sdk
  14.  
  15. # TODO where we run the whole thing?
  16.  
  17. # compile binutils
  18. cd $SRCDIR/binutils/
  19. CC="gcc -m32" \
  20.         CFLAGS="" \
  21.         LDFLAGS="-s " \
  22.         $SRCDIR/binutils/configure \
  23.                 --prefix=$TRGDIR \
  24.                 --target=x86_64-nacl \
  25.                 --with-sysroot=$TRGDIR/x86_64-nacl \
  26.                 --disable-werror \
  27.         make -C BUILD/build-binutils-x86_64-nacl all
  28.  
  29. # compile gcc
  30. cd $SRCDIR/gcc
  31. CC="gcc -m32" \
  32.         CFLAGS="-O2  -Dinhibit_libc -D__gthr_posix_h" \
  33.         LDFLAGS="-s " \
  34.         CFLAGS_FOR_TARGET="-O2 -g " \
  35.         CXXFLAGS_FOR_TARGET="-O2 -g " \
  36.         PATH=$PATH:$TRGDIR/bin: \
  37.         export PATH
  38.         $SRCDIR/gcc/configure \
  39.             --prefix=$TRGDIR \
  40.             --disable-decimal-float
  41.             --disable-libgomp
  42.             --disable-libmudflap
  43.             --disable-libssp
  44.             --disable-libstdcxx-pch
  45.             --target=x86_64-nacl
  46.             --with-gmp=$BLDDIR/.gcc-extra-install-gmp
  47.             --with-mpfr=$BLDDIR/.gcc-extra-install-mpfr
  48.             --with-ppl=$BLDDIR/.gcc-extra-install-ppl
  49.             --with-host-libstdcxx="-lpwl -lstdc++ -lm"
  50.             --with-cloog=$BLDDIR/.gcc-extra-install-cloog-ppl
  51.             --disable-ppl-version-check \
  52.             --disable-shared \
  53.             --disable-threads \
  54.             --enable-languages="c" \
  55.             --without-headers \
  56.         make -C BUILD/build-pregcc-x86_64-nacl all-gcc all-target-libgcc
  57.            
  58. # compile newlib
  59. cd $SRCDIR/newlib
  60. CC="gcc -m32" \
  61.         CFLAGS="-O2 " \
  62.         CFLAGS_FOR_TARGET='-O2 -D_I386MACH_ALLOW_HW_INTERRUPTS -DSIGNAL_PROVIDED -mtls-use-call' \
  63.         CXXFLAGS_FOR_TARGET='-O2 -D_I386MACH_ALLOW_HW_INTERRUPTS -DSIGNAL_PROVIDED -mtls-use-call' \
  64.         PATH=$PATH:$TRGDIR/bin: \
  65.         export PATH
  66.         $SRCDIR/newlib/configure \
  67.                 --disable-libgloss \
  68.                 --enable-newlib-iconv \
  69.                 --enable-newlib-io-long-long \
  70.                 --enable-newlib-io-long-double \
  71.                 --enable-newlib-io-c99-formats \
  72.                 --enable-newlib-mb \
  73.                 --prefix=$TRGDIR \
  74.                 --target=x86_64-nacl \
  75.         make -C BUILD/newlib \
  76.         make DESTDIR= install
RAW Paste Data
Top