Index: head/lang/rust/Makefile =================================================================== --- head/lang/rust/Makefile (revision 539540) +++ head/lang/rust/Makefile (revision 539541) @@ -1,245 +1,241 @@ # Created by: Jyun-Yan You # $FreeBSD$ PORTNAME= rust -PORTVERSION?= 1.44.0 +PORTVERSION?= 1.44.1 PORTREVISION?= 0 CATEGORIES= lang MASTER_SITES= https://static.rust-lang.org/dist/:src \ LOCAL/tobik/rust:bootstrap \ https://static.rust-lang.org/dist/:bootstrap DISTNAME?= ${PORTNAME}c-${PORTVERSION}-src DISTFILES?= ${NIGHTLY_DATE:D${NIGHTLY_DATE}/}${DISTNAME}${EXTRACT_SUFX}:src \ ${_RUSTC_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:bootstrap \ ${_RUST_STD_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:bootstrap \ ${_CARGO_BOOTSTRAP}${BOOTSTRAPS_SUFFIX}${EXTRACT_SUFX}:bootstrap DIST_SUBDIR?= rust MAINTAINER= rust@FreeBSD.org COMMENT= Language with a focus on memory safety and concurrency LICENSE= APACHE20 MIT LICENSE_COMB= dual LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE-APACHE LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-MIT IGNORE_FreeBSD_11_powerpc64= is missing a bootstrap for FreeBSD 11.x powerpc64 ONLY_FOR_ARCHS?= aarch64 amd64 armv6 armv7 i386 powerpc64 ONLY_FOR_ARCHS_REASON?= requires prebuilt bootstrap compiler BUILD_DEPENDS= cmake:devel/cmake \ libgit2>=1.0.0:devel/libgit2 .if defined(NIGHTLY_DATE) BUILD_DEPENDS+= ninja:devel/ninja .endif LIB_DEPENDS= libcurl.so:ftp/curl \ libgit2.so:devel/libgit2 \ libssh2.so:security/libssh2 USES= pkgconfig python:3.3+,build ssl tar:xz MAKE_ENV= LIBGIT2_SYS_USE_PKG_CONFIG=1 \ LIBSSH2_SYS_USE_PKG_CONFIG=1 \ OPENSSL_DIR="${OPENSSLBASE}" \ RUST_BACKTRACE=1 TEST_ENV= ${MAKE_ENV} \ ALLOW_NONZERO_RLIMIT_CORE=1 CONFLICTS_INSTALL?= rust-nightly OPTIONS_DEFINE= DOCS GDB SOURCES WASM OPTIONS_DEFAULT= SOURCES WASM GDB_DESC= Install ports gdb (necessary for debugging rust programs) SOURCES_DESC= Install source files WASM_DESC= Build the WebAssembly target (wasm32-unknown-unknown) DOCS_VARS= _RUST_BUILD_DOCS=true DOCS_VARS_OFF= _RUST_BUILD_DOCS=false GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb WASM_VARS= _RUST_BUILD_WASM=true \ _RUST_TARGETS+=wasm32-unknown-unknown WASM_VARS_OFF= _RUST_BUILD_WASM=false # See WRKSRC/src/stage0.txt for the date and version values. BOOTSTRAPS_DATE?= 2020-05-07 RUST_BOOTSTRAP_VERSION?= 1.43.1 CARGO_BOOTSTRAP_VERSION?= 0.44.0 BOOTSTRAPS_SUFFIX?= ${BOOTSTRAPS_SUFFIX_${ARCH}} BOOTSTRAPS_SUFFIX_powerpc64?= -${PPC_ABI:tl} 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} _RUST_TARGETS= ${_RUST_TARGET} _RUSTC_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rustc-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${_RUST_TARGET} _RUST_STD_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/rust-std-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${_RUST_TARGET} _CARGO_BOOTSTRAP= ${BOOTSTRAPS_DATE_${ARCH}:U${BOOTSTRAPS_DATE}}/cargo-${CARGO_BOOTSTRAP_VERSION_${ARCH}:U${CARGO_BOOTSTRAP_VERSION}}-${_RUST_TARGET} .include .if exists(${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX}) EXTRA_PATCHES+= ${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX} .endif .if ${ARCH} == powerpc64 # The bootstrap is hardcoded to use gcc9 # but we can build with a newer or older compiler as provided by USE_GCC=yes BUILD_DEPENDS+= gcc9:lang/gcc9 USE_GCC= yes .endif .if ${ARCH} == aarch64 && ${OSVERSION} < 1200502 IGNORE= fails to run due to a bug in rtld, update to 12-STABLE r342847 or 13-CURRENT r342113 .endif .ifdef QEMU_EMULATING IGNORE= fails to build with qemu-user-static .endif post-patch: @${REINPLACE_CMD} 's,gdb,${LOCALBASE}/bin/gdb,' ${WRKSRC}/src/etc/rust-gdb .if defined(NIGHTLY_DATE) @${REINPLACE_CMD} '/^rustfmt:/d' ${WRKSRC}/src/stage0.txt .endif .if ${ARCH} == powerpc64 # Starting with 13.0 powerpc64 is ELFv2 while 12.0 is ELFv1. Pass the correct LLVM target triple. @${REINPLACE_CMD} 's,powerpc64-unknown-freebsd,powerpc64-unknown-freebsd${OSREL},' \ ${WRKSRC}/src/librustc_target/spec/powerpc64_unknown_freebsd.rs .endif # Disable vendor checksums @${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \ ${CARGO_VENDOR_DIR}/*/.cargo-checksum.json post-patch-SOURCES-off: # Mimic tools in config.toml with just src excluded @${REINPLACE_CMD} 's,config.tools.*"src".*,false;,' \ ${WRKSRC}/src/bootstrap/install.rs do-configure: # 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=${_RUST_BUILD_DOCS}' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'verbose=2' >> ${WRKSRC}/config.toml .if defined(NIGHTLY_DATE) @${ECHO_CMD} 'profiler=true' >> ${WRKSRC}/config.toml .endif @${ECHO_CMD} 'target=[${_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="${PKGNAMESUFFIX:Ustable:S/^-//}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'verbose-tests=true' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'lld=${_RUST_BUILD_WASM}' >> ${WRKSRC}/config.toml -.if ${ARCH} == powerpc64 -# XXX: crashes without this? - @${ECHO_CMD} 'debuginfo-level-std=1' >> ${WRKSRC}/config.toml -.endif @${ECHO_CMD} '[llvm]' >> ${WRKSRC}/config.toml .if defined(WITH_CCACHE_BUILD) && !defined(NO_CCACHE) @${ECHO_CMD} 'ccache="${CCACHE_BIN}"' >> ${WRKSRC}/config.toml .else @${ECHO_CMD} 'ccache=false' >> ${WRKSRC}/config.toml .endif .if defined(NIGHTLY_DATE) @${ECHO_CMD} 'ninja=true' >> ${WRKSRC}/config.toml .endif .if ${ARCH} == armv6 # fails to link with base ld.bfd: rustc_codegen_llvm.e2557spx-cgu.11:(.text._ZN89_$LT$rustc_target..abi..call..CastTarget$u20$as$u20$rustc_codegen_llvm..abi..LlvmType$GT$9llvm_type17h1296210ab461fc57E+0x54): relocation truncated to fit: R_ARM_CALL against symbol `__aeabi_uldivmod' defined in .text.__aeabi_uldivmod section in /tmp/rustcdnGbao/libcompiler_builtins-ee65b414e4115a8f.rlib(compiler_builtins-ee65b414e4115a8f.compiler_builtins.ay8p39ey-cgu.13.rcgu.o) @${PRINTF} '#!/bin/sh\nexec ${CC} -fuse-ld=lld "$$@"' > ${WRKDIR}/cc-wrapper @${CHMOD} +x ${WRKDIR}/cc-wrapper .endif .for _target in ${_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 .if ${ARCH} == armv6 @${ECHO_CMD} 'linker="${WRKDIR}/cc-wrapper"' >> ${WRKSRC}/config.toml .else @${ECHO_CMD} 'linker="${CC}"' >> ${WRKSRC}/config.toml .endif .endfor @${ECHO_CMD} '[dist]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'src-tarball=false' >> ${WRKSRC}/config.toml .if defined(NIGHTLY_DATE) # Don't abort if optional tools fail to build @${ECHO_CMD} 'missing-tools=true' >> ${WRKSRC}/config.toml .endif @${REINPLACE_CMD} 's,%CC%,${CC},g' \ ${WRKSRC}/src/librustc_llvm/build.rs \ ${WRKSRC}/src/bootstrap/native.rs do-build: @cd ${WRKSRC} && \ ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} x.py build --jobs=${MAKE_JOBS_NUMBER} do-install: # DESTDIR not in MAKE_ENV as it would cause the bundled LLVM to be # staged into it during do-build. @cd ${WRKSRC} && \ ${SETENV} ${MAKE_ENV} DESTDIR=${STAGEDIR} ${PYTHON_CMD} \ x.py install --jobs=${MAKE_JOBS_NUMBER} # We autogenerate the plist file. 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 cannot know their filename in advance. @${RM} -r ${STAGEDIR}${DOCSDIR}/*.old \ ${STAGEDIR}${DOCSDIR}/html/.lock \ ${STAGEDIR}${DOCSDIR}/html/.stamp \ ${STAGEDIR}${PREFIX}/lib/rustlib/install.log \ ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-* \ ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh @${FIND} ${STAGEDIR}${PREFIX}/bin ${STAGEDIR}${PREFIX}/lib -exec ${FILE} -i {} + | \ ${AWK} -F: '/executable|sharedlib/ { print $$1 }' | ${XARGS} ${STRIP_CMD} @${FIND} ${STAGEDIR}${PREFIX} -not -type d | \ ${SED} -E -e 's,^${STAGEDIR}${PREFIX}/,,' \ -e 's,(share/man/man[1-9]/.*\.[0-9]),\1.gz,' >> ${TMPPLIST} post-install-SOURCES-on: # Silence stage-qa warnings by sanitizing permissions on sources @${FIND} ${STAGEDIR}${PREFIX}/lib/rustlib/src -type f -exec ${CHMOD} \ ${SHAREMODE} {} + # Note that make test does not work when rust is already installed. do-test: @cd ${WRKSRC} && \ ${SETENV} ${TEST_ENV} ${PYTHON_CMD} x.py test --jobs=${MAKE_JOBS_NUMBER} .if !defined(_RUST_MAKESUM_GUARD) makesum: ${MAKE} -D_RUST_MAKESUM_GUARD makesum ARCH=${ONLY_FOR_ARCHS:O:[1]} DISTINFO_FILE=${DISTINFO_FILE}.tmp .for arch in ${ONLY_FOR_ARCHS:O:[2..-1]} ${MAKE} -D_RUST_MAKESUM_GUARD makesum PPC_ABI=ELFv1 ARCH=${arch} DISTINFO_FILE=${DISTINFO_FILE}.${arch} ${SED} 1d ${DISTINFO_FILE}.${arch} >> ${DISTINFO_FILE}.tmp ${RM} ${DISTINFO_FILE}.${arch} .endfor .if ${ONLY_FOR_ARCHS:Mpowerpc64} ${MAKE} -D_RUST_MAKESUM_GUARD makesum PPC_ABI=ELFv2 ARCH=powerpc64 DISTINFO_FILE=${DISTINFO_FILE}.powerpc64-elfv2 ${SED} 1d ${DISTINFO_FILE}.powerpc64-elfv2 >> ${DISTINFO_FILE}.tmp ${RM} ${DISTINFO_FILE}.powerpc64-elfv2 .endif ${AWK} '!seen[$$0]++' ${DISTINFO_FILE}.tmp > ${DISTINFO_FILE} ${RM} ${DISTINFO_FILE}.tmp .endif .include Index: head/lang/rust/distinfo =================================================================== --- head/lang/rust/distinfo (revision 539540) +++ head/lang/rust/distinfo (revision 539541) @@ -1,45 +1,45 @@ -TIMESTAMP = 1591048305 -SHA256 (rust/rustc-1.44.0-src.tar.xz) = b32fa7d6bd6ff9286aab2aa7ca696d1da921614cefc10f617aef68d9bce9118a -SIZE (rust/rustc-1.44.0-src.tar.xz) = 94754392 +TIMESTAMP = 1592451352 +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-aarch64-unknown-freebsd.tar.xz) = bf65d73547f9a1445ea8177fc452dddab8bbcfff8ad17d8292903ba4fc65d1a6 SIZE (rust/2020-05-07/rustc-1.43.1-aarch64-unknown-freebsd.tar.xz) = 27175484 SHA256 (rust/2020-05-07/rust-std-1.43.1-aarch64-unknown-freebsd.tar.xz) = d0f8413767123d9630bb2648fe15e8a2a05382cb7dcbe3c332223eb1e4a788a4 SIZE (rust/2020-05-07/rust-std-1.43.1-aarch64-unknown-freebsd.tar.xz) = 13267024 SHA256 (rust/2020-05-07/cargo-0.44.0-aarch64-unknown-freebsd.tar.xz) = 8f5852b0fb3a726152468e48bfb3f95d4441493901325c739dba5d7a444d3e2b SIZE (rust/2020-05-07/cargo-0.44.0-aarch64-unknown-freebsd.tar.xz) = 3891232 SHA256 (rust/2020-05-07/rustc-1.43.1-x86_64-unknown-freebsd.tar.xz) = 7d12495c00e2e6186a2ca26b13b41a90b1444aa379313a816f83bee31d2f6454 SIZE (rust/2020-05-07/rustc-1.43.1-x86_64-unknown-freebsd.tar.xz) = 29803884 SHA256 (rust/2020-05-07/rust-std-1.43.1-x86_64-unknown-freebsd.tar.xz) = a4610e7a07792a382c01511d7401f8bc4404a59e8529659f770e96734ef1ee71 SIZE (rust/2020-05-07/rust-std-1.43.1-x86_64-unknown-freebsd.tar.xz) = 13797152 SHA256 (rust/2020-05-07/cargo-0.44.0-x86_64-unknown-freebsd.tar.xz) = c70f874ccf4ac92b5138d13ef374429702ace98fa01b621dc1b308e73adead05 SIZE (rust/2020-05-07/cargo-0.44.0-x86_64-unknown-freebsd.tar.xz) = 4632952 SHA256 (rust/2020-05-07/rustc-1.43.1-armv6-unknown-freebsd.tar.xz) = 360495e0722e16ea29076d21399fd65f65e787b419ea3069d711aa2f4fcb4098 SIZE (rust/2020-05-07/rustc-1.43.1-armv6-unknown-freebsd.tar.xz) = 28690648 SHA256 (rust/2020-05-07/rust-std-1.43.1-armv6-unknown-freebsd.tar.xz) = f400e2a4b001a3a9e505c61728cfe1274f2e68f60c455f8aa72159c814af04e2 SIZE (rust/2020-05-07/rust-std-1.43.1-armv6-unknown-freebsd.tar.xz) = 13260336 SHA256 (rust/2020-05-07/cargo-0.44.0-armv6-unknown-freebsd.tar.xz) = bac4421f5237aa743fc5c416298344057a550d4563d622d9ece2c715075308f8 SIZE (rust/2020-05-07/cargo-0.44.0-armv6-unknown-freebsd.tar.xz) = 3980908 SHA256 (rust/2020-05-07/rustc-1.43.1-armv7-unknown-freebsd.tar.xz) = 6d56e3c9517a3798b30e90735eaecea41e2a1677549f9aee31550ab095b0d88e SIZE (rust/2020-05-07/rustc-1.43.1-armv7-unknown-freebsd.tar.xz) = 28783628 SHA256 (rust/2020-05-07/rust-std-1.43.1-armv7-unknown-freebsd.tar.xz) = 8363fcce57a0aebecd2e0b18fef5701a9a55f082698eef282dc45c43c0dee106 SIZE (rust/2020-05-07/rust-std-1.43.1-armv7-unknown-freebsd.tar.xz) = 13185812 SHA256 (rust/2020-05-07/cargo-0.44.0-armv7-unknown-freebsd.tar.xz) = 9bd79b8da7b4eef717f4773e0d282b158c783d0545b35437060726634e917079 SIZE (rust/2020-05-07/cargo-0.44.0-armv7-unknown-freebsd.tar.xz) = 3975184 SHA256 (rust/2020-05-07/rustc-1.43.1-i686-unknown-freebsd.tar.xz) = 3ec5c5a58f55f62c2225d79839c66d85ec1e036df7f348d7fbc5fd8742ee408e SIZE (rust/2020-05-07/rustc-1.43.1-i686-unknown-freebsd.tar.xz) = 30358564 SHA256 (rust/2020-05-07/rust-std-1.43.1-i686-unknown-freebsd.tar.xz) = 0484f94f7c3da65ab04c81d0da48c278c6432d001e5eaf5cd47f3c20e505c247 SIZE (rust/2020-05-07/rust-std-1.43.1-i686-unknown-freebsd.tar.xz) = 13793004 SHA256 (rust/2020-05-07/cargo-0.44.0-i686-unknown-freebsd.tar.xz) = d6cdaf9f3106a45eb0b561be88450dd5d142ce78e3507d59bdf6f0ce0efa3313 SIZE (rust/2020-05-07/cargo-0.44.0-i686-unknown-freebsd.tar.xz) = 4550164 SHA256 (rust/2020-05-07/rustc-1.43.1-powerpc64-unknown-freebsd-elfv1.tar.xz) = 0d3dd6720be8ce31ef79ea20cc6dab432e4eca364a44b6bb27ff9cefea1d6966 SIZE (rust/2020-05-07/rustc-1.43.1-powerpc64-unknown-freebsd-elfv1.tar.xz) = 33209688 SHA256 (rust/2020-05-07/rust-std-1.43.1-powerpc64-unknown-freebsd-elfv1.tar.xz) = 7f48580ffcadb6de4347efe58e6e24485cdb996e58f99ae88a1b057e34bb6e43 SIZE (rust/2020-05-07/rust-std-1.43.1-powerpc64-unknown-freebsd-elfv1.tar.xz) = 13249040 SHA256 (rust/2020-05-07/cargo-0.44.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = ec9418790b1ba5f12fa0837779ebb75e43d8bf727ca4b7dad41e44f53af0ad35 SIZE (rust/2020-05-07/cargo-0.44.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 4530892 SHA256 (rust/2020-05-07/rustc-1.43.1-powerpc64-unknown-freebsd-elfv2.tar.xz) = 56c0a38209aca776f9836a414d87672e86213dc431aa441e59b58e52e86ebe17 SIZE (rust/2020-05-07/rustc-1.43.1-powerpc64-unknown-freebsd-elfv2.tar.xz) = 27568464 SHA256 (rust/2020-05-07/rust-std-1.43.1-powerpc64-unknown-freebsd-elfv2.tar.xz) = 54fd8ebc85460db5b822b56082d22ae5343837f766d4f64c8a7885c242e24787 SIZE (rust/2020-05-07/rust-std-1.43.1-powerpc64-unknown-freebsd-elfv2.tar.xz) = 13226424 SHA256 (rust/2020-05-07/cargo-0.44.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = e2a857b8292181e30ef98384a16e432246780f7aab7c7ee7f4634bc9da015661 SIZE (rust/2020-05-07/cargo-0.44.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 4227604 Index: head/lang/rust/files/patch-src_llvm-project_llvm_lib_Transforms_InstCombine_InstCombineCasts.cpp =================================================================== --- head/lang/rust/files/patch-src_llvm-project_llvm_lib_Transforms_InstCombine_InstCombineCasts.cpp (nonexistent) +++ head/lang/rust/files/patch-src_llvm-project_llvm_lib_Transforms_InstCombine_InstCombineCasts.cpp (revision 539541) @@ -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; + } + Property changes on: head/lang/rust/files/patch-src_llvm-project_llvm_lib_Transforms_InstCombine_InstCombineCasts.cpp ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/lang/rust/files/powerpc64-elfv1/patch-src_librustc__mir_dataflow_framework_engine.rs =================================================================== --- head/lang/rust/files/powerpc64-elfv1/patch-src_librustc__mir_dataflow_framework_engine.rs (revision 539540) +++ head/lang/rust/files/powerpc64-elfv1/patch-src_librustc__mir_dataflow_framework_engine.rs (nonexistent) @@ -1,78 +0,0 @@ ---- src/librustc_mir/dataflow/framework/engine.rs.orig 2020-06-07 10:10:36 UTC -+++ src/librustc_mir/dataflow/framework/engine.rs -@@ -243,27 +243,24 @@ where - } - - SwitchInt { ref targets, ref values, ref discr, .. } => { -- let Engine { tcx, body, .. } = *self; -- let enum_ = discr -- .place() -- .and_then(|discr| switch_on_enum_discriminant(tcx, body, bb_data, discr)); -- match enum_ { -- // If this is a switch on an enum discriminant, a custom effect may be applied -- // along each outgoing edge. -- Some((enum_place, enum_def)) => { -+ // If this is a switch on an enum discriminant, a custom effect may be applied -+ // along each outgoing edge. -+ if let Some(place) = discr.place() { -+ let enum_def = switch_on_enum_discriminant(self.tcx, self.body, bb_data, place); -+ if let Some(enum_def) = enum_def { - self.propagate_bits_into_enum_discriminant_switch_successors( -- in_out, bb, enum_def, enum_place, dirty_list, &*values, &*targets, -+ in_out, bb, enum_def, place, dirty_list, &*values, &*targets, - ); -- } - -- // Otherwise, it's just a normal `SwitchInt`, and every successor sees the same -- // exit state. -- None => { -- for target in targets.iter().copied() { -- self.propagate_bits_into_entry_set_for(&in_out, target, dirty_list); -- } -+ return; - } - } -+ -+ // Otherwise, it's just a normal `SwitchInt`, and every successor sees the same -+ // exit state. -+ for target in targets.iter().copied() { -+ self.propagate_bits_into_entry_set_for(&in_out, target, dirty_list); -+ } - } - - Call { cleanup, ref destination, ref func, ref args, .. } => { -@@ -349,27 +346,22 @@ where - } - } - --/// Inspect a `SwitchInt`-terminated basic block to see if the condition of that `SwitchInt` is --/// an enum discriminant. --/// --/// We expect such blocks to have a call to `discriminant` as their last statement like so: --/// _42 = discriminant(_1) -+/// Look at the last statement of a block that ends with to see if it is an assignment of an enum -+/// discriminant to the local that determines the target of a `SwitchInt` like so: -+/// _42 = discriminant(..) - /// SwitchInt(_42, ..) --/// --/// If the basic block matches this pattern, this function returns the place corresponding to the --/// enum (`_1` in the example above) as well as the `AdtDef` of that enum. - fn switch_on_enum_discriminant( - tcx: TyCtxt<'tcx>, -- body: &'mir mir::Body<'tcx>, -- block: &'mir mir::BasicBlockData<'tcx>, -+ body: &mir::Body<'tcx>, -+ block: &mir::BasicBlockData<'tcx>, - switch_on: mir::Place<'tcx>, --) -> Option<(mir::Place<'tcx>, &'tcx ty::AdtDef)> { -+) -> Option<&'tcx ty::AdtDef> { - match block.statements.last().map(|stmt| &stmt.kind) { - Some(mir::StatementKind::Assign(box (lhs, mir::Rvalue::Discriminant(discriminated)))) - if *lhs == switch_on => - { - match &discriminated.ty(body, tcx).ty.kind { -- ty::Adt(def, _) => Some((*discriminated, def)), -+ ty::Adt(def, _) => Some(def), - - // `Rvalue::Discriminant` is also used to get the active yield point for a - // generator, but we do not need edge-specific effects in that case. This may Property changes on: head/lang/rust/files/powerpc64-elfv1/patch-src_librustc__mir_dataflow_framework_engine.rs ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/lang/rust/files/powerpc64-elfv2/patch-src_librustc__mir_dataflow_framework_engine.rs =================================================================== --- head/lang/rust/files/powerpc64-elfv2/patch-src_librustc__mir_dataflow_framework_engine.rs (revision 539540) +++ head/lang/rust/files/powerpc64-elfv2/patch-src_librustc__mir_dataflow_framework_engine.rs (nonexistent) @@ -1,78 +0,0 @@ ---- src/librustc_mir/dataflow/framework/engine.rs.orig 2020-06-07 10:10:36 UTC -+++ src/librustc_mir/dataflow/framework/engine.rs -@@ -243,27 +243,24 @@ where - } - - SwitchInt { ref targets, ref values, ref discr, .. } => { -- let Engine { tcx, body, .. } = *self; -- let enum_ = discr -- .place() -- .and_then(|discr| switch_on_enum_discriminant(tcx, body, bb_data, discr)); -- match enum_ { -- // If this is a switch on an enum discriminant, a custom effect may be applied -- // along each outgoing edge. -- Some((enum_place, enum_def)) => { -+ // If this is a switch on an enum discriminant, a custom effect may be applied -+ // along each outgoing edge. -+ if let Some(place) = discr.place() { -+ let enum_def = switch_on_enum_discriminant(self.tcx, self.body, bb_data, place); -+ if let Some(enum_def) = enum_def { - self.propagate_bits_into_enum_discriminant_switch_successors( -- in_out, bb, enum_def, enum_place, dirty_list, &*values, &*targets, -+ in_out, bb, enum_def, place, dirty_list, &*values, &*targets, - ); -- } - -- // Otherwise, it's just a normal `SwitchInt`, and every successor sees the same -- // exit state. -- None => { -- for target in targets.iter().copied() { -- self.propagate_bits_into_entry_set_for(&in_out, target, dirty_list); -- } -+ return; - } - } -+ -+ // Otherwise, it's just a normal `SwitchInt`, and every successor sees the same -+ // exit state. -+ for target in targets.iter().copied() { -+ self.propagate_bits_into_entry_set_for(&in_out, target, dirty_list); -+ } - } - - Call { cleanup, ref destination, ref func, ref args, .. } => { -@@ -349,27 +346,22 @@ where - } - } - --/// Inspect a `SwitchInt`-terminated basic block to see if the condition of that `SwitchInt` is --/// an enum discriminant. --/// --/// We expect such blocks to have a call to `discriminant` as their last statement like so: --/// _42 = discriminant(_1) -+/// Look at the last statement of a block that ends with to see if it is an assignment of an enum -+/// discriminant to the local that determines the target of a `SwitchInt` like so: -+/// _42 = discriminant(..) - /// SwitchInt(_42, ..) --/// --/// If the basic block matches this pattern, this function returns the place corresponding to the --/// enum (`_1` in the example above) as well as the `AdtDef` of that enum. - fn switch_on_enum_discriminant( - tcx: TyCtxt<'tcx>, -- body: &'mir mir::Body<'tcx>, -- block: &'mir mir::BasicBlockData<'tcx>, -+ body: &mir::Body<'tcx>, -+ block: &mir::BasicBlockData<'tcx>, - switch_on: mir::Place<'tcx>, --) -> Option<(mir::Place<'tcx>, &'tcx ty::AdtDef)> { -+) -> Option<&'tcx ty::AdtDef> { - match block.statements.last().map(|stmt| &stmt.kind) { - Some(mir::StatementKind::Assign(box (lhs, mir::Rvalue::Discriminant(discriminated)))) - if *lhs == switch_on => - { - match &discriminated.ty(body, tcx).ty.kind { -- ty::Adt(def, _) => Some((*discriminated, def)), -+ ty::Adt(def, _) => Some(def), - - // `Rvalue::Discriminant` is also used to get the active yield point for a - // generator, but we do not need edge-specific effects in that case. This may Property changes on: head/lang/rust/files/powerpc64-elfv2/patch-src_librustc__mir_dataflow_framework_engine.rs ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/lang/rust-bootstrap/Makefile =================================================================== --- head/lang/rust-bootstrap/Makefile (revision 539540) +++ head/lang/rust-bootstrap/Makefile (revision 539541) @@ -1,232 +1,231 @@ # $FreeBSD$ PORTNAME= rust -PORTVERSION= 1.44.0 -PORTREVISION= 1 +PORTVERSION= 1.44.1 CATEGORIES= lang MASTER_SITES= https://static.rust-lang.org/dist/:rust \ LOCAL/tobik:armbase \ LOCAL/tobik:base \ https://download.freebsd.org/ftp/${_RUST_FBSD_SUBDIR_${FLAVOR}}/:base \ LOCAL/tobik:powerpc64_gcc # http://pkg.freebsd.org/FreeBSD:12:powerpc64/quarterly/All/gcc9-9.2.0.txz?dummy=/:powerpc64_gcc PKGNAMESUFFIX= -bootstrap DISTNAME= ${PORTNAME}c-${PORTVERSION}-src DISTFILES= rust/${DISTNAME}${EXTRACT_SUFX}:rust \ ${_RUST_FBSD_DIST_${FLAVOR}} MAINTAINER= rust@FreeBSD.org COMMENT= Create bootstrap compilers for building lang/rust LICENSE= APACHE20 MIT LICENSE_COMB= dual LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE-APACHE LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-MIT ONLY_FOR_ARCHS= amd64 ONLY_FOR_ARCHS_REASON= untested on other archs BUILD_DEPENDS= cmake:devel/cmake \ gmake:devel/gmake \ rust>=${PORTVERSION}:lang/rust FLAVORS= aarch64 amd64 armv6 armv7 i386 powerpc64_elfv1 powerpc64_elfv2 FLAVOR?= ${FLAVORS:[1]} aarch64_PKGNAMEPREFIX= aarch64- amd64_PKGNAMEPREFIX= amd64- armv6_PKGNAMEPREFIX= armv6- armv7_PKGNAMEPREFIX= armv7- i386_PKGNAMEPREFIX= i386- powerpc64_elfv1_PKGNAMEPREFIX= powerpc64-elfv1- powerpc64_elfv1_BUILD_DEPENDS= powerpc64-gcc9>0:devel/freebsd-gcc9@powerpc64 powerpc64_elfv2_PKGNAMEPREFIX= powerpc64-elfv2- USES= perl5 python:3.3+,build tar:xz .if ${FLAVOR} == powerpc64_elfv1 USE_GCC= 9 .endif # for openssl-src crate USE_PERL5= build PATCHDIR= ${.CURDIR}/../rust/files # Resulting packages are not specific to amd64 NO_ARCH= yes _RUST_FBSD_DIST_aarch64= FreeBSD-${_RUST_FBSD_VER}-arm64${EXTRACT_SUFX}:base _RUST_FBSD_DIST_amd64= FreeBSD-${_RUST_FBSD_VER}-amd64${EXTRACT_SUFX}:base # base.txz for armv* created from WANDBOARD images as there seem # to be no generic base.txz for it. _RUST_FBSD_DIST_armv6= FreeBSD-${_RUST_FBSD_VER}-arm-armv6${EXTRACT_SUFX}:armbase _RUST_FBSD_DIST_armv7= FreeBSD-${_RUST_FBSD_VER}-arm-armv7${EXTRACT_SUFX}:armbase _RUST_FBSD_DIST_i386= FreeBSD-${_RUST_FBSD_VER}-i386${EXTRACT_SUFX}:base _RUST_FBSD_DIST_powerpc64_elfv1= FreeBSD-${_RUST_FBSD_VER}-powerpc64-elfv1${EXTRACT_SUFX}:base \ FreeBSD-${_RUST_FBSD_VER}-powerpc64-elfv1-gcc9-9.2.0${EXTRACT_SUFX}:powerpc64_gcc _RUST_FBSD_DIST_powerpc64_elfv2= FreeBSD-${_RUST_FBSD_VER}-powerpc64-elfv2-r356261${EXTRACT_SUFX}:base _RUST_FBSD_VER= ${_RUST_FBSD_VER_${FLAVOR}:U11.3-RELEASE} _RUST_FBSD_VER_armv7= 12.1-RELEASE _RUST_FBSD_VER_powerpc64_elfv1= 12.1-RELEASE _RUST_FBSD_VER_powerpc64_elfv2= 13.0-CURRENT _RUST_FBSD_SUBDIR_aarch64= releases/arm64/${_RUST_FBSD_VER}/base.txz?dummy= _RUST_FBSD_SUBDIR_amd64= releases/amd64/${_RUST_FBSD_VER}/base.txz?dummy= _RUST_FBSD_SUBDIR_i386= releases/i386/${_RUST_FBSD_VER}/base.txz?dummy= _RUST_FBSD_SUBDIR_powerpc64_elfv1= releases/powerpc/powerpc64/${_RUST_FBSD_VER}/base.txz?dummy= _RUST_FBSD_SUBDIR_powerpc64_elfv2= snapshots/powerpc/powerpc64/${_RUST_FBSD_VER}/base.txz?dummy= _CARGO_VENDOR_DIR= ${WRKSRC}/vendor _RUST_ARCH_amd64= x86_64 _RUST_ARCH_i386= i686 _RUST_ARCH_powerpc64_elfv1= powerpc64 _RUST_ARCH_powerpc64_elfv2= powerpc64 _RUST_HOST= ${_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl} _RUST_TARGET= ${_RUST_ARCH_${FLAVOR}:U${FLAVOR}}-unknown-${OPSYS:tl} _RUST_LLVM_TARGET= ${_RUST_LLVM_TARGET_${FLAVOR}} _RUST_LLVM_TARGET_aarch64= AArch64 _RUST_LLVM_TARGET_amd64= X86 _RUST_LLVM_TARGET_armv6= ARM _RUST_LLVM_TARGET_armv7= ARM _RUST_LLVM_TARGET_i386= X86 _RUST_LLVM_TARGET_powerpc64_elfv1= PowerPC _RUST_LLVM_TARGET_powerpc64_elfv2= PowerPC _RUST_LLVM_TRIPLE= ${_RUST_LLVM_TRIPLE_${FLAVOR}:U${_RUST_TARGET}} _RUST_LLVM_TRIPLE_armv6= armv6-gnueabihf-freebsd _RUST_LLVM_TRIPLE_armv7= armv7-gnueabihf-freebsd .include .if ${OPSYS} != FreeBSD IGNORE= is only for FreeBSD .elif ${OSVERSION} < 1200502 IGNORE= will not build on 12.0 due to old toolchain; 11.x untested .endif .if exists(${PATCHDIR}/${FLAVOR:S/_/-/}) EXTRA_PATCHES+= ${PATCHDIR}/${FLAVOR:S/_/-/} .endif post-patch: # Disable vendor checksums @${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \ ${_CARGO_VENDOR_DIR}/*/.cargo-checksum.json .if ${FLAVOR:Mpowerpc64_*} @${REINPLACE_CMD} -e 's,powerpc64-unknown-freebsd,${_RUST_TARGET}${_RUST_FBSD_VER:S/-/ /:[1]},' \ ${WRKSRC}/src/librustc_target/spec/powerpc64_unknown_freebsd.rs .endif .if ${FLAVOR} == powerpc64_elfv1 @${REINPLACE_CMD} -e 's,"c++","stdc++",g' \ ${WRKSRC}/src/librustc_llvm/build.rs .endif @${REINPLACE_CMD} -e 's,%CC%,${CC},g' \ -e 's,%WRKDIR%,${WRKDIR},g' \ ${WRKSRC}/src/librustc_llvm/build.rs \ ${WRKSRC}/src/bootstrap/native.rs do-configure: # 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 @${ECHO_CMD} '[build]' > ${WRKSRC}/config.toml @${ECHO_CMD} 'vendor=true' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'extended=false' >> ${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} 'cargo-native-static=true' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cargo="${LOCALBASE}/bin/cargo"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'rustc="${LOCALBASE}/bin/rustc"' >> ${WRKSRC}/config.toml .if ${_RUST_HOST} != ${_RUST_TARGET} @${ECHO_CMD} 'host=["${_RUST_HOST}","${_RUST_TARGET}"]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'target=["${_RUST_TARGET}"]' >> ${WRKSRC}/config.toml .endif @${ECHO_CMD} '[rust]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'channel="stable"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'deny-warnings=false' >> ${WRKSRC}/config.toml @${ECHO_CMD} '[llvm]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'link-shared=false' >> ${WRKSRC}/config.toml .if ${FLAVOR} == powerpc64_elfv1 @${ECHO_CMD} 'static-libstdcpp=true' >> ${WRKSRC}/config.toml .endif .if defined(WITH_CCACHE_BUILD) && !defined(NO_CCACHE) @${ECHO_CMD} 'ccache="${CCACHE_BIN}"' >> ${WRKSRC}/config.toml .else @${ECHO_CMD} 'ccache=false' >> ${WRKSRC}/config.toml .endif # we need to make sure to always build llvm with X86 support to get a # host compiler that can build the host->target compiler @${ECHO_CMD} 'targets="${_RUST_LLVM_TARGET};X86"' >> ${WRKSRC}/config.toml @${ECHO_CMD} '[target.${_RUST_TARGET}]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cc="${WRKDIR}/${_RUST_TARGET}-cc"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cxx="${WRKDIR}/${_RUST_TARGET}-c++"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'linker="${WRKDIR}/${_RUST_TARGET}-cc"' >> ${WRKSRC}/config.toml .for _key _util in ar ${AR} ranlib ${RANLIB} @bin="$$(which ${_util})"; \ ${ECHO_CMD} "${_key}=\"$$bin\"" >> ${WRKSRC}/config.toml .endfor .if ${_RUST_HOST} != ${_RUST_TARGET} @${ECHO_CMD} '[target.${_RUST_HOST}]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cc="${CC}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cxx="${CXX}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'linker="${CC}"' >> ${WRKSRC}/config.toml .endif @${ECHO_CMD} '[dist]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'src-tarball=false' >> ${WRKSRC}/config.toml .if ${FLAVOR} == powerpc64_elfv1 @${RLN} ${WRKDIR}${LOCALBASE}/lib/gcc9/libstdc++.a ${WRKDIR}/usr/lib/libstdc++.a @${RLN} ${WRKDIR}${LOCALBASE}/lib/gcc9/libstdc++.a ${WRKDIR}/usr/lib/libc++.a @gcc="$$(${ECHO_CMD} ${LOCALBASE}/bin/${_RUST_TARGET}*[0-9]-gcc9)"; \ ${PRINTF} '#!/bin/sh\nexec %s --sysroot=${WRKDIR} -Wl,-rpath=${LOCALBASE}/lib/gcc9 -L${WRKDIR}${LOCALBASE}/lib/gcc9 "$$@"\n' "$${gcc}" \ > ${WRKDIR}/${_RUST_TARGET}-cc @gcc="$$(${ECHO_CMD} ${LOCALBASE}/bin/${_RUST_TARGET}*[0-9]-g++9)"; \ cxxinc="/$$(cd ${WRKDIR} && ${ECHO_CMD} ${LOCALBASE:S,^/,,}/lib/gcc9/include/c++/powerpc64-*)"; \ ${PRINTF} '#!/bin/sh\nexec %s --sysroot=${WRKDIR} -isystem=${LOCALBASE}/lib/gcc9/include/c++ -isystem=%s -Wl,-rpath=${LOCALBASE}/lib/gcc9 -L${WRKDIR}${LOCALBASE}/lib/gcc9 "$$@"\n' "$${gcc}" "$${cxxinc}" \ > ${WRKDIR}/${_RUST_TARGET}-c++ .elif ${FLAVOR} == powerpc64_elfv2 @${PRINTF} '#!/bin/sh\nexec ${CC} --sysroot=${WRKDIR} -mabi=elfv2 --target=${_RUST_LLVM_TRIPLE} "$$@"\n' \ > ${WRKDIR}/${_RUST_TARGET}-cc @${PRINTF} '#!/bin/sh\nexec ${CXX} --sysroot=${WRKDIR} -mabi=elfv2 --target=${_RUST_LLVM_TRIPLE} -stdlib=libc++ "$$@"\n' \ > ${WRKDIR}/${_RUST_TARGET}-c++ .else @${PRINTF} '#!/bin/sh\nexec ${CC} --sysroot=${WRKDIR} --target=${_RUST_LLVM_TRIPLE} "$$@"\n' \ > ${WRKDIR}/${_RUST_TARGET}-cc @${PRINTF} '#!/bin/sh\nexec ${CXX} --sysroot=${WRKDIR} --target=${_RUST_LLVM_TRIPLE} -stdlib=libc++ "$$@"\n' \ > ${WRKDIR}/${_RUST_TARGET}-c++ .endif @${CHMOD} +x ${WRKDIR}/${_RUST_TARGET}-c* # sanity check cross compilers. we cannot execute the result but # at least check that it can link a simple program before going further. @${PRINTF} '#include \nint main(){return printf("hello\\n");}' | ${WRKDIR}/${_RUST_TARGET}-cc -o ${WRKDIR}/test-c -xc - # produce some useful info for the build logs like what release/arch test-c is compiled for @cd ${WRKDIR} && ${FILE} test-c && ${READELF} -A test-c @${PRINTF} '#include \nint main(){std::cout<<"hello"<> ${TMPPLIST} .if !defined(_RUST_MAKESUM_GUARD) makesum: ${MAKE} -D_RUST_MAKESUM_GUARD makesum FLAVOR=${FLAVORS:O:[1]} DISTINFO_FILE=${DISTINFO_FILE}.tmp .for _flavor in ${FLAVORS:O:[2..-1]} ${MAKE} -D_RUST_MAKESUM_GUARD makesum FLAVOR=${_flavor} DISTINFO_FILE=${DISTINFO_FILE}.${_flavor} ${SED} 1d ${DISTINFO_FILE}.${_flavor} >> ${DISTINFO_FILE}.tmp ${RM} ${DISTINFO_FILE}.${_flavor} .endfor ${AWK} '!seen[$$0]++' ${DISTINFO_FILE}.tmp > ${DISTINFO_FILE} ${RM} ${DISTINFO_FILE}.tmp .endif .include RUN_DEPENDS:= ${RUN_DEPENDS:Ngcc*} Index: head/lang/rust-bootstrap/distinfo =================================================================== --- head/lang/rust-bootstrap/distinfo (revision 539540) +++ head/lang/rust-bootstrap/distinfo (revision 539541) @@ -1,19 +1,19 @@ -TIMESTAMP = 1591049034 -SHA256 (rust/rustc-1.44.0-src.tar.xz) = b32fa7d6bd6ff9286aab2aa7ca696d1da921614cefc10f617aef68d9bce9118a -SIZE (rust/rustc-1.44.0-src.tar.xz) = 94754392 +TIMESTAMP = 1592489407 +SHA256 (rust/rustc-1.44.1-src.tar.xz) = e0386295dd5f2c7842835a509e4c57989eec6c29f989a1c85478b0e06f9d38ea +SIZE (rust/rustc-1.44.1-src.tar.xz) = 94756856 SHA256 (FreeBSD-11.3-RELEASE-arm64.tar.xz) = 0c1ee2bdbec3b6b404edef6858f38f5cdacd727abc53b1dee23910cab939d0c1 SIZE (FreeBSD-11.3-RELEASE-arm64.tar.xz) = 97990888 SHA256 (FreeBSD-11.3-RELEASE-amd64.tar.xz) = 4599023ac136325b86f2fddeec64c1624daa83657e40b00b2ef944c81463a4ff SIZE (FreeBSD-11.3-RELEASE-amd64.tar.xz) = 117877900 SHA256 (FreeBSD-11.3-RELEASE-arm-armv6.tar.xz) = 1d8025c4a51f025211fb6b4b24ba26144906ff288694394c1c3b1c6e0011db03 SIZE (FreeBSD-11.3-RELEASE-arm-armv6.tar.xz) = 46549572 SHA256 (FreeBSD-12.1-RELEASE-arm-armv7.tar.xz) = 0292ce8186908b3e4b5eb5e5923e1f43d22fcb0ab7f6071b493fcc17d386deab SIZE (FreeBSD-12.1-RELEASE-arm-armv7.tar.xz) = 83402220 SHA256 (FreeBSD-11.3-RELEASE-i386.tar.xz) = 9c0adb8c34b7e11d277c2fb9354f7864d91a4620e5238d7eb9dbfe51601ed5cb SIZE (FreeBSD-11.3-RELEASE-i386.tar.xz) = 94399236 SHA256 (FreeBSD-12.1-RELEASE-powerpc64-elfv1.tar.xz) = 2223e22babc169260f9a3f03bbbaf926ef76b1c44d2e81fb172f907ab8fd7aac SIZE (FreeBSD-12.1-RELEASE-powerpc64-elfv1.tar.xz) = 108905368 SHA256 (FreeBSD-12.1-RELEASE-powerpc64-elfv1-gcc9-9.2.0.tar.xz) = fe208feb93a75e6043e1cd1b9e50be853858d6d600296aaf2b25b55525e58bb2 SIZE (FreeBSD-12.1-RELEASE-powerpc64-elfv1-gcc9-9.2.0.tar.xz) = 38150240 SHA256 (FreeBSD-13.0-CURRENT-powerpc64-elfv2-r356261.tar.xz) = db762f136e41dd3c6676d6dc104282be6d6d6684afb348506fc44ceccd43ce17 SIZE (FreeBSD-13.0-CURRENT-powerpc64-elfv2-r356261.tar.xz) = 150455928