pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/rust Add pointers to (so far untested) bootstrap ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2d7054969e64
branches:  trunk
changeset: 314022:2d7054969e64
user:      he <he%pkgsrc.org@localhost>
date:      Mon Oct 15 11:22:23 2018 +0000

description:
Add pointers to (so far untested) bootstrap kits for sparc64 and earmv7hf.

Prepare wrapper script handling for use of clang (not yet fully verified).

Adjust the cross-compiler wrapper script to improve the handling
when used as the linker:
 * Insert "linker tweaks" before first -L or -l
 * Handle "-L arg" style as well as "-Larg"
 * Add "-Wl,-rpath-link" to the linker tweaks just to be sure...

Bump PKGREVISION.

diffstat:

 lang/rust/Makefile       |   36 +++++++++++++--
 lang/rust/distinfo       |   34 +++++++++++----
 lang/rust/files/gcc-wrap |  105 ++++++++++++++++++++++++++++++++++------------
 3 files changed, 132 insertions(+), 43 deletions(-)

diffs (278 lines):

diff -r 392fc7fc22e4 -r 2d7054969e64 lang/rust/Makefile
--- a/lang/rust/Makefile        Mon Oct 15 11:21:17 2018 +0000
+++ b/lang/rust/Makefile        Mon Oct 15 11:22:23 2018 +0000
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.57 2018/10/13 17:54:57 he Exp $
+# $NetBSD: Makefile,v 1.58 2018/10/15 11:22:23 he Exp $
 
 DISTNAME=      rustc-1.29.1-src
 PKGNAME=       ${DISTNAME:S/rustc/rust/:S/-src//}
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    lang
 MASTER_SITES=  http://static.rust-lang.org/dist/
 
@@ -37,18 +37,18 @@
 # The gcc-wrap / c++-wrap script takes CROSS_ROOT environment variable
 # to do a cross-build.  The wrapper script assumes dest/ and tools/
 # as a result of a cross-build as subdirectories of this root
-#CROSS_ROOT=           /u/macppc
+#CROSS_ROOT=           /u/evbarm-armv7hf
 #MAKE_ENV+=            CROSS_ROOT=${CROSS_ROOT}
 
 # The GNU cross target designation
-#GNU_CROSS_TARGET=     powerpc--netbsd
+#GNU_CROSS_TARGET=     armv7--netbsdelf-eabihf
 #MAKE_ENV+=            GNU_CROSS_TARGET=${GNU_CROSS_TARGET}
 
 # To cross-build rust, you need to specify
 # the ultimate target to built for, as well as the
 # host the compiler is supposed to run on.
 # Rust's target designation
-#TARGET=                       powerpc-unknown-netbsd
+#TARGET=               armv7-unknown-netbsd-eabihf
 #CONFIGURE_ARGS+=      --host=${TARGET}
 #CONFIGURE_ARGS+=      --target=${TARGET}
 #CONFIGURE_ARGS+=      --set=target.${TARGET}.cc=${.CURDIR}/files/gcc-wrap
@@ -199,6 +199,28 @@
 SITES.${RUST_STD_STAGE0}=      ftp://golden-delicious.urc.uninett.no/pub/rust/
 pre-build-fix:
 .endif
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-sparc64) || make(distinfo) || make (makesum) || make(mdi)
+RUST_ARCH=             sparc64-unknown-netbsd
+RUST_STAGE0_VER=       1.29.1
+RUST_STAGE0:=          rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
+RUST_STD_STAGE0:=      rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
+DISTFILES:=            ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
+# Do not trust he@.
+SITES.${RUST_STAGE0}=  ftp://golden-delicious.urc.uninett.no/pub/rust/
+SITES.${RUST_STD_STAGE0}=      ftp://golden-delicious.urc.uninett.no/pub/rust/
+pre-build-fix:
+.endif
+.if !empty(MACHINE_PLATFORM:MNetBSD-*-earmv7hf) || make(distinfo) || make (makesum) || make(mdi)
+RUST_ARCH=             armv7-unknown-netbsd-eabihf
+RUST_STAGE0_VER=       1.29.1
+RUST_STAGE0:=          rust-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
+RUST_STD_STAGE0:=      rust-std-${RUST_STAGE0_VER}-${RUST_ARCH}.tar.gz
+DISTFILES:=            ${DISTFILES} ${RUST_STAGE0} ${RUST_STD_STAGE0}
+# Do not trust he@.
+SITES.${RUST_STAGE0}=  ftp://golden-delicious.urc.uninett.no/pub/rust/
+SITES.${RUST_STD_STAGE0}=      ftp://golden-delicious.urc.uninett.no/pub/rust/
+pre-build-fix:
+.endif
 
 # You may override RUST_BOOTSTRAP_PATH and RUST_ARCH in mk.conf if you have a local bootstrap compiler.
 .if !defined(RUST_ARCH) && !defined(RUST_BOOTSTRAP_PATH)
