mirror of
https://codeberg.org/kiss-community/repo
synced 2024-07-04 15:02:27 +00:00
rust: support llvm-only systems. closes #304
This commit is contained in:
parent
56871a28f3
commit
66c018fdbb
|
@ -49,6 +49,10 @@ full-bootstrap = false
|
||||||
[install]
|
[install]
|
||||||
prefix = "/usr"
|
prefix = "/usr"
|
||||||
|
|
||||||
|
[target.x86_64-unknown-linux-musl]
|
||||||
|
llvm-config = "/usr/bin/llvm-config"
|
||||||
|
crt-static = false
|
||||||
|
|
||||||
[rust]
|
[rust]
|
||||||
channel = "stable"
|
channel = "stable"
|
||||||
rpath = false
|
rpath = false
|
||||||
|
@ -59,12 +63,31 @@ jemalloc = false
|
||||||
debug-assertions = false
|
debug-assertions = false
|
||||||
codegen-tests = false
|
codegen-tests = false
|
||||||
codegen-units-std = 1
|
codegen-units-std = 1
|
||||||
|
|
||||||
[target.x86_64-unknown-linux-musl]
|
|
||||||
llvm-config = "/usr/bin/llvm-config"
|
|
||||||
crt-static = false
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
# Workaround to get Rust to build in llvm-only environments.
|
||||||
|
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
|
||||||
|
|
||||||
|
printf 'INPUT(-lunwind)\n' > \
|
||||||
|
libgcc/libgcc_s.so
|
||||||
|
|
||||||
|
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"
|
||||||
|
}
|
||||||
|
|
||||||
|
echo hello world
|
||||||
|
esac
|
||||||
|
|
||||||
python3 ./x.py build -j "$(nproc)"
|
python3 ./x.py build -j "$(nproc)"
|
||||||
python3 ./x.py install
|
python3 ./x.py install
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user