summaryrefslogtreecommitdiff
path: root/rust
diff options
context:
space:
mode:
authorDanny Rawlins <contact@romster.me>2021-10-01 18:54:29 +1000
committerDanny Rawlins <contact@romster.me>2021-10-01 18:54:29 +1000
commit7a51c86d6ffc5f17fbacf73d3c4a1c05d127bbf1 (patch)
tree5f640aabcc0bb51cf0f454b581c54cecdec9360b /rust
parent62fd06f2fc9acdd67af80a0463806ba23affd21a (diff)
downloadopt-7a51c86d6ffc5f17fbacf73d3c4a1c05d127bbf1.tar.gz
opt-7a51c86d6ffc5f17fbacf73d3c4a1c05d127bbf1.tar.xz
[notify] rust: rust can make use of polly and lld for optimisation
Diffstat (limited to 'rust')
-rw-r--r--rust/.signature4
-rw-r--r--rust/Pkgfile17
2 files changed, 15 insertions, 6 deletions
diff --git a/rust/.signature b/rust/.signature
index 088818105..e3144e73f 100644
--- a/rust/.signature
+++ b/rust/.signature
@@ -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
diff --git a/rust/Pkgfile b/rust/Pkgfile
index 6b63786a2..7f09b9043 100644
--- a/rust/Pkgfile
+++ b/rust/Pkgfile
@@ -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

Generated by cgit