@@ -237,7 +259,11 @@
                ${WRKSRC}/src/vendor/libc/.cargo-checksum.json
 .if ${OPSYS} == "NetBSD"
        ${RM} -f ${.CURDIR}/files/c++-wrap
+       ${RM} -f ${.CURDIR}/files/clang++-wrap
+       ${RM} -f ${.CURDIR}/files/clang-wrap
        ${LN} -s ${.CURDIR}/files/gcc-wrap ${.CURDIR}/files/c++-wrap
+       ${LN} -s ${.CURDIR}/files/gcc-wrap ${.CURDIR}/files/clang++-wrap
+       ${LN} -s ${.CURDIR}/files/gcc-wrap ${.CURDIR}/files/clang-wrap
        ${CHMOD} +x ${.CURDIR}/files/gcc-wrap
 .endif
 
diff -r 392fc7fc22e4 -r 2d7054969e64 lang/rust/distinfo
--- a/lang/rust/distinfo        Mon Oct 15 11:21:17 2018 +0000
+++ b/lang/rust/distinfo        Mon Oct 15 11:22:23 2018 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.40 2018/10/13 10:03:36 he Exp $
+$NetBSD: distinfo,v 1.41 2018/10/15 11:22:23 he Exp $
 
 SHA1 (rust-1.28.0-i686-apple-darwin.tar.gz) = 85d947b4d260361f63f77e1f4921ac89bd849d78
 RMD160 (rust-1.28.0-i686-apple-darwin.tar.gz) = 963abf1b0b5e2673c8e2d6c1b4d5a2d8ed9d8d2f
@@ -16,6 +16,10 @@
 RMD160 (rust-1.28.0-i686-unknown-netbsd.tar.gz) = 768dc60e1983c5bcc6768ce6a0dacdc199ed6f9c
 SHA512 (rust-1.28.0-i686-unknown-netbsd.tar.gz) = 98f60b1357d8dec31752cb0f786b4c1fd8904b0e218d0f564bdcb2afc33f3fb0eb574a0e10f814a3ccfae113f27017daeff167cc06592221a755d9c36205bb12
 Size (rust-1.28.0-i686-unknown-netbsd.tar.gz) = 161223497 bytes
+SHA1 (rust-1.28.0-powerpc-unknown-netbsd.tar.gz) = 0e3e5be17acc8b088c2716e6d47ef6a51069fdde
+RMD160 (rust-1.28.0-powerpc-unknown-netbsd.tar.gz) = 848a243fa072eaf475583d8575d5457e66854c19
+SHA512 (rust-1.28.0-powerpc-unknown-netbsd.tar.gz) = 054837b5ddb0ec598d84336d4c257a430e8c096447c51e5e08b418d7a97f8ca5280998175f205cb2d901e7b92026c31ba3b972a0534f47eecd6d4aa0542a9655
+Size (rust-1.28.0-powerpc-unknown-netbsd.tar.gz) = 192518386 bytes
 SHA1 (rust-1.28.0-x86_64-apple-darwin.tar.gz) = ac439a54988a471e1e7652596307a9b54a253dd7
 RMD160 (rust-1.28.0-x86_64-apple-darwin.tar.gz) = 47479635f259e33218ee0e63b389e7f2c83278e5
 SHA512 (rust-1.28.0-x86_64-apple-darwin.tar.gz) = 99a3a5c5d0d09aa7ae8b52e5c71df56ead2d9c730921120c668daf6dcd6b9856e775735533ffc6f52f9481f591800ab81d0d7b43f534d2fa32e80d2a7dec8cde
@@ -36,6 +40,14 @@
 RMD160 (rust-1.28.0-x86_64-unknown-netbsd.tar.gz) = 7528a7c33006cbf3babd919f07c6b45aa40c933e
 SHA512 (rust-1.28.0-x86_64-unknown-netbsd.tar.gz) = 240b8de758469259aae3e7e8168a4dce1d62da864cae4ea0386fb6f808a19098bfb757526f22759355c62eb82c5eb31a0141b04ac32e669fb4b072232ea76f41
 Size (rust-1.28.0-x86_64-unknown-netbsd.tar.gz) = 156843116 bytes
