1
0
forked from ports/opt

[notify] rust: rust can make use of polly and lld for optimisation

This commit is contained in:
Danny Rawlins 2021-10-01 18:54:29 +10:00
parent 62fd06f2fc
commit 7a51c86d6f
2 changed files with 15 additions and 6 deletions

View File

@ -1,6 +1,6 @@
untrusted comment: verify with /etc/ports/opt.pub
RWSE3ohX2g5d/TIEFc0ZUQl6zaNsRYwbgvVLlLXm8xSuyV1DoU/ONSg3J9boSRolOwA+P3r63CWccWJNZ86r/lbTG8qgXRWCaAQ=
SHA256 (Pkgfile) = 926ceb2fa952bdd615c617635fe63e43212bbf95725f4a1e53ac73a5aaba0ab5
RWSE3ohX2g5d/VP1RzRresw/Nu41ftKGa+OzGthahOdY8YUvQetJO/jbvfApam4AET4yCS8htCuqNBYIj+xRxcpswUW2YqRDGAo=
SHA256 (Pkgfile) = 0733ae22874f65c3f7be07455c8d80f786be51d79014c9f4e94714c1fac466e7
SHA256 (.footprint) = 1a9358f2baa5b4536ce9c19aa01051ccd3d455b597d457c22945b4b55f640ee2
SHA256 (rustc-1.55.0-src.tar.xz) = aec85a7c1f40b7a40818a58ae13632f8a12cfaa4d3e2a10957d0e9d16dfdd556
SHA256 (rust-std-1.54.0-x86_64-unknown-linux-gnu.tar.xz) = a22e19859b3c5032daac1633637546a986c51bdfa3ad0db6e394e6cc461f466b

View File

@ -2,7 +2,7 @@
# URL: https://www.rust-lang.org/
# Maintainer: Danny Rawlins, crux at romster dot me
# Depends on: compiler-rt
# Optional: sccache ccache
# Optional: sccache ccache libgit2 lld polly
name=rust
version=1.55.0
@ -62,6 +62,7 @@ cat <<- EOF > $SRC/config.toml
[llvm]
ninja = true
link-shared = true
@POLLY@
@CCACHE@
[install]
@ -78,12 +79,15 @@ cat <<- EOF > $SRC/config.toml
channel = "stable"
parallel-compiler = true
rpath = false
optimize = true
@LLD@
[build]
target = ["x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu"]
tools = ["cargo", "rls", "clippy", "rustfmt", "analysis", "src", "rust-demangler"]
docs = false
extended = true
sanitizers = false
sanitizers = true
profiler = true
vendor = true
python = "/usr/bin/python3"
@ -97,14 +101,16 @@ cat <<- EOF > $SRC/config.toml
EOF
if [ -e '/usr/bin/rustc' ]; then
if [ -z "$(/usr/bin/ldd /usr/bin/rustc | egrep '.*libLLVM.*.so => not found')" ]; then
if [[ -z "$(/usr/bin/ldd /usr/bin/rustc | egrep '.*libLLVM.*.so => not found')" && \
-z "$(/usr/bin/ldd /usr/bin/cargo | egrep 'libgit2.so.* => not found')" ]]; then
sed -e 's|@CARGO@|cargo = "/usr/bin/cargo"|' \
-e 's|@RUST@|rustc = "/usr/bin/rustc"|' \
-e 's|@RUSTFMT@|rustfmt = "/usr/bin/rustfmt"|' \
-i $SRC/config.toml
else
sed -e 's|@CARGO@||' -e 's|@RUST@||' -e 's|@RUSTFMT@||' -i $SRC/config.toml
printf "\e[031mllvm broken symlink detected, not using system rust to bootstrap\033[0m\n"
printf "\e[031mShared library missing, not using system rust to bootstrap.\033[0m\n"
fi
else
sed -e 's|@CARGO@||' -e 's|@RUST@||' -e 's|@RUSTFMT@||' -i $SRC/config.toml
@ -116,6 +122,9 @@ EOF
sed -e 's|@CCACHE@||' -i $SRC/config.toml
fi
prt-get isinst lld && sed -e 's|@LLD@|use-lld = true|' -i $SRC/config.toml || sed -e 's|@LLD@||' -i $SRC/config.toml
prt-get isinst polly && sed -e 's|@POLLY@|polly = true|' -i $SRC/config.toml || sed -e 's|@POLLY@||' -i $SRC/config.toml
cat $SRC/config.toml
mkdir "$PKGMK_SOURCE_DIR/rust" || true