Received: by mail.netbsd.org (Postfix, from userid 605) id BE33184EBA; Sat, 5 Jan 2019 23:29:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 427B184EB8 for ; Sat, 5 Jan 2019 23:29:41 +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 G0VoJxpmZ8WX for ; Sat, 5 Jan 2019 23:29:40 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 7695984D63 for ; Sat, 5 Jan 2019 23:29:40 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 6A932FB16; Sat, 5 Jan 2019 23:29:40 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1546730980209380" MIME-Version: 1.0 Date: Sat, 5 Jan 2019 23:29:40 +0000 From: "Tobias Nygren" Subject: CVS commit: pkgsrc/lang/rust To: pkgsrc-changes@NetBSD.org Reply-To: tnn@netbsd.org X-Mailer: log_accum Message-Id: <20190105232940.6A932FB16@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. --_----------=_1546730980209380 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: tnn Date: Sat Jan 5 23:29:40 UTC 2019 Modified Files: pkgsrc/lang/rust: Makefile distinfo Added Files: pkgsrc/lang/rust/patches: patch-src_librustc__llvm_build.rs patch-src_libunwind_build.rs Log Message: rust: add some kludges to better support NetBSD HEAD-llvm 1) bootstrap rustc adds -lgcc_s when linking -> Dropped with a BUILDLINK_TRANSFORM 2) bootstrap rustc has shared linkage to libgcc_s.so.1 -> Until upstream changes this to static linkage, we look for libgcc_s.so.1 in ${FILESDIR} where the user must place it manually. 3) newly built rustc adds -lstdc++ instead of -lc++ when linking llvm -> fixed with patch-src_librustc__llvm_build.rs 4) newly built rustc adds -lgcc_s when linking -> fixed with patch-src_libunwind_build.rs To generate a diff of this commit: cvs rdiff -u -r1.72 -r1.73 pkgsrc/lang/rust/Makefile cvs rdiff -u -r1.50 -r1.51 pkgsrc/lang/rust/distinfo cvs rdiff -u -r0 -r1.1 \ pkgsrc/lang/rust/patches/patch-src_librustc__llvm_build.rs \ pkgsrc/lang/rust/patches/patch-src_libunwind_build.rs Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1546730980209380 Content-Disposition: inline Content-Length: 4809 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.72 pkgsrc/lang/rust/Makefile:1.73 --- pkgsrc/lang/rust/Makefile:1.72 Thu Jan 3 03:12:30 2019 +++ pkgsrc/lang/rust/Makefile Sat Jan 5 23:29:40 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.72 2019/01/03 03:12:30 tnn Exp $ +# $NetBSD: Makefile,v 1.73 2019/01/05 23:29:40 tnn Exp $ DISTNAME= rustc-1.31.1-src PKGREVISION= 1 @@ -308,10 +308,18 @@ post-extract: MAKE_ENV+= OPENSSL_DIR=${SSLBASE} .endif +.if ${OPSYS} == "NetBSD" && !empty(PKGSRC_COMPILER:Mclang) && !exists(/lib/libgcc_s.so) +BUILDLINK_TRANSFORM+= rm:-lgcc_s +MAKE_ENV+= PKGSRC_HAVE_LIBCPP=yes +.endif + pre-build: pre-build-fix - # Requires libssh2 defines only available in master. +# Requires libssh2 defines only available in master. ${CP} -f ${WRKSRC}/src/vendor/libssh2-sys/libssh2/include/libssh2.h \ ${BUILDLINK_DIR}/include/ +.if ${OPSYS} == "NetBSD" && !empty(PKGSRC_COMPILER:Mclang) && !exists(/lib/libgcc_s.so) + cp ${FILESDIR}/libgcc_s.so.1 ${RUST_BOOTSTRAP_PATH}/lib/. +.endif do-build: cd ${WRKSRC} \ Index: pkgsrc/lang/rust/distinfo diff -u pkgsrc/lang/rust/distinfo:1.50 pkgsrc/lang/rust/distinfo:1.51 --- pkgsrc/lang/rust/distinfo:1.50 Fri Dec 21 23:12:34 2018 +++ pkgsrc/lang/rust/distinfo Sat Jan 5 23:29:40 2019 @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.50 2018/12/21 23:12:34 he Exp $ +$NetBSD: distinfo,v 1.51 2019/01/05 23:29:40 tnn Exp $ SHA1 (rust-1.30.0-x86_64-sun-solaris.tar.gz) = d1da4a02bdbb9a46587bc64d4b7987bb3f1aaeab RMD160 (rust-1.30.0-x86_64-sun-solaris.tar.gz) = 0670575ad4eb63f86d34299104f451463e5fc070 @@ -103,9 +103,11 @@ SHA1 (patch-src_bootstrap_lib.rs) = d86e SHA1 (patch-src_libbacktrace_configure) = b2c1e9b93a99408aad42ab9f1af27704cc81bdd8 SHA1 (patch-src_liblibc_src_unix_bsd_netbsdlike_netbsd_mod.rs) = e5b564bb247094cc8e4e6935a02262b3385cb7e6 SHA1 (patch-src_liblibc_src_unix_solaris_mod.rs) = aeb7c22995e33c700ce3ea4336368a1fd08120e1 +SHA1 (patch-src_librustc__llvm_build.rs) = a56bf5435e40bb012641ada6b20256901a1073fb SHA1 (patch-src_libstd_build.rs) = 1edbf87339bd88e3178d4fa2fc408a6e802ed488 SHA1 (patch-src_libstd_sys_unix_thread.rs) = 46ef46365658e2f895bd3dde9c74f352890e9ccc SHA1 (patch-src_libsyntax__pos_span__encoding.rs) = c891cffab8ae47b13b3b391ddd1a6c62ee2b38f3 +SHA1 (patch-src_libunwind_build.rs) = 74e2101f0cd78ca68b0a9d14355e20dcaea66100 SHA1 (patch-src_llvm_CMakeLists.txt) = ffdf4337fdc84d8314c97c4e492e6b84244a99d1 SHA1 (patch-src_llvm_cmake_modules_AddLLVM.cmake) = f0620ac62ecfb1d62d2dfa61b4c063d21c29b8f5 SHA1 (patch-src_llvm_include_llvm-c_DataTypes.h) = 432693204912e79059ee31e815ad1e24f3236374 Added files: Index: pkgsrc/lang/rust/patches/patch-src_librustc__llvm_build.rs diff -u /dev/null pkgsrc/lang/rust/patches/patch-src_librustc__llvm_build.rs:1.1 --- /dev/null Sat Jan 5 23:29:40 2019 +++ pkgsrc/lang/rust/patches/patch-src_librustc__llvm_build.rs Sat Jan 5 23:29:40 2019 @@ -0,0 +1,26 @@ +$NetBSD: patch-src_librustc__llvm_build.rs,v 1.1 2019/01/05 23:29:40 tnn Exp $ + +fix build on NetBSD HEAD-llvm. XXX there is probably a better way to do this. + +--- src/librustc_llvm/build.rs.orig 2018-12-18 23:11:17.000000000 +0000 ++++ src/librustc_llvm/build.rs +@@ -250,9 +250,17 @@ fn main() { + "c++" + } else if target.contains("netbsd") && llvm_static_stdcpp.is_some() { + // NetBSD uses a separate library when relocation is required +- "stdc++_pic" ++ if env::var_os("PKGSRC_HAVE_LIBCPP").is_some() { ++ "c++_pic" ++ } else { ++ "stdc++_pic" ++ } + } else { +- "stdc++" ++ if env::var_os("PKGSRC_HAVE_LIBCPP").is_some() { ++ "c++" ++ } else { ++ "stdc++" ++ } + }; + + // C++ runtime library Index: pkgsrc/lang/rust/patches/patch-src_libunwind_build.rs diff -u /dev/null pkgsrc/lang/rust/patches/patch-src_libunwind_build.rs:1.1 --- /dev/null Sat Jan 5 23:29:40 2019 +++ pkgsrc/lang/rust/patches/patch-src_libunwind_build.rs Sat Jan 5 23:29:40 2019 @@ -0,0 +1,17 @@ +$NetBSD: patch-src_libunwind_build.rs,v 1.1 2019/01/05 23:29:40 tnn Exp $ + +fix build on NetBSD HEAD-llvm. XXX there is probably a better way to do this. + +--- src/libunwind/build.rs.orig 2018-12-18 23:11:17.000000000 +0000 ++++ src/libunwind/build.rs +@@ -25,7 +25,9 @@ fn main() { + } else if target.contains("rumprun") { + println!("cargo:rustc-link-lib=unwind"); + } else if target.contains("netbsd") { +- println!("cargo:rustc-link-lib=gcc_s"); ++ if !env::var_os("PKGSRC_HAVE_LIBCPP").is_some() { ++ println!("cargo:rustc-link-lib=gcc_s"); ++ } + } else if target.contains("openbsd") { + println!("cargo:rustc-link-lib=c++abi"); + } else if target.contains("solaris") { --_----------=_1546730980209380--