+SHA1 (rust-1.29.1-armv7-unknown-netbsd-eabihf.tar.gz) = 343f1d41945b15402199377188f19313054bc62f
+RMD160 (rust-1.29.1-armv7-unknown-netbsd-eabihf.tar.gz) = ec1262a66a934b2933197324d27eff5fb960c416
+SHA512 (rust-1.29.1-armv7-unknown-netbsd-eabihf.tar.gz) = a4c2f52d8c738f6c53a6bcc636f59d4dad0b8c6ea73d6c452ea271d7ebbed2e7f7b31d07d67e0f123ce11a42c8fbc8ce28674f86a2f3a5db5ff57441f7cb4cf0
+Size (rust-1.29.1-armv7-unknown-netbsd-eabihf.tar.gz) = 205073438 bytes
+SHA1 (rust-1.29.1-sparc64-unknown-netbsd.tar.gz) = 8704deed839a9f14570bbbc6a865c75e9f428fb1
+RMD160 (rust-1.29.1-sparc64-unknown-netbsd.tar.gz) = 9547f8ec7058f6eacdb9cfd27e7f67a20225c331
+SHA512 (rust-1.29.1-sparc64-unknown-netbsd.tar.gz) = a2f89cb6274cebf1cd58b8cbd51ed4fe081fee4bb52263573a7d824aa7ddb6c381bb309a76e2bf4d61db64539c43c02479a8526655c2b72ee1cb087e49e9af57
+Size (rust-1.29.1-sparc64-unknown-netbsd.tar.gz) = 206363768 bytes
 SHA1 (rust-std-1.28.0-i686-apple-darwin.tar.gz) = 3d7e57f639077394756329121c74fb80c7e4bbfe
 RMD160 (rust-std-1.28.0-i686-apple-darwin.tar.gz) = 2ef3358883cf2951a55495f4db12f40412fd5dc5
 SHA512 (rust-std-1.28.0-i686-apple-darwin.tar.gz) = faacce3c4441e96927aa52dbf89e70541d3d4d73d1ae971c61b5d9c2ce75e4b55ed4faccb3c314fd9ea9feda4b5630e425a5c725e4c98df80bdb7b1e822a5439
@@ -52,6 +64,10 @@
 RMD160 (rust-std-1.28.0-i686-unknown-netbsd.tar.gz) = b42be603e6ad629ffb792073b9e3acf968ad5706
 SHA512 (rust-std-1.28.0-i686-unknown-netbsd.tar.gz) = 04b360dd7af0b89a6efb4b6b83fc0770da819c2f0403b6dadfffe824a93a02b1dd92605e390b70192af24a3be5071444cb6213a3245e49058648e168846791ae
 Size (rust-std-1.28.0-i686-unknown-netbsd.tar.gz) = 69614010 bytes
+SHA1 (rust-std-1.28.0-powerpc-unknown-netbsd.tar.gz) = 2eb760731636e19094d36aae84fca72094e1600a
+RMD160 (rust-std-1.28.0-powerpc-unknown-netbsd.tar.gz) = aa764f9cc59dd256718e17d5683bbc7e14657a75
+SHA512 (rust-std-1.28.0-powerpc-unknown-netbsd.tar.gz) = 265e71e390689a6e7624e3378fae767c22225bcbc03ad5fb84b91b48c53c3d364a3dc8bdcf11028aa618f0d11d126220911bb17e5c91f38361548e7673d37718
+Size (rust-std-1.28.0-powerpc-unknown-netbsd.tar.gz) = 66023865 bytes
 SHA1 (rust-std-1.28.0-x86_64-apple-darwin.tar.gz) = 55af539d98707a658a8f26a4aa33005b4fc6baa3
 RMD160 (rust-std-1.28.0-x86_64-apple-darwin.tar.gz) = 2744209ed7312b445370f8d008db325045fcea18
 SHA512 (rust-std-1.28.0-x86_64-apple-darwin.tar.gz) = 7075f6cf594847fb21c134a32f9d758cb94a4483e669eb546c9df68108541301d9a750c535112cbfbfa5dc1f9ff93a6edc6c3c366cb97d927e6e8367ccb9efec
