ports/opt (3.6): [notify] rust: rust can make use of polly and lld for optimisation
commit 7a51c86d6ffc5f17fbacf73d3c4a1c05d127bbf1 Author: Danny Rawlins <contact@romster.me> Date: Fri Oct 1 18:54:29 2021 +1000 [notify] rust: rust can make use of polly and lld for optimisation 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
participants (1)
-
crux@crux.nu