rust: minor changes

- Build less tools. Reduces compilation times. If the now disabled
  tools are needed, fork the package.

- Trim build directory paths in resulting binaries.

- Minor changes.
This commit is contained in:
Dylan Araps 2021-09-02 12:17:51 +03:00
parent 31bf9188d9
commit 91a7ed6a4d
No known key found for this signature in database
GPG Key ID: 13295DAC2CF13B5C
2 changed files with 27 additions and 23 deletions

View File

@ -1,5 +1,9 @@
#!/bin/sh -e
# Instruct the compiler to trim absolute paths in resulting binaries and instead
# change them to relative paths ($PWD/... ./...).
export RUSTFLAGS="$RUSTFLAGS --remap-path-prefix=$PWD=."
# This package mimics the download process of rust's 'x.py'
# bootstrap library to allow for the removal of the internet
# connection requirement per build.
@ -41,7 +45,7 @@ submodules = false
python = "python3"
locked-deps = true
vendor = true
tools = ["cargo", "rls", "clippy", "rustfmt", "analysis", "src", "rust-demangler"]
tools = [ "cargo" ]
sanitizers = false
profiler = false
full-bootstrap = false
@ -52,42 +56,42 @@ prefix = "/usr"
[target.x86_64-unknown-linux-musl]
llvm-config = "/usr/bin/llvm-config"
crt-static = false
sanitizers = false
[rust]
channel = "stable"
rpath = false
debuginfo-level = 0
debug = false
backtrace = false
jemalloc = false
debug-assertions = false
channel = "stable"
codegen-tests = false
codegen-units-std = 1
codegen-units-std = 0
debug = false
debug-assertions = false
debuginfo-level = 0
incremental = false
jemalloc = false
rpath = false
EOF
# Workaround to get Rust to build in llvm-only environments.
# libgcc_s.so is needed for Rust's bootstrap binaries, on llvm-only systems
# this library does not exist. This hack creates it as alias to libunwind.
case $("$CC" -print-file-name=libunwind.so) in */*)
printf 'llvm-libunwind = "system"\n' >> config.toml
# libgcc_s.so is needed for Rust's bootstrap binaries, on llvm-only systems
# this library does not exist. This hack creates it as alias to libunwind.
{
mkdir -p libgcc
mkdir -p libgcc
printf 'INPUT(-lunwind)\n' > \
libgcc/libgcc_s.so
printf 'INPUT(-lunwind)\n' > \
libgcc/libgcc_s.so
ln -sf "$KISS_ROOT/usr/lib/libunwind.so.1" \
libgcc/libgcc_s.so.1
ln -sf "$KISS_ROOT/usr/lib/libunwind.so.1" \
libgcc/libgcc_s.so.1
export \
LD_LIBRARY_PATH="$PWD/libgcc:$LD_LIBRARY_PATH" \
LIBRARY_PATH="$PWD/libgcc:$LIBRARY_PATH"
}
export \
LD_LIBRARY_PATH="$PWD/libgcc:$LD_LIBRARY_PATH" \
LIBRARY_PATH="$PWD/libgcc:$LIBRARY_PATH"
esac
python3 ./x.py build -j "$(nproc)"
python3 ./x.py install
./x.py build -j "$(grep -scF 'core id' /proc/cpuinfo)"
./x.py install
rm -rf \
"$1/usr/lib/rustlib/src/" \

View File

@ -1,7 +1,7 @@
cmake make
curl make
openssl
llvm
openssl
pkgconf make
python make
xz