derle.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. cachedir="build/cache/2021-09-09"
  2. mkdir -p "$cachedir"
  3. cp -f /sources/rust-std-1.55.0-x86_64-unknown-linux-gnu.tar.xz $cachedir/
  4. cp -f /sources/rustc-1.55.0-x86_64-unknown-linux-gnu.tar.xz $cachedir/
  5. cp -f /sources/cargo-1.55.0-x86_64-unknown-linux-gnu.tar.xz $cachedir/
  6. # 'rust' checksums files in 'vendor/', but we patch a few.
  7. for vendor in libc openssl-sys; do
  8. sed -i 's/\("files":{\)[^}]*/\1/' "vendor/$vendor/.cargo-checksum.json"
  9. done
  10. # Use our *-pc-linux-gnu targets, making LTO with clang simpler
  11. patch -Np1 -i $SRC/0002-compiler-Change-LLVM-targets.patch
  12. # Patch cargo so credential helpers are in /usr/lib instead of /usr/libexec
  13. patch -Np1 -i $SRC/rust-libexec.diff
  14. cat > config.toml <<EOF
  15. [llvm]
  16. link-shared = true
  17. [build]
  18. build = "x86_64-unknown-linux-gnu"
  19. host = [ "x86_64-unknown-linux-gnu" ]
  20. target = [ "x86_64-unknown-linux-gnu" ]
  21. docs = false
  22. compiler-docs = false
  23. extended = true
  24. submodules = false
  25. python = "python3"
  26. locked-deps = true
  27. vendor = true
  28. sanitizers = false
  29. profiler = false
  30. full-bootstrap = false
  31. [install]
  32. prefix = "/usr"
  33. [rust]
  34. channel = "stable"
  35. rpath = false
  36. codegen-units = 1
  37. debuginfo-level = 0
  38. debug = false
  39. backtrace = false
  40. jemalloc = false
  41. debug-assertions = false
  42. codegen-tests = false
  43. [target.x86_64-unknown-linux-gnu]
  44. llvm-config = "/usr/bin/llvm-config"
  45. crt-static = false
  46. EOF
  47. LC_ALL=C python3 ./x.py build -j "$(nproc)"