diff --git a/lang/rust/Makefile b/lang/rust/Makefile index 80a04c24..9a22727c 100644 --- a/lang/rust/Makefile +++ b/lang/rust/Makefile @@ -2,7 +2,7 @@ # $FreeBSD: head/lang/rust/Makefile 520446 2019-12-19 16:14:48Z tobik $ PORTNAME= rust -PORTVERSION= 1.40.0 +PORTVERSION= 1.44.1 CATEGORIES= lang MASTER_SITES+= https://static.rust-lang.org/dist/:src MASTER_SITES+= https://static.rust-lang.org/dist/:rust_bootstrap @@ -15,15 +15,15 @@ MASTER_SITES+= https://github.com/llvm/llvm-project/releases/download/llvmorg-${ DISTNAME= ${PORTNAME}c-${PORTVERSION}-src DISTFILES= ${NIGHTLY_SUBDIR}${DISTNAME}${EXTRACT_SUFX}:src -DISTFILES+= ${_RUSTC_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:rust_bootstrap -DISTFILES+= ${_RUST_STD_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:rust_bootstrap -DISTFILES+= ${_CARGO_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:cargo_bootstrap +DISTFILES+= ${X_RUSTC_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:rust_bootstrap +DISTFILES+= ${X_RUST_STD_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:rust_bootstrap +DISTFILES+= ${X_CARGO_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:cargo_bootstrap DISTFILES+= ${DISTFILES_${ARCH}} DISTFILES_armv6= compiler-rt-${COMPILER_RT_VERSION}.src.tar.xz:compiler_rt DISTFILES_armv7= compiler-rt-${COMPILER_RT_VERSION}.src.tar.xz:compiler_rt DIST_SUBDIR= rust -EXTRACT_ONLY= ${DISTFILES:N*\:*bootstrap:C/:.*//} +#EXTRACT_ONLY= ${DISTFILES:N*\:*bootstrap:C/:.*//} MAINTAINER= rust@FreeBSD.org COMMENT= Language with a focus on memory safety and concurrency @@ -36,28 +36,41 @@ LIB_DEPENDS+= libcurl.so:net/libcurl LIB_DEPENDS+= libgit2.so:devel/libgit2 LIB_DEPENDS+= libssh2.so:net/libssh2 + +MAKE_ENV+= LIBGIT2_SYS_USE_PKG_CONFIG=1 LIBSSH2_SYS_USE_PKG_CONFIG=1 \ + + USES= pkgconfig python:3.3+,build ssl tar:xz PLIST_FILES= lib/rustlib/components lib/rustlib/rust-installer-version # See WRKSRC/src/stage0.txt for the date and version values. -BOOTSTRAPS_DATE?= 2019-11-07 -RUST_BOOTSTRAP_VERSION?= 1.39.0 -CARGO_BOOTSTRAP_VERSION?= 0.40.0 +#BOOTSTRAPS_DATE?= 2019-11-07 +#RUST_BOOTSTRAP_VERSION?= 1.39.0 +#CARGO_BOOTSTRAP_VERSION?= 0.40.0 COMPILER_RT_VERSION?= 9.0.0 +BOOTSTRAPS_DATE= 2020-05-07 +RUST_BOOTSTRAP_VERSION= 1.43.1 +CARGO_BOOTSTRAP_VERSION= 0.44.0 + + BOOTSTRAPS_SUFFIX= ${BOOTSTRAPS_SUFFIX_${ARCH}} CARGO_VENDOR_DIR= ${WRKSRC}/vendor # Rust's target arch string might be different from *BSD arch strings -_RUST_ARCH_amd64= x86_64 -_RUST_ARCH_i386= i686 -_RUST_TARGET= ${_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl} -_LLVM_TARGET= ${ARCH:C/armv.*/ARM/:S/aarch64/AArch64/:S/powerpc64/PowerPC/} +X_RUST_ARCH_amd64= x86_64 +X_RUST_ARCH_i386= i686 +X_RUST_ARCH= ${ARCH:S/amd64/x86_64/:S/i386/i686/} +X_RUST_TARGET= ${X_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl} +X_LLVM_TARGET= ${ARCH:C/armv.*/ARM/:S/aarch64/AArch64/:S/powerpc64/PowerPC/} + +X_RUSTC_BOOTSTRAP= ${BOOTSTRAPS_DATE}/rustc-${RUST_BOOTSTRAP_VERSION}-${X_RUST_TARGET} +X_RUST_STD_BOOTSTRAP= ${BOOTSTRAPS_DATE}/rust-std-${RUST_BOOTSTRAP_VERSION}-${X_RUST_TARGET} +X_CARGO_BOOTSTRAP= ${BOOTSTRAPS_DATE}/cargo-${CARGO_BOOTSTRAP_VERSION}-${X_RUST_TARGET} + +X_RUST_TARGETS= ${_RUST_TARGET} -_RUSTC_BOOTSTRAP= ${BOOTSTRAPS_DATE}/rustc-${RUST_BOOTSTRAP_VERSION}-${_RUST_TARGET} -_RUST_STD_BOOTSTRAP= ${BOOTSTRAPS_DATE}/rust-std-${RUST_BOOTSTRAP_VERSION}-${_RUST_TARGET} -_CARGO_BOOTSTRAP= ${BOOTSTRAPS_DATE}/cargo-${CARGO_BOOTSTRAP_VERSION}-${_RUST_TARGET} .include @@ -65,116 +78,143 @@ _CARGO_BOOTSTRAP= ${BOOTSTRAPS_DATE}/cargo-${CARGO_BOOTSTRAP_VERSION}-${_RUST_TA EXTRA_PATCHES+= ${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX} .endif -X_PY_ENV+= HOME="${WRKDIR}" -X_PY_ENV+= LIBGIT2_SYS_USE_PKG_CONFIG=1 -X_PY_ENV+= LIBSSH2_SYS_USE_PKG_CONFIG=1 -X_PY_ENV+= OPENSSL_DIR="${OPENSSLBASE}" -X_PY_CMD= ${PYTHON_CMD} ${WRKSRC}/x.py +MAKE_ENV+= HOME="${WRKDIR}" +MAKE_ENV+= LIBGIT2_SYS_USE_PKG_CONFIG=1 +MAKE_ENV+= LIBSSH2_SYS_USE_PKG_CONFIG=1 +MAKE_ENV+= OPENSSL_DIR="${OPENSSLBASE}" + +BUILD_COMMAND= ${PYTHON_CMD} ${WRKSRC}/x.py + +#post-extract: +#.if ${ARCH} == armv6 || ${ARCH} == armv7 +# ${LN} -sf ${WRKDIR}/compiler-rt-${COMPILER_RT_VERSION}.src ${WRKSRC}/src/llvm-project/compiler-rt +#.endif + +post-patch: +# ${REINPLACE_CMD} 's,gdb,${LOCALBASE}/bin/gdb,' ${WRKSRC}/src/etc/rust-gdb +# ${ECHO_MSG} "Canonical bootstrap date and version before patching:" +# ${GREP} -E '^(date|rustc|cargo)' ${WRKSRC}/src/stage0.txt +## If we override the versions and date of the bootstraps (for instance +## on aarch64 where we provide our own bootstraps), we need to update +## places where they are recorded. +# ${REINPLACE_CMD} -e 's,^date:.*,date: ${BOOTSTRAPS_DATE},' \ +# -e 's,^rustc:.*,rustc: ${RUST_BOOTSTRAP_VERSION},' \ +# -e 's,^cargo:.*,cargo: ${CARGO_BOOTSTRAP_VERSION},' \ +# ${WRKSRC}/src/stage0.txt +# ${ECHO_MSG} "Bootstrap date and version after patching:" +# ${GREP} -E '^(date|rustc|cargo)' ${WRKSRC}/src/stage0.txt +# Disable vendor checksums +# ${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' ${CARGO_VENDOR_DIR}/*/.cargo-checksum.json -post-extract: -.if ${ARCH} == armv6 || ${ARCH} == armv7 - ${LN} -sf ${WRKDIR}/compiler-rt-${COMPILER_RT_VERSION}.src ${WRKSRC}/src/llvm-project/compiler-rt -.endif post-patch: ${REINPLACE_CMD} 's,gdb,${LOCALBASE}/bin/gdb,' ${WRKSRC}/src/etc/rust-gdb - ${ECHO_MSG} "Canonical bootstrap date and version before patching:" - ${GREP} -E '^(date|rustc|cargo)' ${WRKSRC}/src/stage0.txt -# If we override the versions and date of the bootstraps (for instance -# on aarch64 where we provide our own bootstraps), we need to update -# places where they are recorded. - ${REINPLACE_CMD} -e 's,^date:.*,date: ${BOOTSTRAPS_DATE},' \ - -e 's,^rustc:.*,rustc: ${RUST_BOOTSTRAP_VERSION},' \ - -e 's,^cargo:.*,cargo: ${CARGO_BOOTSTRAP_VERSION},' \ - ${WRKSRC}/src/stage0.txt - ${ECHO_MSG} "Bootstrap date and version after patching:" - ${GREP} -E '^(date|rustc|cargo)' ${WRKSRC}/src/stage0.txt -# Disable vendor checksums - ${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' ${CARGO_VENDOR_DIR}/*/.cargo-checksum.json + ${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \ + ${CARGO_VENDOR_DIR}/*/.cargo-checksum.json + +#CCACHE_VALUE= false +# +#do-configure: +# ${SED} -E \ +# -e 's,%PREFIX%,${PREFIX},' \ +# -e 's,%SYSCONFDIR%,${PREFIX}/etc,' \ +# -e 's,%MANDIR%,${MANPREFIX}/man,' \ +# -e 's,%PYTHON_CMD%,${PYTHON_CMD},' \ +# -e 's,%CHANNEL%,${PKGNAMESUFFIX:Ustable:S/^-//},' \ +# -e 's,%TARGET%,${X_RUST_TARGET},' \ +# -e 's,%CCACHE%,${CCACHE_VALUE},' \ +# -e 's,%CC%,${CC},' \ +# -e 's,%CXX%,${CXX},' \ +# -e 's,%DOCS%,false,' \ +# < ${FILESDIR}/config.toml > ${WRKSRC}/config.toml +# +# no need to build a crosscompiler for these targets +#.if ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7 || ${ARCH} == powerpc64 +# ${REINPLACE_CMD} -e 's,^#targets =.*,targets = "${X_LLVM_TARGET}",' \ +# -e 's,^#experimental-targets =.*,experimental-targets = "",' \ +# ${WRKSRC}/config.toml +#.endif +# ${REINPLACE_CMD} -e 's,%CC%,${CC},g' \ +# ${WRKSRC}/src/librustc_llvm/build.rs \ +# ${WRKSRC}/src/bootstrap/native.rs + +bootstrap: + cd ${WRKDIR}/cargo-${CARGO_BOOTSTRAP_VERSION}-${X_RUST_ARCH}-unknown-${OPSYS:tl} && \ + ${SH} install.sh --disable-ldconfig --prefix=${WRKDIR}/bootstrap --verbose + cd ${WRKDIR}/rust-std-${RUST_BOOTSTRAP_VERSION}-${X_RUST_ARCH}-unknown-${OPSYS:tl} && \ + ${SH} install.sh --disable-ldconfig --prefix=${WRKDIR}/bootstrap --verbose + cd ${WRKDIR}/rustc-${RUST_BOOTSTRAP_VERSION}-${X_RUST_ARCH}-unknown-${OPSYS:tl} && \ + ${SH} install.sh --disable-ldconfig --prefix=${WRKDIR}/bootstrap --verbose -post-patch-SOURCES-off: -# Mimic tools in config.toml with just src excluded - ${REINPLACE_CMD} -e 's/config.tools.*"src".*/false;/' ${WRKSRC}/src/bootstrap/install.rs -CCACHE_VALUE= false do-configure: - ${SED} -E \ - -e 's,%PREFIX%,${PREFIX},' \ - -e 's,%SYSCONFDIR%,${PREFIX}/etc,' \ - -e 's,%MANDIR%,${MANPREFIX}/man,' \ - -e 's,%PYTHON_CMD%,${PYTHON_CMD},' \ - -e 's,%CHANNEL%,${PKGNAMESUFFIX:Ustable:S/^-//},' \ - -e 's,%TARGET%,${_RUST_TARGET},' \ - -e 's,%CCACHE%,${CCACHE_VALUE},' \ - -e 's,%CC%,${CC},' \ - -e 's,%CXX%,${CXX},' \ - -e 's,%DOCS%,false,' \ - < ${FILESDIR}/config.toml \ - > ${WRKSRC}/config.toml -# no need to build a crosscompiler for these targets -.if ${ARCH} == aarch64 || ${ARCH} == armv6 || ${ARCH} == armv7 || ${ARCH} == powerpc64 - ${REINPLACE_CMD} -e 's,^#targets =.*,targets = "${_LLVM_TARGET}",' \ - -e 's,^#experimental-targets =.*,experimental-targets = "",' \ - ${WRKSRC}/config.toml -.endif - ${REINPLACE_CMD} -e 's,%CC%,${CC},g' \ +# Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 +# ${SETENV} CC="${CC}" OPSYS="${OPSYS}" \ +# OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ +# ${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh +.for component in cargo rust-std rustc + cd ${WRKDIR}/${component}-*-${OPSYS:tl} && \ + ${SH} install.sh --disable-ldconfig --prefix=${WRKDIR}/bootstrap \ + --verbose +.endfor + ${ECHO_CMD} '[build]' > ${WRKSRC}/config.toml + ${ECHO_CMD} 'vendor=true' >> ${WRKSRC}/config.toml + ${ECHO_CMD} 'extended=true' >> ${WRKSRC}/config.toml + ${ECHO_CMD} 'python="${PYTHON_CMD}"' >> ${WRKSRC}/config.toml + ${ECHO_CMD} 'docs=false' >> ${WRKSRC}/config.toml + ${ECHO_CMD} 'verbose=2' >> ${WRKSRC}/config.toml + + ${ECHO_CMD} 'target=[${X_RUST_TARGETS:@.target.@"${.target.}"@:ts,}]' >> ${WRKSRC}/config.toml + + ${ECHO_CMD} 'cargo="${WRKDIR}/bootstrap/bin/cargo"' >> ${WRKSRC}/config.toml + ${ECHO_CMD} 'rustc="${WRKDIR}/bootstrap/bin/rustc"' >> ${WRKSRC}/config.toml + + ${ECHO_CMD} '[install]' >> ${WRKSRC}/config.toml + ${ECHO_CMD} 'prefix="${PREFIX}"' >> ${WRKSRC}/config.toml + ${ECHO_CMD} 'sysconfdir="${PREFIX}/etc"' >> ${WRKSRC}/config.toml + + ${ECHO_CMD} '[rust]' >> ${WRKSRC}/config.toml + ${ECHO_CMD} 'channel="stable"' >> ${WRKSRC}/config.toml + ${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml + ${ECHO_CMD} 'verbose-tests=true' >> ${WRKSRC}/config.toml + ${ECHO_CMD} 'lld=false' >> ${WRKSRC}/config.toml + ${ECHO_CMD} '[llvm]' >> ${WRKSRC}/config.toml + ${ECHO_CMD} 'ccache=false' >> ${WRKSRC}/config.toml +# ${ECHO_CMD} 'ninja=true' >> ${WRKSRC}/config.toml + +.for target in ${X_RUST_TARGETS} + ${ECHO_CMD} '[target.${target}]' >> ${WRKSRC}/config.toml + ${ECHO_CMD} 'ar="${AR}"' >> ${WRKSRC}/config.toml + ${ECHO_CMD} 'cc="${CC}"' >> ${WRKSRC}/config.toml + ${ECHO_CMD} 'cxx="${CXX}"' >> ${WRKSRC}/config.toml + ${ECHO_CMD} 'linker="${CC}"' >> ${WRKSRC}/config.toml +.endfor + ${ECHO_CMD} '[dist]' >> ${WRKSRC}/config.toml + ${ECHO_CMD} 'src-tarball=false' >> ${WRKSRC}/config.toml + ${REINPLACE_CMD} 's,%CC%,${CC},g' \ ${WRKSRC}/src/librustc_llvm/build.rs \ ${WRKSRC}/src/bootstrap/native.rs + do-build: - cd ${WRKSRC} && ${SETENV} ${X_PY_ENV} \ - ${X_PY_CMD} build --verbose --config ./config.toml --jobs ${MAKE_JOBS_NUMBER} + cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \ + ${BUILD_COMMAND} build --verbose --config ./config.toml --jobs ${MAKE_JOBS_NUMBER} do-install: cd ${WRKSRC} && \ - ${SETENV} ${X_PY_ENV} \ - DESTDIR=${STAGEDIR} \ - ${X_PY_CMD} 'install' --verbose --config ./config.toml --jobs ${MAKE_JOBS_NUMBER} + ${SETENV} ${MAKE_ENV} DESTDIR=${STAGEDIR} \ + ${BUILD_COMMAND} 'install' --verbose --config ./config.toml --jobs ${MAKE_JOBS_NUMBER} -# In post-install, we use the manifests generated during Rust install -# to in turn generate the PLIST. We do that, instead of the regular -# `pkg-plist`, because several libraries have a computed filename based -# on the absolute path of the source files. As it is user-specific, we -# can't know their filename in advance. -# -# Both rustc and Cargo components install the same README.md and LICENSE -# files. The install process backs up the first copy to install the -# second. Thus here, we need to remove those backups. We also need to -# dedup the entries in the generated PLIST, because both components' -# manifests list them. -# -# We fix manpage entries in the generated manifests because Rust -# installs them uncompressed but the Ports framework compresses them. post-install: - for f in ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-*; do \ - ${REINPLACE_CMD} -i '' -E \ - -e 's|:${STAGEDIR}|:|' \ - -e 's|(man/man[1-9]/.*\.[0-9])|\1.gz|' \ - "$$f"; \ - ${ECHO_CMD} "$${f#${STAGEDIR}}" >> ${TMPPLIST}; \ - ${AWK} '\ - /^file:/ { \ - file=$$0; \ - sub(/^file:/, "", file); \ - print file; \ - } \ - /^dir:/ { \ - dir=$$0; \ - sub(/^dir:/, "", dir); \ - system("find ${STAGEDIR}" dir " -type f | ${SED} -E -e \"s|${STAGEDIR}||\""); \ - }' \ - "$$f" >> ${TMPPLIST}; \ - done - ${RM} -r ${STAGEDIR}${PREFIX}/share/doc/rust/*.old - ${SORT} -u < ${TMPPLIST} > ${TMPPLIST}.uniq - ${MV} ${TMPPLIST}.uniq ${TMPPLIST} - ${RM} \ - ${STAGEDIR}${PREFIX}/lib/rustlib/install.log \ - ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh -# FIXME: Static libraries in lib/rustlib/*/lib/*.rlib are not stripped, -# but they contain non-object files which make strip(1) unhappy. - @${FIND} ${STAGEDIR}${PREFIX}/bin -exec ${FILE} -i {} + | ${AWK} -F: \ - '/executable|sharedlib/ { print $$1 }' | ${XARGS} ${STRIP_CMD} + ${GZIP_CMD} ${STAGEDIR}${PREFIX}/share/man/man1/*.1 + ${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/etc/*.py + cd ${STAGEDIR} && ${RM} -rf share/doc/rust/ + ${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/install.log + ${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-* + ${RM} ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh + + ${FIND} ${STAGEDIR}${PREFIX} -not -type d | \ + ${SED} -E -e 's,^${STAGEDIR}${PREFIX}/,,' >> ${TMPPLIST} .include diff --git a/lang/rust/distinfo b/lang/rust/distinfo index d28d3621..c5619aeb 100644 --- a/lang/rust/distinfo +++ b/lang/rust/distinfo @@ -1,47 +1,9 @@ -TIMESTAMP = 1576623023 -SHA256 (rust/rustc-1.40.0-src.tar.xz) = 6e2aa3a91697f4b225c6b394cbae6b97666f061dba491f666a5281698fe2aace -SIZE (rust/rustc-1.40.0-src.tar.xz) = 92306352 -SHA256 (rust/2019-11-07/rustc-1.39.0-aarch64-unknown-freebsd.tar.xz) = 44098962a570e05d691d3b7c3337b873b1e1f22ac49fd19c0d5d3362c0008eb5 -SIZE (rust/2019-11-07/rustc-1.39.0-aarch64-unknown-freebsd.tar.xz) = 23895952 -SHA256 (rust/2019-11-07/rust-std-1.39.0-aarch64-unknown-freebsd.tar.xz) = 21372596cda35c4acdb11bab0e6d3f62f815a8166eb717e57e223548f3afee08 -SIZE (rust/2019-11-07/rust-std-1.39.0-aarch64-unknown-freebsd.tar.xz) = 164721768 -SHA256 (rust/2019-11-07/cargo-0.40.0-aarch64-unknown-freebsd.tar.xz) = 184f64a67f05c23597f1b52ef13e31c5e12288032ccb94bddfc217f26b77c93f -SIZE (rust/2019-11-07/cargo-0.40.0-aarch64-unknown-freebsd.tar.xz) = 3054584 -SHA256 (rust/2019-11-07/rustc-1.39.0-x86_64-unknown-freebsd.tar.xz) = 802aa5124f15002ba07b33838f6b8ecb394e3d63d2f9bd2de725c85baf8b8bf5 -SIZE (rust/2019-11-07/rustc-1.39.0-x86_64-unknown-freebsd.tar.xz) = 33790600 -SHA256 (rust/2019-11-07/rust-std-1.39.0-x86_64-unknown-freebsd.tar.xz) = 7015a0b0a991af19b0a7d0cbb1b0e2aae612a19cf2a4ab9cdb49f91f9e443201 -SIZE (rust/2019-11-07/rust-std-1.39.0-x86_64-unknown-freebsd.tar.xz) = 189611944 -SHA256 (rust/2019-11-07/cargo-0.40.0-x86_64-unknown-freebsd.tar.xz) = 762c436fa220120bc57a0a4d5256b69f6b55e8d07153744cb6c81e4d064912bf -SIZE (rust/2019-11-07/cargo-0.40.0-x86_64-unknown-freebsd.tar.xz) = 4908636 -SHA256 (rust/2019-11-07/rustc-1.39.0-armv6-unknown-freebsd.tar.xz) = c1f014f8c4f804d413be842dba3655ab69ee70d663b25d1a0027224480e511f3 -SIZE (rust/2019-11-07/rustc-1.39.0-armv6-unknown-freebsd.tar.xz) = 25359460 -SHA256 (rust/2019-11-07/rust-std-1.39.0-armv6-unknown-freebsd.tar.xz) = 09bf68c8aaf0a4de36d7608e15001878ac048f1a9eda3bef7a66338b31bd1cd4 -SIZE (rust/2019-11-07/rust-std-1.39.0-armv6-unknown-freebsd.tar.xz) = 170165620 -SHA256 (rust/2019-11-07/cargo-0.40.0-armv6-unknown-freebsd.tar.xz) = 4c13fee359a77a73ce96f524c58198cca567971692b17e97e41ecb01fe70dc5c -SIZE (rust/2019-11-07/cargo-0.40.0-armv6-unknown-freebsd.tar.xz) = 3183372 -SHA256 (rust/compiler-rt-9.0.0.src.tar.xz) = 56e4cd96dd1d8c346b07b4d6b255f976570c6f2389697347a6c3dcb9e820d10e -SIZE (rust/compiler-rt-9.0.0.src.tar.xz) = 1993084 -SHA256 (rust/2019-11-07/rustc-1.39.0-armv7-unknown-freebsd.tar.xz) = 5902ceb1aefbced859969a928c4ad15063a58e120d79a18cab37dc4d7384d591 -SIZE (rust/2019-11-07/rustc-1.39.0-armv7-unknown-freebsd.tar.xz) = 24862380 -SHA256 (rust/2019-11-07/rust-std-1.39.0-armv7-unknown-freebsd.tar.xz) = 5469b9c844ac9e830d77715a988c3185f287962de9a2408513b89dac9662ac34 -SIZE (rust/2019-11-07/rust-std-1.39.0-armv7-unknown-freebsd.tar.xz) = 169316140 -SHA256 (rust/2019-11-07/cargo-0.40.0-armv7-unknown-freebsd.tar.xz) = 3acfcd4b7ce2a5d1646d0b53d453140d4a3b9216fcb66c435d1d4b83381b2499 -SIZE (rust/2019-11-07/cargo-0.40.0-armv7-unknown-freebsd.tar.xz) = 3134692 -SHA256 (rust/2019-11-07/rustc-1.39.0-i686-unknown-freebsd.tar.xz) = eebab1fb8cbbfa7e348daeb319a8fdf3ab40c7439deb012fd9ceeed322518f7c -SIZE (rust/2019-11-07/rustc-1.39.0-i686-unknown-freebsd.tar.xz) = 34660340 -SHA256 (rust/2019-11-07/rust-std-1.39.0-i686-unknown-freebsd.tar.xz) = bd19a91be5f470c838c524a86a6ff83557247e7fbe498d773c643b06a78be97f -SIZE (rust/2019-11-07/rust-std-1.39.0-i686-unknown-freebsd.tar.xz) = 189894544 -SHA256 (rust/2019-11-07/cargo-0.40.0-i686-unknown-freebsd.tar.xz) = 9daad89cecfa45e85e191f4870613e5b0acfa92742ae8c07eb4f48a1f3f4d9be -SIZE (rust/2019-11-07/cargo-0.40.0-i686-unknown-freebsd.tar.xz) = 4875016 -SHA256 (rust/2019-11-07/rustc-1.39.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 0f0b89fb869a4ff856a3c3b971fa7bd0e317b2d567f5db994159e019100d7d23 -SIZE (rust/2019-11-07/rustc-1.39.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 28846960 -SHA256 (rust/2019-11-07/rust-std-1.39.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 378efabaf53ff15165bda53509b40fb347e3f88275ca4cc81f4cfb185eed981e -SIZE (rust/2019-11-07/rust-std-1.39.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 164834720 -SHA256 (rust/2019-11-07/cargo-0.40.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 707eef9bac71a44db8e1d64c70a771fbac1f81f7ca58a2e3025ec1cc4d263b18 -SIZE (rust/2019-11-07/cargo-0.40.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 3423776 -SHA256 (rust/2019-11-07/rustc-1.39.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = e615095f1fb2017938147da213d04444b785ae34128c4aa9099996f0de610a52 -SIZE (rust/2019-11-07/rustc-1.39.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 24519864 -SHA256 (rust/2019-11-07/rust-std-1.39.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = fb83397a7b6abfcf292ed50f8c277617c2e77686778ca853ca2228f7aa5d7a84 -SIZE (rust/2019-11-07/rust-std-1.39.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 163807368 -SHA256 (rust/2019-11-07/cargo-0.40.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = aeebed336e09121f4d8803b5b6c2814a0901773a65bce9bd091a06d6082ac978 -SIZE (rust/2019-11-07/cargo-0.40.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 2753592 +TIMESTAMP = 1592924993 +SHA256 (rust/rustc-1.44.1-src.tar.xz) = e0386295dd5f2c7842835a509e4c57989eec6c29f989a1c85478b0e06f9d38ea +SIZE (rust/rustc-1.44.1-src.tar.xz) = 94756856 +SHA256 (rust/2020-05-07/rustc-1.43.1-x86_64-unknown-freebsd.tar.xz) = 4994ca39eb269023165ef2382a66d7918802265a92e7be913d5763f9948b23f7 +SIZE (rust/2020-05-07/rustc-1.43.1-x86_64-unknown-freebsd.tar.xz) = 36498668 +SHA256 (rust/2020-05-07/rust-std-1.43.1-x86_64-unknown-freebsd.tar.xz) = fb9bb4ab595f335d5fe55a25cd329b56020afff778b82758ddc7b314b97f7177 +SIZE (rust/2020-05-07/rust-std-1.43.1-x86_64-unknown-freebsd.tar.xz) = 16737696 +SHA256 (rust/2020-05-07/cargo-0.44.0-x86_64-unknown-freebsd.tar.xz) = 4a40f6d2a9404af71131ddb38910757d1f8602b0038a4df6f661c9f9f992ed23 +SIZE (rust/2020-05-07/cargo-0.44.0-x86_64-unknown-freebsd.tar.xz) = 5152316 diff --git a/lang/rust/files/config.toml b/lang/rust/files/config.toml index ad7a2643..6a17b0e0 100644 --- a/lang/rust/files/config.toml +++ b/lang/rust/files/config.toml @@ -12,6 +12,8 @@ python = "%PYTHON_CMD%" # Do we want to build docs? docs = %DOCS% +verbose = 2 + [install] # Install location. diff --git a/lang/rust/files/patch-src_bootstrap_bootstrap.py b/lang/rust/files/patch-src_bootstrap_bootstrap.py deleted file mode 100644 index 54b6f8ef..00000000 --- a/lang/rust/files/patch-src_bootstrap_bootstrap.py +++ /dev/null @@ -1,81 +0,0 @@ -https://github.com/rust-lang/rust/commit/8d56bcc59c92 - ---- src/bootstrap/bootstrap.py.orig 2019-11-04 15:45:21 UTC -+++ src/bootstrap/bootstrap.py -@@ -102,10 +102,10 @@ def verify(path, sha_path, verbose): - return verified - - --def unpack(tarball, dst, verbose=False, match=None): -+def unpack(tarball, tarball_suffix, dst, verbose=False, match=None): - """Unpack the given tarball file""" - print("extracting", tarball) -- fname = os.path.basename(tarball).replace(".tar.gz", "") -+ fname = os.path.basename(tarball).replace(tarball_suffix, "") - with contextlib.closing(tarfile.open(tarball)) as tar: - for member in tar.getnames(): - if "/" not in member: -@@ -331,6 +331,18 @@ class RustBuild(object): - self.use_vendored_sources = '' - self.verbose = False - -+ def support_xz(): -+ try: -+ with tempfile.NamedTemporaryFile(delete=False) as temp_file: -+ temp_path = temp_file.name -+ with tarfile.open(temp_path, "w:xz") as tar: -+ pass -+ return True -+ except tarfile.CompressionError: -+ return False -+ -+ self.tarball_suffix = '.tar.xz' if support_xz() else '.tar.gz' -+ - def download_stage0(self): - """Fetch the build system for Rust, written in Rust - -@@ -349,12 +361,13 @@ class RustBuild(object): - self.program_out_of_date(self.rustc_stamp())): - if os.path.exists(self.bin_root()): - shutil.rmtree(self.bin_root()) -- filename = "rust-std-{}-{}.tar.gz".format( -- rustc_channel, self.build) -+ filename = "rust-std-{}-{}{}".format( -+ rustc_channel, self.build, self.tarball_suffix) - pattern = "rust-std-{}".format(self.build) - self._download_stage0_helper(filename, pattern) - -- filename = "rustc-{}-{}.tar.gz".format(rustc_channel, self.build) -+ filename = "rustc-{}-{}{}".format(rustc_channel, self.build, -+ self.tarball_suffix) - self._download_stage0_helper(filename, "rustc") - self.fix_executable("{}/bin/rustc".format(self.bin_root())) - self.fix_executable("{}/bin/rustdoc".format(self.bin_root())) -@@ -365,14 +378,15 @@ class RustBuild(object): - # libraries/binaries that are included in rust-std with - # the system MinGW ones. - if "pc-windows-gnu" in self.build: -- filename = "rust-mingw-{}-{}.tar.gz".format( -- rustc_channel, self.build) -+ filename = "rust-mingw-{}-{}{}".format( -+ rustc_channel, self.build, self.tarball_suffix) - self._download_stage0_helper(filename, "rust-mingw") - - if self.cargo().startswith(self.bin_root()) and \ - (not os.path.exists(self.cargo()) or - self.program_out_of_date(self.cargo_stamp())): -- filename = "cargo-{}-{}.tar.gz".format(cargo_channel, self.build) -+ filename = "cargo-{}-{}{}".format(cargo_channel, self.build, -+ self.tarball_suffix) - self._download_stage0_helper(filename, "cargo") - self.fix_executable("{}/bin/cargo".format(self.bin_root())) - with output(self.cargo_stamp()) as cargo_stamp: -@@ -388,7 +402,7 @@ class RustBuild(object): - tarball = os.path.join(rustc_cache, filename) - if not os.path.exists(tarball): - get("{}/{}".format(url, filename), tarball, verbose=self.verbose) -- unpack(tarball, self.bin_root(), match=pattern, verbose=self.verbose) -+ unpack(tarball, self.tarball_suffix, self.bin_root(), match=pattern, verbose=self.verbose) - - @staticmethod - def fix_executable(fname): diff --git a/lang/rust/files/patch-src_bootstrap_native.rs b/lang/rust/files/patch-src_bootstrap_native.rs new file mode 100644 index 00000000..433833a4 --- /dev/null +++ b/lang/rust/files/patch-src_bootstrap_native.rs @@ -0,0 +1,34 @@ +There seems to be some kind of race when using llvm-config-wrapper +for building rust-lld. Attempt to improve reliability of the build +by not using it. llvm-config-wrapper is a hack in the first place +that is only really needed on Windows. + +--- src/bootstrap/native.rs.orig 2020-02-27 18:39:49 UTC ++++ src/bootstrap/native.rs +@@ -467,25 +467,9 @@ impl Step for Lld { + let mut cfg = cmake::Config::new(builder.src.join("src/llvm-project/lld")); + configure_cmake(builder, target, &mut cfg, true); + +- // This is an awful, awful hack. Discovered when we migrated to using +- // clang-cl to compile LLVM/LLD it turns out that LLD, when built out of +- // tree, will execute `llvm-config --cmakedir` and then tell CMake about +- // that directory for later processing. Unfortunately if this path has +- // forward slashes in it (which it basically always does on Windows) +- // then CMake will hit a syntax error later on as... something isn't +- // escaped it seems? +- // +- // Instead of attempting to fix this problem in upstream CMake and/or +- // LLVM/LLD we just hack around it here. This thin wrapper will take the +- // output from llvm-config and replace all instances of `\` with `/` to +- // ensure we don't hit the same bugs with escaping. It means that you +- // can't build on a system where your paths require `\` on Windows, but +- // there's probably a lot of reasons you can't do that other than this. +- let llvm_config_shim = env::current_exe().unwrap().with_file_name("llvm-config-wrapper"); + cfg.out_dir(&out_dir) + .profile("Release") +- .env("LLVM_CONFIG_REAL", llvm_config) +- .define("LLVM_CONFIG_PATH", llvm_config_shim) ++ .define("LLVM_CONFIG_PATH", llvm_config) + .define("LLVM_INCLUDE_TESTS", "OFF"); + + cfg.build(); diff --git a/lang/rust/files/patch-src_librustc__target_spec_i686__unknown__freebsd.rs b/lang/rust/files/patch-src_librustc__target_spec_i686__unknown__freebsd.rs index 0d903af6..75c659e6 100644 --- a/lang/rust/files/patch-src_librustc__target_spec_i686__unknown__freebsd.rs +++ b/lang/rust/files/patch-src_librustc__target_spec_i686__unknown__freebsd.rs @@ -1,4 +1,4 @@ ---- src/librustc_target/spec/i686_unknown_freebsd.rs.orig 2019-04-08 12:42:31 UTC +--- src/librustc_target/spec/i686_unknown_freebsd.rs.orig 2020-01-23 19:40:44 UTC +++ src/librustc_target/spec/i686_unknown_freebsd.rs @@ -2,7 +2,7 @@ use crate::spec::{LinkerFlavor, Target, TargetResult}; @@ -7,5 +7,5 @@ - base.cpu = "pentium4".to_string(); + base.cpu = "pentiumpro".to_string(); base.max_atomic_width = Some(64); - base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m32".to_string()); - base.stack_probes = true; + let pre_link_args = base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap(); + pre_link_args.push("-m32".to_string()); diff --git a/lang/rust/files/patch-src_llvm-project_llvm_lib_Transforms_InstCombine_InstCombineCasts.cpp b/lang/rust/files/patch-src_llvm-project_llvm_lib_Transforms_InstCombine_InstCombineCasts.cpp new file mode 100644 index 00000000..1b4a494b --- /dev/null +++ b/lang/rust/files/patch-src_llvm-project_llvm_lib_Transforms_InstCombine_InstCombineCasts.cpp @@ -0,0 +1,156 @@ +From f8e146f3430de3a6cd904f3f3f7aa1bfaefee14c Mon Sep 17 00:00:00 2001 +From: Bjorn Pettersson +Date: Thu, 28 Nov 2019 23:18:28 +0100 +Subject: [PATCH] [InstCombine] Fix big-endian miscompile of (bitcast + (zext/trunc (bitcast))) + +Summary: +optimizeVectorResize is rewriting patterns like: + %1 = bitcast vector %src to integer + %2 = trunc/zext %1 + %dst = bitcast %2 to vector + +Since bitcasting between integer an vector types gives +different integer values depending on endianness, we need +to take endianness into account. As it happens the old +implementation only produced the correct result for little +endian targets. + +Fixes: https://bugs.llvm.org/show_bug.cgi?id=44178 + +Reviewers: spatel, lattner, lebedev.ri + +Reviewed By: spatel, lebedev.ri + +Subscribers: lebedev.ri, hiraditya, uabelho, llvm-commits + +Tags: #llvm + +Differential Revision: https://reviews.llvm.org/D70844 + +(cherry picked from commit a9d6b0e5444741d08ff1df7cf71d1559e7fefc1f) +--- + .../InstCombine/InstCombineCasts.cpp | 79 +++++++++++++------ + llvm/test/Transforms/InstCombine/cast.ll | 6 +- + 2 files changed, 60 insertions(+), 25 deletions(-) + +--- src/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp.orig 2020-04-07 15:52:51 UTC ++++ src/llvm-project/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp +@@ -18,6 +18,7 @@ + #include "llvm/IR/DIBuilder.h" + #include "llvm/IR/PatternMatch.h" + #include "llvm/Support/KnownBits.h" ++#include + using namespace llvm; + using namespace PatternMatch; + +@@ -1820,12 +1821,24 @@ Instruction *InstCombiner::visitPtrToInt(PtrToIntInst + } + + /// This input value (which is known to have vector type) is being zero extended +-/// or truncated to the specified vector type. ++/// or truncated to the specified vector type. Since the zext/trunc is done ++/// using an integer type, we have a (bitcast(cast(bitcast))) pattern, ++/// endianness will impact which end of the vector that is extended or ++/// truncated. ++/// ++/// A vector is always stored with index 0 at the lowest address, which ++/// corresponds to the most significant bits for a big endian stored integer and ++/// the least significant bits for little endian. A trunc/zext of an integer ++/// impacts the big end of the integer. Thus, we need to add/remove elements at ++/// the front of the vector for big endian targets, and the back of the vector ++/// for little endian targets. ++/// + /// Try to replace it with a shuffle (and vector/vector bitcast) if possible. + /// + /// The source and destination vector types may have different element types. +-static Instruction *optimizeVectorResize(Value *InVal, VectorType *DestTy, +- InstCombiner &IC) { ++static Instruction *optimizeVectorResizeWithIntegerBitCasts(Value *InVal, ++ VectorType *DestTy, ++ InstCombiner &IC) { + // We can only do this optimization if the output is a multiple of the input + // element size, or the input is a multiple of the output element size. + // Convert the input type to have the same element type as the output. +@@ -1844,31 +1857,53 @@ static Instruction *optimizeVectorResize(Value *InVal, + InVal = IC.Builder.CreateBitCast(InVal, SrcTy); + } + ++ bool IsBigEndian = IC.getDataLayout().isBigEndian(); ++ unsigned SrcElts = SrcTy->getNumElements(); ++ unsigned DestElts = DestTy->getNumElements(); ++ ++ assert(SrcElts != DestElts && "Element counts should be different."); ++ + // Now that the element types match, get the shuffle mask and RHS of the + // shuffle to use, which depends on whether we're increasing or decreasing the + // size of the input. +- SmallVector ShuffleMask; ++ SmallVector ShuffleMaskStorage; ++ ArrayRef ShuffleMask; + Value *V2; + +- if (SrcTy->getNumElements() > DestTy->getNumElements()) { +- // If we're shrinking the number of elements, just shuffle in the low +- // elements from the input and use undef as the second shuffle input. +- V2 = UndefValue::get(SrcTy); +- for (unsigned i = 0, e = DestTy->getNumElements(); i != e; ++i) +- ShuffleMask.push_back(i); ++ // Produce an identify shuffle mask for the src vector. ++ ShuffleMaskStorage.resize(SrcElts); ++ std::iota(ShuffleMaskStorage.begin(), ShuffleMaskStorage.end(), 0); + ++ if (SrcElts > DestElts) { ++ // If we're shrinking the number of elements (rewriting an integer ++ // truncate), just shuffle in the elements corresponding to the least ++ // significant bits from the input and use undef as the second shuffle ++ // input. ++ V2 = UndefValue::get(SrcTy); ++ // Make sure the shuffle mask selects the "least significant bits" by ++ // keeping elements from back of the src vector for big endian, and from the ++ // front for little endian. ++ ShuffleMask = ShuffleMaskStorage; ++ if (IsBigEndian) ++ ShuffleMask = ShuffleMask.take_back(DestElts); ++ else ++ ShuffleMask = ShuffleMask.take_front(DestElts); + } else { +- // If we're increasing the number of elements, shuffle in all of the +- // elements from InVal and fill the rest of the result elements with zeros +- // from a constant zero. ++ // If we're increasing the number of elements (rewriting an integer zext), ++ // shuffle in all of the elements from InVal. Fill the rest of the result ++ // elements with zeros from a constant zero. + V2 = Constant::getNullValue(SrcTy); +- unsigned SrcElts = SrcTy->getNumElements(); +- for (unsigned i = 0, e = SrcElts; i != e; ++i) +- ShuffleMask.push_back(i); +- +- // The excess elements reference the first element of the zero input. +- for (unsigned i = 0, e = DestTy->getNumElements()-SrcElts; i != e; ++i) +- ShuffleMask.push_back(SrcElts); ++ // Use first elt from V2 when indicating zero in the shuffle mask. ++ uint32_t NullElt = SrcElts; ++ // Extend with null values in the "most significant bits" by adding elements ++ // in front of the src vector for big endian, and at the back for little ++ // endian. ++ unsigned DeltaElts = DestElts - SrcElts; ++ if (IsBigEndian) ++ ShuffleMaskStorage.insert(ShuffleMaskStorage.begin(), DeltaElts, NullElt); ++ else ++ ShuffleMaskStorage.append(DeltaElts, NullElt); ++ ShuffleMask = ShuffleMaskStorage; + } + + return new ShuffleVectorInst(InVal, V2, +@@ -2396,8 +2431,8 @@ Instruction *InstCombiner::visitBitCast(BitCastInst &C + CastInst *SrcCast = cast(Src); + if (BitCastInst *BCIn = dyn_cast(SrcCast->getOperand(0))) + if (isa(BCIn->getOperand(0)->getType())) +- if (Instruction *I = optimizeVectorResize(BCIn->getOperand(0), +- cast(DestTy), *this)) ++ if (Instruction *I = optimizeVectorResizeWithIntegerBitCasts( ++ BCIn->getOperand(0), cast(DestTy), *this)) + return I; + } + diff --git a/lang/rust/files/patch-src_llvm-project_llvm_utils_llvm-build_llvmbuild_main.py b/lang/rust/files/patch-src_llvm-project_llvm_utils_llvm-build_llvmbuild_main.py deleted file mode 100644 index 475d9833..00000000 --- a/lang/rust/files/patch-src_llvm-project_llvm_utils_llvm-build_llvmbuild_main.py +++ /dev/null @@ -1,11 +0,0 @@ ---- src/llvm-project/llvm/utils/llvm-build/llvmbuild/main.py.orig 2019-09-20 16:14:30 UTC -+++ src/llvm-project/llvm/utils/llvm-build/llvmbuild/main.py -@@ -657,6 +657,8 @@ def add_magic_target_components(parser, project, opts) - # We handle a few special cases of target names here for historical - # reasons, as these are the names configure currently comes up with. - native_target_name = { 'x86' : 'X86', -+ 'i386' : 'X86', -+ 'amd64' : 'X86', - 'x86_64' : 'X86', - 'Unknown' : None }.get(opts.native_target, - opts.native_target) diff --git a/lang/rust/files/patch-vendor_backtrace-sys_src_libbacktrace_fileline.c b/lang/rust/files/patch-vendor_backtrace-sys_src_libbacktrace_fileline.c deleted file mode 100644 index 3ab27099..00000000 --- a/lang/rust/files/patch-vendor_backtrace-sys_src_libbacktrace_fileline.c +++ /dev/null @@ -1,44 +0,0 @@ -This file is in the public domain. - ---- vendor/backtrace-sys/src/libbacktrace/fileline.c.orig 2019-01-16 09:30:44 UTC -+++ vendor/backtrace-sys/src/libbacktrace/fileline.c -@@ -39,8 +39,39 @@ POSSIBILITY OF SUCH DAMAGE. */ - #include - #include - -+#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) -+#include -+#include -+#endif -+ - #include "backtrace.h" - #include "internal.h" -+ -+#if !defined(HAVE_GETEXECNAME) && defined(KERN_PROC_PATHNAME) -+/* Return pathname of executable or 0 on failure. */ -+#define HAVE_GETEXECNAME -+static char execname[PATH_MAX + 1]; -+static const char * -+getexecname(void) -+{ -+ size_t path_len = sizeof(execname); -+ int mib[] = { -+ CTL_KERN, -+#if defined(__NetBSD__) -+ KERN_PROC_ARGS, -+ -1, -+ KERN_PROC_PATHNAME, -+#else -+ KERN_PROC, -+ KERN_PROC_PATHNAME, -+ -1, -+#endif -+ }; -+ u_int miblen = sizeof(mib) / sizeof(mib[0]); -+ int rc = sysctl(mib, miblen, execname, &path_len, NULL, 0); -+ return rc ? NULL : execname; -+} -+#endif /* !HAVE_GETEXECNAME && KERN_PROC_PATHNAME */ - - #ifndef HAVE_GETEXECNAME - #define getexecname() NULL diff --git a/lang/rust/files/patch-vendor_cc_src_lib.rs b/lang/rust/files/patch-vendor_cc_src_lib.rs new file mode 100644 index 00000000..0c6b6f99 --- /dev/null +++ b/lang/rust/files/patch-vendor_cc_src_lib.rs @@ -0,0 +1,42 @@ +When the compiler has "clang" in its name the cc crate will pass +an LLVM target triple to it. Rust uses a triple that lacks the OS +version and LLVM will default to FreeBSD 9 behavior, i.e., it will +default to libstdc++ which is no longer available in newer releases. + +To avoid this issue assume we have a GNU compatible toolchain instead +until LLVM can be updated to use libc++ by default. + +https://reviews.llvm.org/D77776 + +--- vendor/cc/src/lib.rs.orig 2020-04-14 08:55:10 UTC ++++ vendor/cc/src/lib.rs +@@ -2353,28 +2353,7 @@ impl Tool { + } + + fn with_features(path: PathBuf, clang_driver: Option<&str>, cuda: bool) -> Self { +- // Try to detect family of the tool from its name, falling back to Gnu. +- let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) { +- if fname.contains("clang-cl") { +- ToolFamily::Msvc { clang_cl: true } +- } else if fname.contains("cl") +- && !fname.contains("cloudabi") +- && !fname.contains("uclibc") +- && !fname.contains("clang") +- { +- ToolFamily::Msvc { clang_cl: false } +- } else if fname.contains("clang") { +- match clang_driver { +- Some("cl") => ToolFamily::Msvc { clang_cl: true }, +- _ => ToolFamily::Clang, +- } +- } else { +- ToolFamily::Gnu +- } +- } else { +- ToolFamily::Gnu +- }; +- ++ let family = ToolFamily::Gnu; + Tool { + path: path, + cc_wrapper_path: None, diff --git a/lang/rust/files/patch-vendor_libgit2-sys_lib.rs b/lang/rust/files/patch-vendor_libgit2-sys_lib.rs deleted file mode 100644 index 880de9d3..00000000 --- a/lang/rust/files/patch-vendor_libgit2-sys_lib.rs +++ /dev/null @@ -1,30 +0,0 @@ -Revert to libgit2 0.28 API per https://github.com/rust-lang/git2-rs/issues/458 - ---- vendor/libgit2-sys/lib.rs.orig 2019-11-04 17:34:46 UTC -+++ vendor/libgit2-sys/lib.rs -@@ -331,7 +331,6 @@ pub struct git_remote_callbacks { - pub push_negotiation: Option, - pub transport: Option, - pub payload: *mut c_void, -- pub resolve_url: Option, - } - - #[repr(C)] -@@ -385,8 +384,6 @@ pub type git_push_negotiation = - - pub type git_push_update_reference_cb = - extern "C" fn(*const c_char, *const c_char, *mut c_void) -> c_int; --pub type git_url_resolve_cb = -- extern "C" fn(*mut git_buf, *const c_char, c_int, *mut c_void) -> c_int; - - #[repr(C)] - pub struct git_push_update { -@@ -2280,7 +2277,7 @@ extern "C" { - source: *const git_tree, - ) -> c_int; - pub fn git_treebuilder_clear(bld: *mut git_treebuilder); -- pub fn git_treebuilder_entrycount(bld: *mut git_treebuilder) -> size_t; -+ pub fn git_treebuilder_entrycount(bld: *mut git_treebuilder) -> c_uint; - pub fn git_treebuilder_free(bld: *mut git_treebuilder); - pub fn git_treebuilder_get( - bld: *mut git_treebuilder, diff --git a/lang/rust/files/patch-vendor_openssl-sys_build_cfgs.rs b/lang/rust/files/patch-vendor_openssl-sys_build_cfgs.rs deleted file mode 100644 index 1a2aa256..00000000 --- a/lang/rust/files/patch-vendor_openssl-sys_build_cfgs.rs +++ /dev/null @@ -1,22 +0,0 @@ ---- vendor/openssl-sys/build/cfgs.rs.orig 2019-05-13 21:50:35 UTC -+++ vendor/openssl-sys/build/cfgs.rs -@@ -13,6 +13,9 @@ pub fn get(openssl_version: Option, libressl_vers - if libressl_version >= 0x2_07_00_00_0 { - cfgs.push("libressl270"); - } -+ if libressl_version >= 0x2_07_01_00_0 { -+ cfgs.push("libressl271"); -+ } - if libressl_version >= 0x2_07_03_00_0 { - cfgs.push("libressl273"); - } -@@ -21,6 +24,9 @@ pub fn get(openssl_version: Option, libressl_vers - } - if libressl_version >= 0x2_08_01_00_0 { - cfgs.push("libressl281"); -+ } -+ if libressl_version >= 0x2_09_01_00_0 { -+ cfgs.push("libressl291"); - } - } else { - let openssl_version = openssl_version.unwrap(); diff --git a/lang/rust/files/patch-vendor_openssl-sys_build_main.rs b/lang/rust/files/patch-vendor_openssl-sys_build_main.rs index 06293196..c5cd7fbb 100644 --- a/lang/rust/files/patch-vendor_openssl-sys_build_main.rs +++ b/lang/rust/files/patch-vendor_openssl-sys_build_main.rs @@ -1,59 +1,21 @@ ---- vendor/openssl-sys/build/main.rs.orig 2019-11-04 17:34:46 UTC +--- vendor/openssl-sys/build/main.rs.orig 2020-06-01 17:45:25 UTC +++ vendor/openssl-sys/build/main.rs -@@ -183,27 +183,32 @@ See rust-openssl README for more information: - if let Some(libressl_version) = libressl_version { - println!("cargo:libressl_version_number={:x}", libressl_version); - -+ let major = (libressl_version >> 28) as u8; - let minor = (libressl_version >> 20) as u8; - let fix = (libressl_version >> 12) as u8; -- let (minor, fix) = match (minor, fix) { -- (5, 0) => ('5', '0'), -- (5, 1) => ('5', '1'), -- (5, 2) => ('5', '2'), -- (5, _) => ('5', 'x'), -- (6, 0) => ('6', '0'), -- (6, 1) => ('6', '1'), -- (6, 2) => ('6', '2'), -- (6, _) => ('6', 'x'), -- (7, _) => ('7', 'x'), -- (8, 0) => ('8', '0'), -- (8, 1) => ('8', '1'), -- (8, _) => ('8', 'x'), -- (9, 0) => ('9', '0'), -+ let (major, minor, fix) = match (major, minor, fix) { -+ (2, 5, 0) => ('2', '5', '0'), -+ (2, 5, 1) => ('2', '5', '1'), -+ (2, 5, 2) => ('2', '5', '2'), -+ (2, 5, _) => ('2', '5', 'x'), -+ (2, 6, 0) => ('2', '6', '0'), -+ (2, 6, 1) => ('2', '6', '1'), -+ (2, 6, 2) => ('2', '6', '2'), -+ (2, 6, _) => ('2', '6', 'x'), -+ (2, 7, _) => ('2', '7', 'x'), -+ (2, 8, 0) => ('2', '8', '0'), -+ (2, 8, 1) => ('2', '8', '1'), -+ (2, 8, _) => ('2', '8', 'x'), -+ (2, 9, 0) => ('2', '9', '0'), -+ (2, 9, _) => ('2', '9', 'x'), -+ (3, 0, 0) => ('3', '0', '0'), -+ (3, 0, 1) => ('3', '0', '1'), -+ (3, 0, _) => ('3', '0', 'x'), +@@ -204,6 +204,9 @@ See rust-openssl README for more information: + (3, 0, 0) => ('3', '0', '0'), + (3, 0, 1) => ('3', '0', '1'), + (3, 0, _) => ('3', '0', 'x'), ++ (3, 1, 0) => ('3', '1', '0'), ++ (3, 1, _) => ('3', '1', 'x'), ++ (3, 2, 0) => ('3', '2', '0'), _ => version_error(), }; - println!("cargo:libressl=true"); -- println!("cargo:libressl_version=2{}{}", minor, fix); -+ println!("cargo:libressl_version={}{}{}", major, minor, fix); - println!("cargo:version=101"); - Version::Libressl - } else { -@@ -239,7 +244,7 @@ fn version_error() -> ! { +@@ -244,7 +247,7 @@ fn version_error() -> ! { " This crate is only compatible with OpenSSL 1.0.1 through 1.1.1, or LibreSSL 2.5 --through 2.9.0, but a different version of OpenSSL was found. The build is now aborting -+through 3.0.x, but a different version of OpenSSL was found. The build is now aborting +-through 3.0.x, but a different version of OpenSSL was found. The build is now aborting ++through 3.2.0, but a different version of OpenSSL was found. The build is now aborting due to this version mismatch. " diff --git a/lang/rust/files/patch-vendor_openssl-sys_src_crypto.rs b/lang/rust/files/patch-vendor_openssl-sys_src_crypto.rs deleted file mode 100644 index 0a4f3adb..00000000 --- a/lang/rust/files/patch-vendor_openssl-sys_src_crypto.rs +++ /dev/null @@ -1,26 +0,0 @@ ---- vendor/openssl-sys/src/crypto.rs.orig 2019-05-13 21:50:35 UTC -+++ vendor/openssl-sys/src/crypto.rs -@@ -15,7 +15,13 @@ cfg_if! { - if #[cfg(ossl110)] { - pub const CRYPTO_EX_INDEX_SSL: c_int = 0; - pub const CRYPTO_EX_INDEX_SSL_CTX: c_int = 1; -- -+ } else if #[cfg(libressl)] { -+ pub const CRYPTO_EX_INDEX_SSL: c_int = 1; -+ pub const CRYPTO_EX_INDEX_SSL_CTX: c_int = 2; -+ } -+} -+cfg_if! { -+ if #[cfg(any(ossl110, libressl271))] { - extern "C" { - pub fn OpenSSL_version_num() -> c_ulong; - pub fn OpenSSL_version(key: c_int) -> *const c_char; -@@ -64,7 +70,7 @@ pub type CRYPTO_EX_free = unsafe extern "C" fn( - argp: *mut c_void, - ); - extern "C" { -- #[cfg(ossl110)] -+ #[cfg(any(ossl110, libressl))] - pub fn CRYPTO_get_ex_new_index( - class_index: c_int, - argl: c_long, diff --git a/lang/rust/files/patch-vendor_openssl-sys_src_ssl.rs b/lang/rust/files/patch-vendor_openssl-sys_src_ssl.rs deleted file mode 100644 index e54f58f9..00000000 --- a/lang/rust/files/patch-vendor_openssl-sys_src_ssl.rs +++ /dev/null @@ -1,11 +0,0 @@ ---- vendor/openssl-sys/src/ssl.rs.orig 2019-11-04 17:34:46 UTC -+++ vendor/openssl-sys/src/ssl.rs -@@ -1057,7 +1057,7 @@ extern "C" { - } - - cfg_if! { -- if #[cfg(ossl110)] { -+ if #[cfg(any(ossl110, libressl291))] { - extern "C" { - pub fn TLS_method() -> *const SSL_METHOD; - diff --git a/lang/rust/files/patch-vendor_openssl_build.rs b/lang/rust/files/patch-vendor_openssl_build.rs deleted file mode 100644 index 30793f18..00000000 --- a/lang/rust/files/patch-vendor_openssl_build.rs +++ /dev/null @@ -1,23 +0,0 @@ ---- vendor/openssl/build.rs.orig 2019-05-13 21:50:34 UTC -+++ vendor/openssl/build.rs -@@ -46,12 +46,20 @@ fn main() { - println!("cargo:rustc-cfg=libressl270"); - } - -+ if version >= 0x2_07_01_00_0 { -+ println!("cargo:rustc-cfg=libressl271"); -+ } -+ - if version >= 0x2_07_03_00_0 { - println!("cargo:rustc-cfg=libressl273"); - } - - if version >= 0x2_08_00_00_0 { - println!("cargo:rustc-cfg=libressl280"); -+ } -+ -+ if version >= 0x2_09_01_00_0 { -+ println!("cargo:rustc-cfg=libressl291"); - } - } - } diff --git a/lang/rust/files/patch-vendor_openssl_src_ssl_mod.rs b/lang/rust/files/patch-vendor_openssl_src_ssl_mod.rs deleted file mode 100644 index f0b6ac7f..00000000 --- a/lang/rust/files/patch-vendor_openssl_src_ssl_mod.rs +++ /dev/null @@ -1,28 +0,0 @@ ---- vendor/openssl/src/ssl/mod.rs.orig 2019-05-13 21:50:34 UTC -+++ vendor/openssl/src/ssl/mod.rs -@@ -3690,9 +3690,14 @@ cfg_if! { - } - - cfg_if! { -- if #[cfg(ossl110)] { -+ if #[cfg(any(ossl110, libressl291))] { - use ffi::{TLS_method, DTLS_method}; -- -+ } else { -+ use ffi::{SSLv23_method as TLS_method, DTLSv1_method as DTLS_method}; -+ } -+} -+cfg_if! { -+ if #[cfg(ossl110)] { - unsafe fn get_new_idx(f: ffi::CRYPTO_EX_free) -> c_int { - ffi::CRYPTO_get_ex_new_index( - ffi::CRYPTO_EX_INDEX_SSL_CTX, -@@ -3715,8 +3720,6 @@ cfg_if! { - ) - } - } else { -- use ffi::{SSLv23_method as TLS_method, DTLSv1_method as DTLS_method}; -- - unsafe fn get_new_idx(f: ffi::CRYPTO_EX_free) -> c_int { - ffi::SSL_CTX_get_ex_new_index(0, ptr::null_mut(), None, None, Some(f)) - } diff --git a/lang/rust/files/patch-vendor_openssl_src_version.rs b/lang/rust/files/patch-vendor_openssl_src_version.rs deleted file mode 100644 index 2d92dd6d..00000000 --- a/lang/rust/files/patch-vendor_openssl_src_version.rs +++ /dev/null @@ -1,11 +0,0 @@ ---- vendor/openssl/src/version.rs.orig 2019-05-13 21:50:34 UTC -+++ vendor/openssl/src/version.rs -@@ -14,7 +14,7 @@ - use std::ffi::CStr; - - cfg_if! { -- if #[cfg(ossl110)] { -+ if #[cfg(any(ossl110, libressl271))] { - use ffi::{ - OPENSSL_VERSION, OPENSSL_CFLAGS, OPENSSL_BUILT_ON, OPENSSL_PLATFORM, OPENSSL_DIR, - OpenSSL_version_num, OpenSSL_version, diff --git a/lang/rust/files/powerpc64-elfv1/patch-src_librustc__llvm_build.rs b/lang/rust/files/powerpc64-elfv1/patch-src_librustc__llvm_build.rs index db32de43..7b71799f 100644 --- a/lang/rust/files/powerpc64-elfv1/patch-src_librustc__llvm_build.rs +++ b/lang/rust/files/powerpc64-elfv1/patch-src_librustc__llvm_build.rs @@ -1,12 +1,16 @@ ---- src/librustc_llvm/build.rs.orig 2019-11-04 15:45:21 UTC +--- src/librustc_llvm/build.rs.orig 2019-12-16 15:38:05 UTC +++ src/librustc_llvm/build.rs -@@ -273,7 +273,10 @@ fn main() { +@@ -273,7 +273,14 @@ fn main() { }; // C++ runtime library - if !target.contains("msvc") { + if target == "powerpc64-unknown-freebsd" { -+ println!("cargo:rustc-link-search=native=/usr/local/lib/%CC%"); ++ if is_crossed { ++ println!("cargo:rustc-link-search=native=%WRKDIR%/usr/local/lib/%CC%"); ++ } else { ++ println!("cargo:rustc-link-search=native=/usr/local/lib/%CC%"); ++ } + println!("cargo:rustc-link-lib=static=stdc++"); + } else if !target.contains("msvc") { if let Some(s) = llvm_static_stdcpp { diff --git a/lang/rust/files/powerpc64-elfv2/patch-src_librustc__target_abi_call_powerpc64.rs b/lang/rust/files/powerpc64-elfv2/patch-src_librustc__target_abi_call_powerpc64.rs index bc48318f..fb4f9c16 100644 --- a/lang/rust/files/powerpc64-elfv2/patch-src_librustc__target_abi_call_powerpc64.rs +++ b/lang/rust/files/powerpc64-elfv2/patch-src_librustc__target_abi_call_powerpc64.rs @@ -1,11 +1,11 @@ ---- src/librustc_target/abi/call/powerpc64.rs.orig 2019-09-23 21:15:52 UTC +--- src/librustc_target/abi/call/powerpc64.rs.orig 2020-03-09 22:11:17 UTC +++ src/librustc_target/abi/call/powerpc64.rs -@@ -128,7 +128,7 @@ pub fn compute_abi_info<'a, Ty, C>(cx: &C, fty: &mut F +@@ -123,7 +123,7 @@ where ELFv2 } else { match cx.data_layout().endian { - Endian::Big => ELFv1, + Endian::Big => ELFv2, - Endian::Little => ELFv2 + Endian::Little => ELFv2, } };