@@ -68,14 +84,14 @@
 RMD160 (rust-std-1.28.0-x86_64-unknown-netbsd.tar.gz) = d06cabb8232d66d2a5cf3a1ee0f0f676c698e6c0
 SHA512 (rust-std-1.28.0-x86_64-unknown-netbsd.tar.gz) = 726c5ef43db24b3d0548a2b0534934d6fcb04b0b9228b80cace18f59e21ad6facfbc2af3220867988a35414ba95fb90e38cc47d826dd73cb588622132ea6e9da
 Size (rust-std-1.28.0-x86_64-unknown-netbsd.tar.gz) = 69236192 bytes
-SHA1 (rust-1.28.0-powerpc-unknown-netbsd.tar.gz) = 0e3e5be17acc8b088c2716e6d47ef6a51069fdde
-RMD160 (rust-1.28.0-powerpc-unknown-netbsd.tar.gz) = 848a243fa072eaf475583d8575d5457e66854c19
-SHA512 (rust-1.28.0-powerpc-unknown-netbsd.tar.gz) = 054837b5ddb0ec598d84336d4c257a430e8c096447c51e5e08b418d7a97f8ca5280998175f205cb2d901e7b92026c31ba3b972a0534f47eecd6d4aa0542a9655
-Size (rust-1.28.0-powerpc-unknown-netbsd.tar.gz) = 192518386 bytes
-SHA1 (rust-std-1.28.0-powerpc-unknown-netbsd.tar.gz) = 2eb760731636e19094d36aae84fca72094e1600a
-RMD160 (rust-std-1.28.0-powerpc-unknown-netbsd.tar.gz) = aa764f9cc59dd256718e17d5683bbc7e14657a75
-SHA512 (rust-std-1.28.0-powerpc-unknown-netbsd.tar.gz) = 265e71e390689a6e7624e3378fae767c22225bcbc03ad5fb84b91b48c53c3d364a3dc8bdcf11028aa618f0d11d126220911bb17e5c91f38361548e7673d37718
-Size (rust-std-1.28.0-powerpc-unknown-netbsd.tar.gz) = 66023865 bytes
+SHA1 (rust-std-1.29.1-armv7-unknown-netbsd-eabihf.tar.gz) = abfe723d6d8708a88bbc5383f9c9f6e6a2a1a73e
+RMD160 (rust-std-1.29.1-armv7-unknown-netbsd-eabihf.tar.gz) = 84260b756be013b7783fffc6b403650e3e34f266
+SHA512 (rust-std-1.29.1-armv7-unknown-netbsd-eabihf.tar.gz) = b57acb2fee5c0563be75bfad4c824035684baaaf6c8242334ccc77d39b84886eb91014b846b451f7f4a685b1c956fb41d6a8b338e44138d61b6899a454876bc6
+Size (rust-std-1.29.1-armv7-unknown-netbsd-eabihf.tar.gz) = 67472170 bytes
+SHA1 (rust-std-1.29.1-sparc64-unknown-netbsd.tar.gz) = 634c1bc68cc4adf26b76972c7c30aab0a44016ba
+RMD160 (rust-std-1.29.1-sparc64-unknown-netbsd.tar.gz) = 2394669652ff61981cb21e0ce02ceae14be19c1c
+SHA512 (rust-std-1.29.1-sparc64-unknown-netbsd.tar.gz) = 6930bfc7f14772f1942d4168e88ba3b97028c4cc65bed5767983019c81e4df15fd214eb7ac2397fd88571f5af599d86c74a276fa3cedba131632efc1b50badf4
+Size (rust-std-1.29.1-sparc64-unknown-netbsd.tar.gz) = 67594821 bytes
 SHA1 (rustc-1.29.1-src.tar.gz) = 5b1cc48bda7d77137062908def9b3f428dc3996d
 RMD160 (rustc-1.29.1-src.tar.gz) = 780a25bb9c8fd60cde53ce617a0065362337d6ad
 SHA512 (rustc-1.29.1-src.tar.gz) = 3151c398a79169af7dd0735d5115112cb64858120a637eda018cb4544dd9988f7540120cc0122d2af7348968285650d8605837e9f40337ec95e549d5e8763f04
