Received: by mail.netbsd.org (Postfix, from userid 605) id ACB7A84DAC; Mon, 9 Sep 2019 16:19:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 33ABC84DA8 for ; Mon, 9 Sep 2019 16:19:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id I1hTPLdfeFlh for ; Mon, 9 Sep 2019 16:19:49 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id 7BF9084D33 for ; Mon, 9 Sep 2019 16:19:49 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 763FBFBF4; Mon, 9 Sep 2019 16:19:49 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1568045989177590" MIME-Version: 1.0 Date: Mon, 9 Sep 2019 16:19:49 +0000 From: "Adam Ciarcinski" Subject: CVS commit: pkgsrc/lang/rust To: pkgsrc-changes@NetBSD.org Reply-To: adam@netbsd.org X-Mailer: log_accum Message-Id: <20190909161949.763FBFBF4@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1568045989177590 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: adam Date: Mon Sep 9 16:19:49 UTC 2019 Modified Files: pkgsrc/lang/rust: Makefile distinfo options.mk Added Files: pkgsrc/lang/rust/patches: patch-src_build__helper_lib.rs patch-src_librustc__codegen__ssa_back_linker.rs Log Message: rust: on Darwin, use proper shared library name instead of @rpath To generate a diff of this commit: cvs rdiff -u -r1.113 -r1.114 pkgsrc/lang/rust/Makefile cvs rdiff -u -r1.85 -r1.86 pkgsrc/lang/rust/distinfo cvs rdiff -u -r1.4 -r1.5 pkgsrc/lang/rust/options.mk cvs rdiff -u -r0 -r1.1 \ pkgsrc/lang/rust/patches/patch-src_build__helper_lib.rs \ pkgsrc/lang/rust/patches/patch-src_librustc__codegen__ssa_back_linker.rs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1568045989177590 Content-Disposition: inline Content-Length: 5985 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/lang/rust/Makefile diff -u pkgsrc/lang/rust/Makefile:1.113 pkgsrc/lang/rust/Makefile:1.114 --- pkgsrc/lang/rust/Makefile:1.113 Thu Aug 29 14:09:56 2019 +++ pkgsrc/lang/rust/Makefile Mon Sep 9 16:19:49 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.113 2019/08/29 14:09:56 he Exp $ +# $NetBSD: Makefile,v 1.114 2019/09/09 16:19:49 adam Exp $ DISTNAME= rustc-1.37.0-src PKGNAME= ${DISTNAME:S/rustc/rust/:S/-src//} @@ -277,6 +277,8 @@ TOOLS_PATH.md5sum= ${PREFIX}/bin/gmd5sum SUBST_CLASSES+= rpath SUBST_STAGE.rpath= pre-configure SUBST_FILES.rpath= src/bootstrap/bin/rustc.rs +SUBST_FILES.rpath+= src/build_helper/lib.rs +SUBST_FILES.rpath+= src/librustc_codegen_ssa/back/linker.rs SUBST_VARS.rpath= PREFIX post-extract: @@ -339,34 +341,6 @@ do-install: GENERATE_PLIST+=find ${DESTDIR}${PREFIX} \( -type f -o -type l \) -print | \ sed 's,${DESTDIR}${PREFIX}/,,' | ${SORT} ; -.if ${OPSYS} == "Darwin" -LDFLAGS+= -headerpad_max_install_names - -.PHONY: fix-darwin-install-name -post-install: fix-darwin-install-name -fix-darwin-install-name: -. for bin in cargo-miri clippy-driver miri rls rustc rustdoc - otool -XL ${DESTDIR}${PREFIX}/bin/${bin} \ - | ${GREP} '@rpath' | while read rpath rest; do \ - install_name_tool -change $$rpath \ - `${ECHO} $$rpath | ${SED} -e 's,@rpath,${PREFIX}/lib,g'` \ - ${DESTDIR}${PREFIX}/bin/${bin}; \ - done -. endfor -. for libdir in lib lib/rustlib/${RUST_ARCH}/lib lib/rustlib/${RUST_ARCH}/codegen-backends - for f in ${DESTDIR}${PREFIX}/${libdir}/lib*.dylib; do \ - [ ! -f $$f ] && continue; \ - install_name_tool -id `${ECHO} $$f | ${SED} -e 's,${DESTDIR},,g'` $$f; \ - otool -XL $$f | grep '@rpath' | while read rpath rest; do \ - install_name_tool -change $$rpath \ - `${ECHO} $$rpath | ${SED} -e 's,@rpath,${PREFIX}/lib,g'` \ - $$f; \ - done; \ - done -. endfor -.endif - -# # Create a relocatable stage2 bootstrap from the bits we just built that can be # used to build the next version of rust. Currently only tested on SmartOS. # Index: pkgsrc/lang/rust/distinfo diff -u pkgsrc/lang/rust/distinfo:1.85 pkgsrc/lang/rust/distinfo:1.86 --- pkgsrc/lang/rust/distinfo:1.85 Thu Aug 29 14:09:56 2019 +++ pkgsrc/lang/rust/distinfo Mon Sep 9 16:19:49 2019 @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.85 2019/08/29 14:09:56 he Exp $ +$NetBSD: distinfo,v 1.86 2019/09/09 16:19:49 adam Exp $ SHA1 (rust-1.35.0-armv7-unknown-netbsd-eabihf.tar.gz) = 91517fa95f954427c627cf63eb7c518abd068f3e RMD160 (rust-1.35.0-armv7-unknown-netbsd-eabihf.tar.gz) = 06a3d922b27aac2deb570301542897a131b47cd0 @@ -108,6 +108,8 @@ SHA1 (patch-src_bootstrap_bin_rustc.rs) SHA1 (patch-src_bootstrap_bootstrap.py) = 5b886b95857bf019c2e37cb380e6905cb444b756 SHA1 (patch-src_bootstrap_builder.rs) = 7e23348dc5555fdb3833a7f8734cfe687c6e533c SHA1 (patch-src_bootstrap_lib.rs) = bc23743f1b9c4ad3d7557b4fdf8a55976ca7f417 +SHA1 (patch-src_build__helper_lib.rs) = ef0b522e303f0490b86e64f40733c2ecb498da5b +SHA1 (patch-src_librustc__codegen__ssa_back_linker.rs) = e7c592f78b9ee317521cf0258686173a31f1d2e0 SHA1 (patch-src_librustc__llvm_build.rs) = d6e71891eb8d42a9c4175505ba7ed98338153860 SHA1 (patch-src_librustc__target_spec_solaris__base.rs) = 21db8af802edecb5e35ce78ee9af7c4935b4040f SHA1 (patch-src_librustc__target_spec_x86__64__sun__solaris.rs) = f6ad33b41906bbf83a1cbd0e2fe13a4da37266fa Index: pkgsrc/lang/rust/options.mk diff -u pkgsrc/lang/rust/options.mk:1.4 pkgsrc/lang/rust/options.mk:1.5 --- pkgsrc/lang/rust/options.mk:1.4 Tue Aug 27 17:23:48 2019 +++ pkgsrc/lang/rust/options.mk Mon Sep 9 16:19:49 2019 @@ -1,7 +1,7 @@ -# $NetBSD: options.mk,v 1.4 2019/08/27 17:23:48 schmonz Exp $ +# $NetBSD: options.mk,v 1.5 2019/09/09 16:19:49 adam Exp $ -PKG_OPTIONS_VAR= PKG_OPTIONS.rust -PKG_SUPPORTED_OPTIONS= +PKG_OPTIONS_VAR= PKG_OPTIONS.rust +PKG_SUPPORTED_OPTIONS= # empty .include "../../mk/bsd.fast.prefs.mk" Added files: Index: pkgsrc/lang/rust/patches/patch-src_build__helper_lib.rs diff -u /dev/null pkgsrc/lang/rust/patches/patch-src_build__helper_lib.rs:1.1 --- /dev/null Mon Sep 9 16:19:49 2019 +++ pkgsrc/lang/rust/patches/patch-src_build__helper_lib.rs Mon Sep 9 16:19:49 2019 @@ -0,0 +1,15 @@ +$NetBSD: patch-src_build__helper_lib.rs,v 1.1 2019/09/09 16:19:49 adam Exp $ + +On Darwin, do not use @rpath for internal libraries. + +--- src/build_helper/lib.rs.orig 2019-09-06 11:17:24.000000000 +0000 ++++ src/build_helper/lib.rs +@@ -212,7 +212,7 @@ impl NativeLibBoilerplate { + fs::rename(&src, &dst).unwrap(); + let status = Command::new("install_name_tool") + .arg("-id") +- .arg(format!("@rpath/{}", new_name)) ++ .arg(format!("@PREFIX@/lib/{}", new_name)) + .arg(&dst) + .status() + .expect("failed to execute `install_name_tool`"); Index: pkgsrc/lang/rust/patches/patch-src_librustc__codegen__ssa_back_linker.rs diff -u /dev/null pkgsrc/lang/rust/patches/patch-src_librustc__codegen__ssa_back_linker.rs:1.1 --- /dev/null Mon Sep 9 16:19:49 2019 +++ pkgsrc/lang/rust/patches/patch-src_librustc__codegen__ssa_back_linker.rs Mon Sep 9 16:19:49 2019 @@ -0,0 +1,15 @@ +$NetBSD: patch-src_librustc__codegen__ssa_back_linker.rs,v 1.1 2019/09/09 16:19:49 adam Exp $ + +Do not use @rpath on Darwin. + +--- src/librustc_codegen_ssa/back/linker.rs.orig 2019-09-06 11:20:11.000000000 +0000 ++++ src/librustc_codegen_ssa/back/linker.rs +@@ -362,7 +362,7 @@ impl<'a> Linker for GccLinker<'a> { + // the right `-Wl,-install_name` with an `@rpath` in it. + if self.sess.opts.cg.rpath || self.sess.opts.debugging_opts.osx_rpath_install_name { + self.linker_arg("-install_name"); +- let mut v = OsString::from("@rpath/"); ++ let mut v = OsString::from("@PREFIX@/lib/"); + v.push(out_filename.file_name().unwrap()); + self.linker_arg(&v); + } --_----------=_1568045989177590--