derle.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. cd "${isim}c-$surum-src"
  2. _date=2019-05-23
  3. _rustc=1.35.0
  4. _cargo=0.36.0
  5. mkdir -p build/cache/$_date
  6. cp $KAYNAKLAR_DEPO/rustc-${_rustc}-x86_64-unknown-linux-gnu.tar.gz build/cache/$_date/
  7. cp $KAYNAKLAR_DEPO/rust-std-${_rustc}-x86_64-unknown-linux-gnu.tar.gz build/cache/$_date/
  8. cp $KAYNAKLAR_DEPO/cargo-${_cargo}-x86_64-unknown-linux-gnu.tar.gz build/cache/$_date/
  9. #export RUSTC_WRAPPER=/usr/bin/ccache # ccache i eklemek gerekebilir-hızlı derleme için
  10. cat <<- EOF > $SRC/config.toml
  11. [llvm]
  12. link-shared = true
  13. [install]
  14. prefix = "/usr"
  15. [rust]
  16. channel = "stable"
  17. rpath = false
  18. codegen-tests = false
  19. debuginfo = true
  20. debuginfo-lines = true
  21. [build]
  22. docs = false
  23. extended = true
  24. python = "python3"
  25. EOF
  26. # part of [build] options
  27. if [ -e '/usr/bin/rustc' ]; then
  28. if [ -z "$(/usr/bin/ldd /usr/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/librustc_codegen_llvm-llvm.so | egrep '.*libLLVM-.*.so => not found')" ]; then
  29. cat <<- EOF >> $SRC/config.toml
  30. cargo = "/usr/bin/cargo"
  31. rustc = "/usr/bin/rustc"
  32. EOF
  33. else
  34. echo 'llvm broken symlink detected, not using system rust to bootstrap'
  35. fi
  36. fi
  37. cat <<- EOF >> $SRC/config.toml
  38. [target.x86_64-unknown-linux-gnu]
  39. llvm-config = "/usr/bin/llvm-config"
  40. EOF
  41. cat $SRC/config.toml
  42. mkdir "$KAYNAKLAR_DEPO/rust" || true
  43. export CARGO_HOME="$KAYNAKLAR_DEPO/rust"
  44. rm -rf $CARGO_HOME
  45. export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi"
  46. /usr/bin/python3 ./x.py dist --config="${SRC}"/config.toml -j"$(nproc)"