diff -r 392fc7fc22e4 -r 2d7054969e64 lang/rust/files/gcc-wrap
--- a/lang/rust/files/gcc-wrap  Mon Oct 15 11:21:17 2018 +0000
+++ b/lang/rust/files/gcc-wrap  Mon Oct 15 11:22:23 2018 +0000
@@ -20,7 +20,36 @@
 who=$(basename $0 | sed -e 's/-wrap$//')
 
 args=""
-linking=false
+
+# May need to add $linkadd before first -l or fist -L
+linkadd="-Wl,--sysroot=${root}/dest"
+# (perhaps this is overly cautious, other adjustments we do
+# below may be sufficient...)
+# Lib directories to ensure we search and have in run-path
+libs="/lib /usr/lib /usr/pkg/lib"
+
+for d in $libs; do
+       if ! $native; then
+               linkadd="$linkadd -L=$d"
+               linkadd="$linkadd -Wl,-rpath-link=${root}/dest/$d"
+       fi
+       # Run-path is for when we execute on the target,
+       # so no $root prefix
+       linkadd="$linkadd -Wl,-rpath,$d"
+done
+
+# ...and add a placeholder so we can tweak RPATH with chrpath,
+# since chrpath can't extend the length of the run path
+# (This may also not be needed, we use LD_LIBRARY_PATH instead)
+placeholder="placeholder-$(date | openssl dgst -sha1 | \
+       awk '{ print $2 }')"
+linkadd="$linkadd -Wl,-rpath,/$placeholder"
+# the / is a sneaky attempt to let it past cwrapper...
+
+# More debugging
+linkadd="$linkadd -Wl,--verbose"
+
+linktweaked=false
 
 # Step through args, tweak where required
 set -- "$@"
@@ -43,8 +72,52 @@
                        args="$args -I=/usr/include/krb5"
                        ;;
                -l*)
+                       if ! $linktweaked; then
+                               args="$args $linkadd"
+                               linktweaked=true
+                       fi
                        args="$args $1"
-                       linking=true
+                       ;;
+               -L)
+                       if ! $linktweaked; then
+                               args="$args $linkadd"
+                               linktweaked=true
+                       fi
+                       shift
+                       tweaked=false
+                       # redirect these to -Wl,--sysroot
+                       for d in /lib /usr/lib /usr/pkg/lib; do
+                               if [ $1 = $d ]; then
+                                       args="$args -L =$d"
+                                       tweaked=true
+                               fi
+                       done
+                       # Not redirected?  If so we need to add
+                       if ! $tweaked; then
+                               args="$args -L $1"
+                       fi
+                       ;;
+                       
+               -L/lib)
+                       if ! $linktweaked; then
+                               args="$args $linkadd"
+                               linktweaked=true
+                       fi
+                       args="$args -L=/lib"
+                       ;;
+               -L/usr/lib)
+                       if ! $linktweaked; then
+                               args="$args $linkadd"
+                               linktweaked=true
+                       fi
+                       args="$args -L=/usr/lib"
+                       ;;
+               -L/usr/pkg/lib)
+                       if ! $linktweaked; then
+                               args="$args $linkadd"
+                               linktweaked=true
+                       fi
+                       args="$args -L=/usr/pkg/lib"
                        ;;
                *)
                        args="$args $1"
@@ -53,35 +126,9 @@
        shift
 done
 
-if $linking; then
-       # Lib directories to ensure we search and have in run-path
-       libs="/lib /usr/lib /usr/pkg/lib"
-
-       for d in $libs; do
-               # Run-path is for when we execute on the target,
-               # so no $root prefix
-               if ! $native; then
-                       args="$args -L ${root}/dest/$d"
-               fi
-               args="$args -Wl,-rpath,$d"
-       done
-
-       # ...and add a placeholder so we can tweak with chrpath,
-       # since chrpath can't extend the length of the run path
-       placeholder="placeholder-$(date | openssl dgst -sha1 | \
-               awk '{ print $2 }')"
-       args="$args -Wl,-rpath,/$placeholder"
-       # the / is a sneaky attempt to let it past cwrapper...
-
-       # More debugging
-       args="$args -Wl,--verbose"
-
-       # For backtrace() (have patch now elsewhere)
-       #args="$args -lexecinfo"
-fi
-
 if $native; then
        # Try to avoid cwrappers, which does "undocumented magic"
+       # by invoking the compiler "directly".
        cmd="/usr/bin/${who} $args"
 else
        cmd="${root}/tools/bin/${gnuarch}-${who} \



Home | Main Index | Thread Index | Old Index