diff --git a/Mk/Uses/cargo.mk b/Mk/Uses/cargo.mk index 39a36af7af9b..f9a46043d64a 100644 --- a/Mk/Uses/cargo.mk +++ b/Mk/Uses/cargo.mk @@ -1,405 +1,405 @@ # This file contains logic to ease porting of Rust packages or # binaries using the `cargo` command. # # Feature: cargo # Usage: USES=cargo # Valid ARGS: none # # MAINTAINER: rust@FreeBSD.org .if !defined(_INCLUDE_USES_CARGO_MK) _INCLUDE_USES_CARGO_MK= yes . if !empty(cargo_ARGS) IGNORE+= USES=cargo takes no arguments . endif .sinclude "${MASTERDIR}/Makefile.crates" # List of static dependencies. The format is cratename-version. # CARGO_CRATES will be downloaded from MASTER_SITE_CRATESIO. CARGO_CRATES?= # List of features to build (space separated list). # Use special token --no-default-features to disable default # features by passing it to cargo build/install/test. CARGO_FEATURES?= # Name of the local directory for vendoring crates. CARGO_VENDOR_DIR?= ${WRKSRC}/cargo-crates # Default path for cargo manifest. CARGO_CARGOTOML?= ${WRKSRC}/Cargo.toml CARGO_CARGOLOCK?= ${WRKSRC}/Cargo.lock # Save crates inside ${DISTDIR}/rust/crates by default. CARGO_DIST_SUBDIR?= rust/crates # Generate list of DISTFILES. # Prefer canonical file extension .crate going forward . if make(makesum) CARGO_CRATE_EXT= .crate . else # If there is a rust/crates/*.tar.gz in distinfo keep using the old # extension. We need to delay eval until the last moment for # DISTINFO_FILE. We cache the command output to avoid multiple # slow grep runs for every CARGO_CRATE_EXT access. CARGO_CRATE_EXT= ${defined(_CARGO_CRATE_EXT_CACHE):?${_CARGO_CRATE_EXT_CACHE}:${:!if ${GREP} -q '\(${CARGO_DIST_SUBDIR}/.*\.tar\.gz\)' "${DISTINFO_FILE}" 2>/dev/null; then ${ECHO_CMD} .tar.gz; else ${ECHO_CMD} .crate; fi!:_=_CARGO_CRATE_EXT_CACHE}} . endif _CARGO_CRATES:= ${CARGO_CRATES:N*@git+*} _CARGO_GIT_SOURCES:= ${CARGO_CRATES:M*@git+*} # enumerate crates for unqiue and sane distfile group names _CARGO_CRATES:= ${empty(_CARGO_CRATES):?:${_CARGO_CRATES:range:@i@$i ${_CARGO_CRATES:[$i]}@}} # split up crates into (index, crate, name, version) 4-tuples _CARGO_CRATES:= ${_CARGO_CRATES:C/^([-_a-zA-Z0-9]+)-([0-9].*)/\0 \1 \2/} . for _index _crate _name _version in ${_CARGO_CRATES} # Resolving CRATESIO alias is very inefficient with many MASTER_SITES, consume MASTER_SITE_CRATESIO directly MASTER_SITES+= ${MASTER_SITE_CRATESIO:S,%SUBDIR%,${_name}/${_version},:S,$,:_cargo_${_index},} DISTFILES+= ${CARGO_DIST_SUBDIR}/${_crate}${CARGO_CRATE_EXT}:_cargo_${_index} # Provide pointer to the crate's extraction dir WRKSRC_crate_${_name}= ${CARGO_VENDOR_DIR}/${_crate} # ... also with version suffix in case of multiple versions of the # same crate WRKSRC_crate_${_crate}= ${CARGO_VENDOR_DIR}/${_crate} . endfor _CARGO_AWK= ${AWK} -vCP="${CP}" -vFIND="${FIND}" -vGREP="${GREP}" \ -vCARGO_VENDOR_DIR="${CARGO_VENDOR_DIR}" \ -vGIT_SOURCES="${_CARGO_GIT_SOURCES}" \ -vWRKDIR="${WRKDIR}" -vWRKSRC="${WRKSRC}" \ -f${SCRIPTSDIR}/split-url.awk \ -f${SCRIPTSDIR}/cargo-crates-git-common.awk -f . if !empty(_CARGO_GIT_SOURCES) . for _index _site _filename _wrksrc _crates in ${:!${_CARGO_AWK} ${SCRIPTSDIR}/cargo-crates-git-fetch.awk /dev/null!} MASTER_SITES+= ${_site}:_cargo_git${_index} DISTFILES+= ${_filename}:_cargo_git${_index} . for _crate in ${_crates:S/,/ /g} # Make sure the build dependencies checks below can work for git sourced crates too _CARGO_CRATES+= @git ${_crate} ${_crate} @git # Provide pointer to the crate's extraction dir # # This might not point to the actual crate's sources since a # single git source can contain multiple crates. We cannot collect # subdir information until after the full extraction is done and we # cannot set make variables at that point. This is better than # nothing. WRKSRC_crate_${_crate}= ${WRKDIR}/${_wrksrc} . endfor . endfor . endif # Build dependencies. CARGO_BUILDDEP?= yes . if ${CARGO_BUILDDEP:tl} == "yes" -BUILD_DEPENDS+= ${RUST_DEFAULT}>=1.60.0:lang/${RUST_DEFAULT} +BUILD_DEPENDS+= ${RUST_DEFAULT}>=1.61.0:lang/${RUST_DEFAULT} . endif # Location of toolchain (default to lang/rust's toolchain) CARGO?= ${LOCALBASE}/bin/cargo RUSTC?= ${LOCALBASE}/bin/rustc RUSTDOC?= ${LOCALBASE}/bin/rustdoc # Location of the cargo output directory. CARGO_TARGET_DIR?= ${WRKDIR}/target # Default target platform (affects some RUSTFLAGS if passed) CARGO_BUILD_TARGET?= ${_CARGO_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl} _CARGO_RUST_ARCH_amd64= x86_64 _CARGO_RUST_ARCH_i386= i686 _CARGO_RUST_ARCH_riscv64= riscv64gc # Environment for cargo # - CARGO_HOME: local cache of the registry index # - CARGO_BUILD_JOBS: configure number of jobs to run # - CARGO_TARGET_DIR: location of where to place all generated artifacts # - RUST_BACKTRACE: produce backtraces when something in the build panics # - RUSTC: path of rustc binary (default to lang/rust) # - RUSTDOC: path of rustdoc binary (default to lang/rust) # - RUSTFLAGS: custom flags to pass to all compiler invocations that Cargo performs CARGO_ENV+= \ CARGO_HOME=${WRKDIR}/cargo-home \ CARGO_BUILD_JOBS=${MAKE_JOBS_NUMBER} \ CARGO_BUILD_TARGET=${CARGO_BUILD_TARGET} \ CARGO_TARGET_DIR=${CARGO_TARGET_DIR} \ CARGO_TARGET_${CARGO_BUILD_TARGET:S/-/_/g:tu}_LINKER="${CC}" \ RUSTC=${RUSTC} \ RUSTDOC=${RUSTDOC} \ RUSTFLAGS="${RUSTFLAGS} ${LDFLAGS:C/.+/-C link-arg=&/}" . if ${ARCH} != powerpc CARGO_ENV+= RUST_BACKTRACE=1 . endif # Adjust -C target-cpu if -march/-mcpu is set by bsd.cpu.mk . if ${ARCH} == amd64 || ${ARCH} == i386 RUSTFLAGS+= ${CFLAGS:M-march=*:S/-march=/-C target-cpu=/} . elif ${ARCH:Mpowerpc*} RUSTFLAGS+= ${CFLAGS:M-mcpu=*:S/-mcpu=/-C target-cpu=/:S/power/pwr/} . else RUSTFLAGS+= ${CFLAGS:M-mcpu=*:S/-mcpu=/-C target-cpu=/} . endif . if defined(PPC_ABI) && ${PPC_ABI} == ELFv1 USE_GCC?= yes STRIP_CMD= ${LOCALBASE}/bin/strip # unsupported e_type with base strip . endif # Helper to shorten cargo calls. _CARGO_RUN= ${SETENV} ${MAKE_ENV} ${CARGO_ENV} ${CARGO} CARGO_CARGO_RUN= cd ${WRKSRC}; ${SETENV} CARGO_FREEBSD_PORTS_SKIP_GIT_UPDATE=1 ${_CARGO_RUN} # User arguments for cargo targets. CARGO_BUILD_ARGS?= CARGO_INSTALL_ARGS?= CARGO_INSTALL_PATH?= . CARGO_TEST_ARGS?= CARGO_UPDATE_ARGS?= # Use module targets ? CARGO_BUILD?= yes CARGO_CONFIGURE?= yes CARGO_INSTALL?= yes CARGO_TEST?= yes # rustc stashes intermediary files in TMPDIR (default /tmp) which # might cause issues for users that for some reason space limit # their /tmp. WRKDIR should have plenty of space. # Allow users and ports to still overwrite it. . if ${TMPDIR:U/tmp} == /tmp TMPDIR= ${WRKDIR} . endif # Manage crate features. . if !empty(CARGO_FEATURES:M--no-default-features) CARGO_BUILD_ARGS+= --no-default-features CARGO_INSTALL_ARGS+= --no-default-features CARGO_TEST_ARGS+= --no-default-features . endif . if !empty(CARGO_FEATURES:N--no-default-features) CARGO_BUILD_ARGS+= --features='${CARGO_FEATURES:N--no-default-features}' CARGO_INSTALL_ARGS+= --features='${CARGO_FEATURES:N--no-default-features}' CARGO_TEST_ARGS+= --features='${CARGO_FEATURES:N--no-default-features}' . endif . if !defined(WITH_DEBUG) CARGO_BUILD_ARGS+= --release CARGO_TEST_ARGS+= --release . else CARGO_INSTALL_ARGS+= --debug . endif . if ${_CARGO_CRATES:Mcmake} BUILD_DEPENDS+= cmake:devel/cmake . endif . if ${_CARGO_CRATES:Mgettext-sys} CARGO_ENV+= GETTEXT_BIN_DIR=${LOCALBASE}/bin \ GETTEXT_INCLUDE_DIR=${LOCALBASE}/include \ GETTEXT_LIB_DIR=${LOCALBASE}/lib . endif . if ${_CARGO_CRATES:Mjemalloc-sys} BUILD_DEPENDS+= gmake:devel/gmake . endif . if ${_CARGO_CRATES:Mlibgit2-sys} # Use the system's libgit2 instead of building the bundled version CARGO_ENV+= LIBGIT2_SYS_USE_PKG_CONFIG=1 . endif . if ${_CARGO_CRATES:Mlibssh2-sys} # Use the system's libssh2 instead of building the bundled version CARGO_ENV+= LIBSSH2_SYS_USE_PKG_CONFIG=1 . endif . if ${_CARGO_CRATES:Monig_sys} # onig_sys always prefers the system library but will try to link # statically with it. Since devel/oniguruma doesn't provide a static # library it'll link to libonig.so instead. Strictly speaking setting # RUSTONIG_SYSTEM_LIBONIG is not necessary, but will force onig_sys to # always use the system's libonig as returned by `pkg-config oniguruma`. CARGO_ENV+= RUSTONIG_SYSTEM_LIBONIG=1 . endif . if ${_CARGO_CRATES:Mopenssl-src} DEV_WARNING+= "Please make sure this port uses the system OpenSSL and consider removing CARGO_CRATES=${CARGO_CRATES:Mopenssl-src-[0-9]*} (a vendored copy of OpenSSL) from the build, e.g., by patching Cargo.toml appropriately." . endif . if ${_CARGO_CRATES:Mopenssl-sys} # Make sure that openssl-sys can find the correct version of OpenSSL CARGO_ENV+= OPENSSL_LIB_DIR=${OPENSSLLIB} \ OPENSSL_INCLUDE_DIR=${OPENSSLINC} . endif . if ${_CARGO_CRATES:Mpkg-config} .include "${USESDIR}/pkgconfig.mk" . endif . for _index _crate _name _version in ${_CARGO_CRATES} # Split up semantic version and try to sanitize it by removing # pre-release identifier (-) or build metadata (+) . if ${_version:S/./ /:S/./ /:C/[-+].*//:_:[#]} == 3 . for _major _minor _patch in $_ # FreeBSD 12.0 changed ABI: r318736 and r320043 # https://github.com/rust-lang/libc/commit/78f93220d70e # https://github.com/rust-lang/libc/commit/969ad2b73cdc . if ${_name} == libc && ${_major} == 0 && (${_minor} < 2 || (${_minor} == 2 && ${_patch} < 38)) DEV_ERROR+= "CARGO_CRATES=${_crate} may be unstable on FreeBSD 12.0. Consider updating to the latest version \(higher than 0.2.37\)." . endif . if ${_name} == libc && ${_major} == 0 && (${_minor} < 2 || (${_minor} == 2 && ${_patch} < 49)) DEV_ERROR+= "CARGO_CRATES=${_crate} may be unstable on aarch64 or not build on armv6, armv7, powerpc64. Consider updating to the latest version \(higher than 0.2.49\)." . endif # FreeBSD 12.0 updated base OpenSSL in r339270: # https://github.com/sfackler/rust-openssl/commit/276577553501 . if ${_name} == openssl && !exists(${PATCHDIR}/patch-openssl-1.1.1) && ${_major} == 0 && (${_minor} < 10 || (${_minor} == 10 && ${_patch} < 4)) DEV_WARNING+= "CARGO_CRATES=${_crate} does not support OpenSSL 1.1.1. Consider updating to the latest version \(higher than 0.10.3\)." . endif . endfor . endif . endfor _USES_extract+= 600:cargo-extract cargo-extract: # target for preparing crates directory. It will put all crates in # the local crates directory. @${ECHO_MSG} "===> Moving crates to ${CARGO_VENDOR_DIR}" @${MKDIR} ${CARGO_VENDOR_DIR} . for _index _crate _name _version in ${_CARGO_CRATES} . if ${_index} != @git @${MV} ${WRKDIR}/${_crate} ${CARGO_VENDOR_DIR}/${_crate} @${PRINTF} '{"package":"%s","files":{}}' \ $$(${SHA256} -q ${DISTDIR}/${CARGO_DIST_SUBDIR}/${_crate}${CARGO_CRATE_EXT}) \ > ${CARGO_VENDOR_DIR}/${_crate}/.cargo-checksum.json @if [ -r ${CARGO_VENDOR_DIR}/${_crate}/Cargo.toml.orig ]; then \ ${MV} ${CARGO_VENDOR_DIR}/${_crate}/Cargo.toml.orig \ ${CARGO_VENDOR_DIR}/${_crate}/Cargo.toml.orig-cargo; \ fi . endif . endfor . if ${CARGO_CONFIGURE:tl} == "yes" _USES_configure+= 250:cargo-configure # configure hook. Place a config file for overriding crates-io index # by local source directory. cargo-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_MSG} "===> Cargo config:" @${MKDIR} ${WRKDIR}/.cargo @: > ${WRKDIR}/.cargo/config.toml @${ECHO_CMD} "[source.cargo]" >> ${WRKDIR}/.cargo/config.toml @${ECHO_CMD} "directory = '${CARGO_VENDOR_DIR}'" >> ${WRKDIR}/.cargo/config.toml @${ECHO_CMD} "[source.crates-io]" >> ${WRKDIR}/.cargo/config.toml @${ECHO_CMD} "replace-with = 'cargo'" >> ${WRKDIR}/.cargo/config.toml . if !empty(_CARGO_GIT_SOURCES) @${_CARGO_AWK} ${SCRIPTSDIR}/cargo-crates-git-configure.awk \ /dev/null >> ${WRKDIR}/.cargo/config.toml . endif @${CAT} ${WRKDIR}/.cargo/config.toml @if ! ${GREP} -qF '[profile.release]' ${CARGO_CARGOTOML}; then \ ${ECHO_CMD} "" >> ${CARGO_CARGOTOML}; \ ${ECHO_CMD} "[profile.release]" >> ${CARGO_CARGOTOML}; \ ${ECHO_CMD} "opt-level = 2" >> ${CARGO_CARGOTOML}; \ ${ECHO_CMD} "debug = false" >> ${CARGO_CARGOTOML}; \ fi @${ECHO_MSG} "===> Updating Cargo.lock" @${CARGO_CARGO_RUN} update \ --manifest-path ${CARGO_CARGOTOML} \ --verbose \ --verbose \ ${CARGO_UPDATE_ARGS} . endif . if !target(do-build) && ${CARGO_BUILD:tl} == "yes" do-build: @${CARGO_CARGO_RUN} build \ --manifest-path ${CARGO_CARGOTOML} \ --verbose \ --verbose \ ${CARGO_BUILD_ARGS} . endif . if !target(do-install) && ${CARGO_INSTALL:tl} == "yes" do-install: . for path in ${CARGO_INSTALL_PATH} @${CARGO_CARGO_RUN} install \ --no-track \ --path "${path}" \ --root "${STAGEDIR}${PREFIX}" \ --verbose \ --verbose \ ${CARGO_INSTALL_ARGS} . endfor . endif . if !target(do-test) && ${CARGO_TEST:tl} == "yes" do-test: @${CARGO_CARGO_RUN} test \ --manifest-path ${CARGO_CARGOTOML} \ --verbose \ --verbose \ ${CARGO_TEST_ARGS} . endif # # Helper targets for port maintainers # # cargo-audit generates a vulnerability report using # security/cargo-audit based on the crates in Cargo.lock. cargo-audit: configure @if ! type cargo-audit > /dev/null 2>&1; then \ ${ECHO_MSG} "===> Please install \"security/cargo-audit\""; exit 1; \ fi @${ECHO_MSG} "===> Checking for vulnerable crates" @${CARGO} audit --file ${CARGO_CARGOLOCK} # cargo-crates will output the crates list from Cargo.lock. If there # is no Cargo.lock for some reason, try and generate it first. cargo-crates: cargo-crates-generate-lockfile @${_CARGO_AWK} ${SCRIPTSDIR}/cargo-crates.awk ${CARGO_CARGOLOCK} # cargo-crates-generate-lockfile will try to generate a Cargo.lock file # if it does not exist. cargo-crates-generate-lockfile: extract @if [ ! -r "${CARGO_CARGOLOCK}" ]; then \ ${ECHO_MSG} "===> ${CARGO_CARGOLOCK} not found. Trying to generate it..."; \ cd ${WRKSRC}; ${_CARGO_RUN} generate-lockfile \ --manifest-path ${CARGO_CARGOTOML} \ --verbose; \ fi # cargo-crates-licenses will try to grab license information from # all downloaded crates. cargo-crates-licenses: configure @${FIND} ${CARGO_VENDOR_DIR} -name 'Cargo.toml' -maxdepth 2 \ -exec ${GREP} -H '^license' {} \; \ | ${SED} \ -e 's@^${CARGO_VENDOR_DIR}/@@' \ -e 's@/Cargo.toml:license.*= *"@|@' \ -e 's@"$$@@g' | sort | /usr/bin/column -t -s '|' # cargo-crates-merge will in-place update CARGO_CRATES in the port # based on the crates list from Cargo.lock. If there is no Cargo.lock # for some reason, try and generate it first. cargo-crates-merge: @if ! type portedit > /dev/null 2>&1; then \ ${ECHO_MSG} "===> Please install \"ports-mgmt/portfmt\""; exit 1; \ fi @${MAKE} clean cargo-crates-generate-lockfile @f="${MASTERDIR}/Makefile"; [ -r "${MASTERDIR}/Makefile.crates" ] && f="${MASTERDIR}/Makefile.crates"; \ ${_CARGO_AWK} ${SCRIPTSDIR}/cargo-crates.awk ${CARGO_CARGOLOCK} | \ portedit merge -i $$f; \ ${MAKE} clean makesum; \ ${ECHO_MSG} "${DISTINFO_FILE} and CARGO_CRATES in $$f were updated"; .endif diff --git a/Mk/bsd.gecko.mk b/Mk/bsd.gecko.mk index a5d0b31b562a..146779a26df9 100644 --- a/Mk/bsd.gecko.mk +++ b/Mk/bsd.gecko.mk @@ -1,408 +1,408 @@ #-*- tab-width: 4; -*- # ex:ts=4 # # Date created: 12 Nov 2005 # Whom: Michael Johnson # # 4 column tabs prevent hair loss and tooth decay! # bsd.gecko.mk abstracts the selection of gecko-based backends. It allows users # and porters to support any available gecko backend without needing to build # many conditional tests. ${USE_GECKO} is the list of backends that your port # can handle, and ${GECKO} is set by bsd.gecko.mk to be the chosen backend. # Users set ${WITH_GECKO} to the list of gecko backends they want on their # system. .if defined(USE_GECKO) . if !defined(_POSTMKINCLUDED) && !defined(Gecko_Pre_Include) Gecko_Pre_Include= bsd.gecko.mk # This file contains some reusable components for mozilla ports. It's of # use primarily to apps from the mozilla project itself (such as Firefox, # Thunderbird, etc.), and probably won't be of use for gecko-based ports # like epiphany, galeon, etc. # # You need to make sure to add USE_GECKO=gecko to for your port can uses # one of these options below. # # Ports can use the following: # # USE_MOZILLA By default, it enables every system dependency # listed in '_ALL_DEPENDS'. If your port doesn't # need one of those then you can use '-' like # 'USE_MOZILLA= -png -vpx' to subtract the # dependencies. Experimental deps use '+' like # 'USE_MOZILLA= +speex +theora'. # # MOZILLA_PLIST_DIRS List of directories to descend into when installing # and creating the plist # # MOZ_OPTIONS configure arguments (added to .mozconfig). If # NOMOZCONFIG is defined, you probably want to set # CONFIGURE_ARGS+=${MOZ_OPTIONS} # # MOZ_MK_OPTIONS The make(1) arguments (added to .mozconfig). If # NOMOZCONFIG is defined, you probably want to set # MAKE_ARGS+=${MOZ_MK_OPTIONS} # # MOZ_EXPORT Environment variables for the build process (added # to .mozconfig). If NOMOZCONFIG is defined, you # probably want to set MAKE_ENV+=${MOZ_EXPORT} # # NOMOZCONFIG Don't drop a customized .mozconfig into the build # directory. Options will have to be specified in # CONFIGURE_ARGS instead # MAINTAINER?= gecko@FreeBSD.org MOZILLA?= ${PORTNAME} MOZILLA_VER?= ${PORTVERSION} MOZILLA_BIN?= ${PORTNAME}-bin MOZILLA_EXEC_NAME?=${MOZILLA} USES+= compiler:c++17-lang cpe gl gmake gnome iconv localbase perl5 pkgconfig \ python:3.6+,build desktop-file-utils CPE_VENDOR?=mozilla USE_GL= gl USE_GNOME= cairo gdkpixbuf2 gtk30 USE_PERL5= build USE_XORG= x11 xcb xcomposite xdamage xext xfixes xrender xt . if ${MOZILLA_VER:R:R} >= 96 USE_XORG+= xrandr xtst . endif HAS_CONFIGURE= yes CONFIGURE_OUTSOURCE= yes LDFLAGS+= -Wl,--as-needed BINARY_ALIAS+= python3=${PYTHON_CMD} BUNDLE_LIBS= yes BUILD_DEPENDS+= llvm${LLVM_DEFAULT}>0:devel/llvm${LLVM_DEFAULT} \ rust-cbindgen>=0.23.0:devel/rust-cbindgen \ - ${RUST_DEFAULT}>=1.60.0:lang/${RUST_DEFAULT} \ + ${RUST_DEFAULT}>=1.61.0:lang/${RUST_DEFAULT} \ node:www/node LIB_DEPENDS+= libdrm.so:graphics/libdrm RUN_DEPENDS+= ${LOCALBASE}/lib/libpci.so:devel/libpci LIB_DEPENDS+= libepoll-shim.so:devel/libepoll-shim MOZ_EXPORT+= ${CONFIGURE_ENV} \ PERL="${PERL}" \ PYTHON3="${PYTHON_CMD}" \ RUSTFLAGS="${RUSTFLAGS}" MOZ_OPTIONS+= --prefix="${PREFIX}" MOZ_MK_OPTIONS+=MOZ_OBJDIR="${BUILD_WRKSRC}" MOZ_OPTIONS+= --with-libclang-path="${LOCALBASE}/llvm${LLVM_DEFAULT}/lib" . if !exists(/usr/bin/llvm-objdump) MOZ_EXPORT+= LLVM_OBJDUMP="${LOCALBASE}/bin/llvm-objdump${LLVM_DEFAULT}" . endif # Ignore Mk/bsd.default-versions.mk but respect make.conf(5) unless LTO is enabled . if !defined(DEFAULT_VERSIONS) || ! ${DEFAULT_VERSIONS:Mllvm*} || ${PORT_OPTIONS:MLTO} LLVM_DEFAULT= 13 # chase bundled LLVM in lang/rust for LTO LLVM_VERSION= 13.0.1 # keep in sync with devel/wasi-compiler-rt${LLVM_DEFAULT} . endif # Require newer Clang than what's in base system unless user opted out . if ${CC} == cc && ${CXX} == c++ && exists(/usr/lib/libc++.so) BUILD_DEPENDS+= ${LOCALBASE}/bin/clang${LLVM_DEFAULT}:devel/llvm${LLVM_DEFAULT} CPP= ${LOCALBASE}/bin/clang-cpp${LLVM_DEFAULT} CC= ${LOCALBASE}/bin/clang${LLVM_DEFAULT} CXX= ${LOCALBASE}/bin/clang++${LLVM_DEFAULT} USES:= ${USES:Ncompiler\:*} # XXX avoid warnings . endif MOZSRC?= ${WRKSRC} PLISTF?= ${WRKDIR}/plist_files MOZCONFIG?= ${WRKSRC}/.mozconfig MOZILLA_PLIST_DIRS?= bin lib share/pixmaps share/applications # Adjust -C target-cpu if -march/-mcpu is set by bsd.cpu.mk . if ${ARCH} == amd64 || ${ARCH} == i386 RUSTFLAGS+= ${CFLAGS:M-march=*:S/-march=/-C target-cpu=/} . elif ${ARCH:Mpowerpc*} RUSTFLAGS+= ${CFLAGS:M-mcpu=*:S/-mcpu=/-C target-cpu=/:S/power/pwr/} . else RUSTFLAGS+= ${CFLAGS:M-mcpu=*:S/-mcpu=/-C target-cpu=/} . endif # Standard depends _ALL_DEPENDS= av1 event ffi graphite harfbuzz icu jpeg nspr nss png pixman sqlite vpx webp . if exists(${FILESDIR}/patch-bug1559213) av1_LIB_DEPENDS= libaom.so:multimedia/aom libdav1d.so:multimedia/dav1d av1_MOZ_OPTIONS= --with-system-av1 . endif event_LIB_DEPENDS= libevent.so:devel/libevent event_MOZ_OPTIONS= --with-system-libevent ffi_LIB_DEPENDS= libffi.so:devel/libffi ffi_MOZ_OPTIONS= --enable-system-ffi . if exists(${FILESDIR}/patch-bug847568) graphite_LIB_DEPENDS= libgraphite2.so:graphics/graphite2 graphite_MOZ_OPTIONS= --with-system-graphite2 harfbuzz_LIB_DEPENDS= libharfbuzz.so:print/harfbuzz harfbuzz_MOZ_OPTIONS= --with-system-harfbuzz . endif icu_LIB_DEPENDS= libicui18n.so:devel/icu icu_MOZ_OPTIONS= --with-system-icu --with-intl-api -jpeg_BUILD_DEPENDS=yasm:devel/yasm jpeg_USES= jpeg jpeg_MOZ_OPTIONS= --with-system-jpeg=${LOCALBASE} nspr_LIB_DEPENDS= libnspr4.so:devel/nspr nspr_MOZ_OPTIONS= --with-system-nspr nss_LIB_DEPENDS= libnss3.so:security/nss nss_MOZ_OPTIONS= --with-system-nss pixman_LIB_DEPENDS= libpixman-1.so:x11/pixman pixman_MOZ_OPTIONS= --enable-system-pixman png_LIB_DEPENDS= libpng.so:graphics/png png_MOZ_OPTIONS= --with-system-png=${LOCALBASE} . if ${MOZILLA_VER:R:R} >= 97 png_MOZ_OPTIONS= --with-system-png . endif sqlite_LIB_DEPENDS= libsqlite3.so:databases/sqlite3 sqlite_MOZ_OPTIONS= --enable-system-sqlite -vpx_BUILD_DEPENDS= yasm:devel/yasm vpx_LIB_DEPENDS= libvpx.so:multimedia/libvpx vpx_MOZ_OPTIONS= --with-system-libvpx webp_LIB_DEPENDS= libwebp.so:graphics/webp webp_MOZ_OPTIONS= --with-system-webp . for use in ${USE_MOZILLA} ${use:S/-/_WITHOUT_/}= ${TRUE} . endfor LIB_DEPENDS+= libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 . for dep in ${_ALL_DEPENDS} ${USE_MOZILLA:M+*:S/+//} . if !defined(_WITHOUT_${dep}) BUILD_DEPENDS+= ${${dep}_BUILD_DEPENDS} LIB_DEPENDS+= ${${dep}_LIB_DEPENDS} RUN_DEPENDS+= ${${dep}_RUN_DEPENDS} USES+= ${${dep}_USES} MOZ_OPTIONS+= ${${dep}_MOZ_OPTIONS} . else BUILD_DEPENDS+= ${-${dep}_BUILD_DEPENDS} . endif . endfor # Standard options MOZ_OPTIONS+= \ --enable-update-channel=${PKGNAMESUFFIX:Urelease:S/^-//} \ --disable-updater \ --with-system-zlib # API keys from www/chromium # http://www.chromium.org/developers/how-tos/api-keys # Note: these are for FreeBSD use ONLY. For your own distribution, # please get your own set of keys. MOZ_EXPORT+= MOZ_GOOGLE_LOCATION_SERVICE_API_KEY=AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8 MOZ_EXPORT+= MOZ_GOOGLE_SAFEBROWSING_API_KEY=AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8 . if ${PORT_OPTIONS:MOPTIMIZED_CFLAGS} CFLAGS+= -O3 MOZ_EXPORT+= MOZ_OPTIMIZE_FLAGS="${CFLAGS:M-O*}" MOZ_OPTIONS+= --enable-optimize . else MOZ_OPTIONS+= --disable-optimize . if ${/usr/bin/ld:L:tA} != /usr/bin/ld.lld # ld 2.17 barfs on Stylo built with -C opt-level=0 USE_BINUTILS= yes LDFLAGS+= -B${LOCALBASE}/bin . endif . endif . if ${PORT_OPTIONS:MCANBERRA} RUN_DEPENDS+= libcanberra>0:audio/libcanberra . endif . if ${PORT_OPTIONS:MDBUS} BUILD_DEPENDS+= libnotify>0:devel/libnotify LIB_DEPENDS+= libdbus-1.so:devel/dbus \ libdbus-glib-1.so:devel/dbus-glib . else MOZ_OPTIONS+= --disable-dbus . endif . if ${PORT_OPTIONS:MFFMPEG} # dom/media/platforms/ffmpeg/FFmpegRuntimeLinker.cpp RUN_DEPENDS+= ffmpeg>=0.8,1:multimedia/ffmpeg . endif . if ${PORT_OPTIONS:MLIBPROXY} LIB_DEPENDS+= libproxy.so:net/libproxy MOZ_OPTIONS+= --enable-libproxy . else MOZ_OPTIONS+= --disable-libproxy . endif . if ${PORT_OPTIONS:MLTO} MOZ_OPTIONS+= --enable-lto=cross . endif . if ${PORT_OPTIONS:MALSA} BUILD_DEPENDS+= ${LOCALBASE}/include/alsa/asoundlib.h:audio/alsa-lib MOZ_OPTIONS+= --enable-alsa . endif . if ${PORT_OPTIONS:MJACK} BUILD_DEPENDS+= ${LOCALBASE}/include/jack/jack.h:audio/jack MOZ_OPTIONS+= --enable-jack . endif . if ${PORT_OPTIONS:MPULSEAUDIO} BUILD_DEPENDS+= ${LOCALBASE}/include/pulse/pulseaudio.h:audio/pulseaudio MOZ_OPTIONS+= --enable-pulseaudio . else MOZ_OPTIONS+= --disable-pulseaudio . endif . if ${PORT_OPTIONS:MSNDIO} BUILD_DEPENDS+= ${LOCALBASE}/include/sndio.h:audio/sndio . if ${MOZILLA_VER:R:R} < 100 post-patch-SNDIO-on: @${REINPLACE_CMD} -e 's|OpenBSD|${OPSYS}|g' \ -e '/DISABLE_LIBSNDIO_DLOPEN/d' \ ${MOZSRC}/media/libcubeb/src/moz.build . else MOZ_OPTIONS+= --enable-sndio . endif . else . if ${MOZILLA_VER:R:R} >= 100 MOZ_OPTIONS+= --disable-sndio . endif . endif . if ${PORT_OPTIONS:MDEBUG} MOZ_OPTIONS+= --enable-debug --disable-release STRIP= # ports/184285 . else MOZ_OPTIONS+= --disable-debug --disable-debug-symbols --enable-release . if ${ARCH:Maarch64} || (defined(MACHINE_CPU) && ${MACHINE_CPU:Msse2}) MOZ_OPTIONS+= --enable-rust-simd . endif . endif . if ${PORT_OPTIONS:MPROFILE} MOZ_OPTIONS+= --enable-profiling STRIP= . else MOZ_OPTIONS+= --disable-profiling . endif . if ${PORT_OPTIONS:MTEST} USE_XORG+= xscrnsaver MOZ_OPTIONS+= --enable-tests . else MOZ_OPTIONS+= --disable-tests . endif . if !defined(STRIP) || ${STRIP} == "" MOZ_OPTIONS+= --disable-strip --disable-install-strip . else MOZ_OPTIONS+= --enable-strip --enable-install-strip . endif # _MAKE_JOBS is only available after bsd.port.post.mk, thus cannot be # used in .mozconfig. And client.mk automatically uses -jN where N # is what multiprocessing.cpu_count() returns. . if defined(DISABLE_MAKE_JOBS) || defined(MAKE_JOBS_UNSAFE) MAKE_JOBS_NUMBER= 1 . endif . if defined(MAKE_JOBS_NUMBER) MOZ_MAKE_FLAGS+=-j${MAKE_JOBS_NUMBER} . endif . if defined(MOZ_MAKE_FLAGS) MOZ_MK_OPTIONS+=MOZ_MAKE_FLAGS="${MOZ_MAKE_FLAGS}" . endif . if ${ARCH} == amd64 . if ${USE_MOZILLA:M-nss} USE_BINUTILS= # intel-gcm.s CFLAGS+= -B${LOCALBASE}/bin LDFLAGS+= -B${LOCALBASE}/bin . endif . elif ${ARCH:Mpowerpc*} BUILD_DEPENDS+= as:devel/binutils . endif . else # bsd.port.post.mk post-patch: gecko-post-patch gecko-post-patch: @${RM} ${MOZCONFIG} . if !defined(NOMOZCONFIG) . for arg in ${MOZ_OPTIONS} @${ECHO_CMD} ac_add_options ${arg:Q} >> ${MOZCONFIG} . endfor . for arg in ${MOZ_MK_OPTIONS} @${ECHO_CMD} mk_add_options ${arg:Q} >> ${MOZCONFIG} . endfor . for var in ${MOZ_EXPORT} @${ECHO_CMD} export ${var:Q} >> ${MOZCONFIG} . endfor . endif # .if !defined(NOMOZCONFIG) . if ${USE_MOZILLA:M-nspr} @${ECHO_MSG} "===> Applying NSPR patches" @for i in ${.CURDIR}/../../devel/nspr/files/patch-*; do \ ${PATCH} ${PATCH_ARGS} -d ${MOZSRC}/nsprpub < $$i; \ done . endif . if ${USE_MOZILLA:M-nss} @${ECHO_MSG} "===> Applying NSS patches" @for i in ${.CURDIR}/../../security/nss/files/patch-*; do \ ${PATCH} ${PATCH_ARGS} -d ${MOZSRC}/security/nss < $$i; \ done . endif @if [ -f ${WRKSRC}/config/baseconfig.mk ] ; then \ ${REINPLACE_CMD} -e 's|%%MOZILLA%%|${MOZILLA}|g' \ ${WRKSRC}/config/baseconfig.mk; \ fi @${REINPLACE_CMD} -e 's|%%MOZILLA%%|${MOZILLA}|g' \ ${MOZSRC}/config/baseconfig.mk @${REINPLACE_CMD} -e 's|/usr/local/netscape|${LOCALBASE}|g ; \ s|/usr/local/lib/netscape|${LOCALBASE}/lib|g' \ ${MOZSRC}/xpcom/io/SpecialSystemDirectory.cpp @${REINPLACE_CMD} -e 's|/etc|${PREFIX}&|g' \ ${MOZSRC}/xpcom/build/nsXPCOMPrivate.h @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ -e 's|mozilla/plugins|browser_plugins|g' \ -e 's|share/mozilla/extensions|lib/xpi|g' \ ${MOZSRC}/xpcom/io/nsAppFileLocationProvider.cpp \ ${MOZSRC}/toolkit/xre/nsXREDirProvider.cpp # Disable vendor checksums like lang/rust @${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \ ${MOZSRC}/third_party/rust/*/.cargo-checksum.json pre-configure-script: # 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 post-install-script: gecko-create-plist gecko-create-plist: # Create the plist ${RM} ${PLISTF} . for dir in ${MOZILLA_PLIST_DIRS} @cd ${STAGEDIR}${PREFIX}/${dir} && ${FIND} -H -s * ! -type d | \ ${SED} -e 's|^|${dir}/|' >> ${PLISTF} . endfor ${CAT} ${PLISTF} | ${SORT} >> ${TMPPLIST} . endif .endif # HERE THERE BE TACOS -- adamw diff --git a/lang/rust-bootstrap/Makefile b/lang/rust-bootstrap/Makefile index d12f6315322b..2517ef68f09a 100644 --- a/lang/rust-bootstrap/Makefile +++ b/lang/rust-bootstrap/Makefile @@ -1,170 +1,170 @@ # Once the bootstraps are available on pkg.FreeBSD.org run sync.sh # to upload them to ~/public_distfiles on freefall in preparation # for the next lang/rust update. PORTNAME= rust -PORTVERSION= 1.60.0 +PORTVERSION= 1.61.0 CATEGORIES= lang MASTER_SITES= https://static.rust-lang.org/dist/ PKGNAMEPREFIX= ${FLAVOR:S/_/-/g}- PKGNAMESUFFIX= -bootstrap DISTNAME= ${PORTNAME}c-${PORTVERSION}-src DIST_SUBDIR= rust 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 powerpc64le ONLY_FOR_ARCHS_REASON= untested on other architectures BUILD_DEPENDS= ${FLAVOR:S/_/-/g}-freebsd-sysroot>=a2021.09.14:devel/freebsd-sysroot@${FLAVOR} \ cmake:devel/cmake \ gmake:devel/gmake \ rust>=${PORTVERSION}:lang/rust FLAVORS= aarch64 amd64 armv6 armv7 i386 powerpc64_elfv1 powerpc64_elfv2 \ powerpc64le powerpc riscv64 FLAVOR?= ${FLAVORS:[1]} USES= cpe ninja:build perl5 python:3.6+,build tar:xz CPE_VENDOR= ${PORTNAME}-lang .if ${FLAVOR} == powerpc64_elfv1 USE_GCC= 9:build .endif # for openssl-src crate USE_PERL5= build PATCHDIR= ${.CURDIR}/../rust/files # rustc stashes intermediary files in TMPDIR (default /tmp) which # might cause issues for users that for some reason space limit # their /tmp. WRKDIR should have plenty of space. # ?= to allow users to still overwrite it in make.conf. TMPDIR?= ${WRKDIR} # Resulting packages are not specific to amd64 NO_ARCH= yes _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_ARCH_riscv64= riscv64gc _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_TARGET_powerpc64le= PowerPC _RUST_LLVM_TARGET_powerpc= PowerPC _RUST_LLVM_TARGET_riscv64= RISCV .include .if ${OPSYS} != FreeBSD IGNORE= is only for FreeBSD .endif .if (${FLAVOR} == powerpc64le || ${FLAVOR} == riscv64) && ${OSVERSION} < 1300116 IGNORE= will not build on 12.x due to old system .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} == powerpc64_elfv1 @${REINPLACE_CMD} -e 's,"c++","stdc++",g' \ ${WRKSRC}/compiler/rustc_llvm/build.rs @${REINPLACE_CMD} -e 's,%CC%,${CC},g' \ -e 's,%WRKDIR%,${LOCALBASE}/freebsd-sysroot/powerpc64-elfv1,g' \ ${WRKSRC}/compiler/rustc_llvm/build.rs \ ${WRKSRC}/src/bootstrap/native.rs .endif 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} 'changelog-seen=2' > ${WRKSRC}/config.toml @${ECHO_CMD} '[build]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'build-dir="${WRKDIR}/_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 .if ${FLAVOR} == riscv64 @${ECHO_CMD} 'debug=true' >> ${WRKSRC}/config.toml .endif @${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 # https://github.com/rust-lang/rust/pull/72696#issuecomment-641517185 @${ECHO_CMD} 'ldflags="-lz"' >> ${WRKSRC}/config.toml # we need to make sure to always build llvm with host arch support to get a # host compiler that can build the host->target compiler @${ECHO_CMD} 'targets="${_RUST_LLVM_TARGET};${_RUST_LLVM_TARGET_${ARCH}}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} '[target.${_RUST_TARGET}]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cc="${LOCALBASE}/freebsd-sysroot/${FLAVOR:S/_/-/g}/bin/cc"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cxx="${LOCALBASE}/freebsd-sysroot/${FLAVOR:S/_/-/g}/bin/c++"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'linker="${LOCALBASE}/freebsd-sysroot/${FLAVOR:S/_/-/g}/bin/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 do-build: @cd ${WRKSRC} && \ ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} x.py dist --jobs=${MAKE_JOBS_NUMBER} \ cargo rustc rust-std do-install: @${MKDIR} ${STAGEDIR}${PREFIX}/rust-bootstrap/${FLAVOR} ${INSTALL_DATA} ${WRKDIR}/_build/dist/*-${_RUST_ARCH_${FLAVOR}:U${FLAVOR}}-unknown-${OPSYS:tl}${EXTRACT_SUFX} \ ${STAGEDIR}${PREFIX}/rust-bootstrap/${FLAVOR} .if ${FLAVOR:Mpowerpc64_*} @cd ${STAGEDIR}${PREFIX}/rust-bootstrap/${FLAVOR} && for f in *${EXTRACT_SUFX}; do \ ${MV} $$f $${f%%${EXTRACT_SUFX}}-${FLAVOR:S/_/ /:[2]}${EXTRACT_SUFX}; \ done .endif @cd ${STAGEDIR}${PREFIX} && \ ${FIND} rust-bootstrap -type f >> ${TMPPLIST} .include diff --git a/lang/rust-bootstrap/distinfo b/lang/rust-bootstrap/distinfo index bc0fd399a54a..8bd244c4fb53 100644 --- a/lang/rust-bootstrap/distinfo +++ b/lang/rust-bootstrap/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1649150849 -SHA256 (rust/rustc-1.60.0-src.tar.xz) = a025876deccbcb3f288d8e02623ea321f94623f31305d3c5c6f17855bb9685db -SIZE (rust/rustc-1.60.0-src.tar.xz) = 136183048 +TIMESTAMP = 1653574502 +SHA256 (rust/rustc-1.61.0-src.tar.xz) = a63305a3ad734f170746b337a5e3d07ccaa7aa8f253dc52336b44c0a3b549d7b +SIZE (rust/rustc-1.61.0-src.tar.xz) = 136696780 diff --git a/lang/rust/Makefile b/lang/rust/Makefile index f3fad6b4c84e..83a6ab41c6c8 100644 --- a/lang/rust/Makefile +++ b/lang/rust/Makefile @@ -1,316 +1,316 @@ # Created by: Jyun-Yan You PORTNAME= rust -PORTVERSION?= 1.60.0 +PORTVERSION?= 1.61.0 PORTREVISION?= 0 CATEGORIES= lang MASTER_SITES= https://static.rust-lang.org/dist/:src \ https://dev-static.rust-lang.org/dist/:src \ LOCAL/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_12_powerpc= is missing a bootstrap for FreeBSD 12.x powerpc ONLY_FOR_ARCHS?= aarch64 amd64 armv6 armv7 i386 powerpc64 powerpc64le \ powerpc riscv64 ONLY_FOR_ARCHS_REASON?= requires prebuilt bootstrap compiler BUILD_DEPENDS= cmake:devel/cmake LIB_DEPENDS= libcurl.so:ftp/curl USES= cpe ninja:build pkgconfig python:3.7+,build shebangfix ssl tar:xz CPE_VENDOR= rust-lang MAKE_ENV= DESTDIR=${STAGEDIR} \ LIBGIT2_NO_PKG_CONFIG=1 \ OPENSSL_DIR="${OPENSSLBASE}" TEST_ENV= ${MAKE_ENV} \ ALLOW_NONZERO_RLIMIT_CORE=1 CONFLICTS_INSTALL?= rust-nightly # rustc stashes intermediary files in TMPDIR (default /tmp) which # might cause issues for users that for some reason space limit # their /tmp. WRKDIR should have plenty of space. # ?= to allow users to still overwrite it in make.conf. TMPDIR?= ${WRKDIR} OPTIONS_DEFINE= DOCS GDB SOURCES WASM OPTIONS_DEFAULT= SOURCES WASM .if !defined(NIGHTLY_DATE) OPTIONS_EXCLUDE= DOCS # https://github.com/rust-lang/rust/issues/76526 .endif 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 SOURCES_VARS= _COMPONENTS+=rust-src-${_PACKAGE_VERS} \ _RUST_TOOLS+=src WASM_VARS= _COMPONENTS+="rust-analysis-${_PACKAGE_VERS}-wasm32-unknown-unknown rust-std-${_PACKAGE_VERS}-wasm32-unknown-unknown" \ _RUST_BUILD_WASM=true \ _RUST_TARGETS+=wasm32-unknown-unknown WASM_VARS_OFF= _RUST_BUILD_WASM=false # See WRKSRC/src/stage0.json for the date and version values -BOOTSTRAPS_DATE?= 2022-02-24 -RUST_BOOTSTRAP_VERSION?= 1.59.0 +BOOTSTRAPS_DATE?= 2022-05-19 +RUST_BOOTSTRAP_VERSION?= 1.60.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_ARCH_riscv64= riscv64gc _RUST_TARGET= ${_RUST_ARCH_${ARCH}:U${ARCH}}-unknown-${OPSYS:tl} _RUST_TARGETS= ${_RUST_TARGET} _RUST_TOOLS= analysis cargo clippy rustfmt _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-${RUST_BOOTSTRAP_VERSION_${ARCH}:U${RUST_BOOTSTRAP_VERSION}}-${_RUST_TARGET} _PACKAGE_VERS= ${NIGHTLY_DATE:?nightly:${PORTVERSION}} _COMPONENTS+= cargo-${_PACKAGE_VERS}-${_RUST_TARGET} \ clippy-${_PACKAGE_VERS}-${_RUST_TARGET} \ rustc-${_PACKAGE_VERS}-${_RUST_TARGET} \ rustfmt-${_PACKAGE_VERS}-${_RUST_TARGET} \ rust-analysis-${_PACKAGE_VERS}-${_RUST_TARGET} \ rust-std-${_PACKAGE_VERS}-${_RUST_TARGET} # https://github.com/bjorn3/rustc_codegen_cranelift/commit/83d470d91c15d0cb5890705291e6ee9e5be8a842 # https://github.com/rust-lang/rustc_codegen_gcc/pull/160 SHEBANG_FILES= compiler/rustc_codegen_cranelift/scripts/* \ compiler/rustc_codegen_gcc/*.sh compiler/rustc_codegen_gcc/build_sysroot/*.sh .include .if ${OPSYS} != FreeBSD IGNORE= is only for FreeBSD .endif .if ${ARCH} == powerpc # bfd to link rustc_driver; lld currently can't BUILD_DEPENDS+= ld.bfd:devel/binutils .else MAKE_ENV+= RUST_BACKTRACE=1 .endif # rls doesn't build on rust nightly # rls needs 64-bit atomics: it doesn't build on powerpc .if !defined(NIGHTLY_DATE) && ${ARCH} != powerpc _RUST_TOOLS+= rls _COMPONENTS+= rls-${_PACKAGE_VERS}-${_RUST_TARGET} .endif # per https://rust-lang.github.io/rustup/concepts/components.html # rustc-dev is only usefull on nightly .if defined(NIGHTLY_DATE) _COMPONENTS+= rustc-dev-${_PACKAGE_VERS}-${_RUST_TARGET} .endif .if exists(${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX}) EXTRA_PATCHES+= ${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX} .endif # If the kernel does not return sane kern.proc.pathname values # for hardlinks then disable hardlinks in the build to avoid # intermittent "can't find crate for `std`" build failures, # c.f. PR248184 # # XXX: Avoiding OSVERSION since it is derived from userland but # the running kernel might still be newer with sane behavior # anyway... .if exists(${PATCHDIR}/no-hardlinks) _KERN_OSRELDATE!= ${SYSCTL} -n kern.osreldate 2>/dev/null || echo 0 . if ${_KERN_OSRELDATE} >= 1400040 . elif ${_KERN_OSRELDATE} >= 1300521 . else EXTRA_PATCHES+= ${PATCHDIR}/no-hardlinks . endif .endif .if defined(PPC_ABI) && ${PPC_ABI} == ELFv1 # 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 STRIP_CMD= ${LOCALBASE}/bin/strip # unsupported e_type with base strip .endif .ifdef QEMU_EMULATING IGNORE= fails to build with qemu-user-static .endif .if make(makesum) DISTFILES:= ${DISTFILES:M*\:src} \ ${ONLY_FOR_ARCHS:O:@_arch@${:!${MAKE} ARCH=${_arch} PPC_ABI=ELFv1 -V'DISTFILES:N*\:src'!}@} \ ${ONLY_FOR_ARCHS:Mpowerpc64:@_arch@${:!${MAKE} ARCH=${_arch} PPC_ABI=ELFv2 -V'DISTFILES:N*\:src'!}@} .endif post-patch: @${REINPLACE_CMD} 's,gdb,${LOCALBASE}/bin/gdb,' ${WRKSRC}/src/etc/rust-gdb .if defined(NIGHTLY_DATE) @${REINPLACE_CMD} 's/"rustfmt"/"nothx"/' ${WRKSRC}/src/stage0.json .endif # Disable vendor checksums @${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \ ${CARGO_VENDOR_DIR}/*/.cargo-checksum.json .if defined(PPC_ABI) && ${PPC_ABI} == ELFv1 @${REINPLACE_CMD} 's,%CC%,${CC},g' \ ${WRKSRC}/compiler/rustc_llvm/build.rs \ ${WRKSRC}/src/bootstrap/native.rs .if ${LOCALBASE} != /usr/local @${REINPLACE_CMD} 's,/usr/local/,${LOCALBASE}/,g' \ ${WRKSRC}/compiler/rustc_llvm/build.rs \ ${WRKSRC}/src/bootstrap/native.rs .endif .endif 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 --prefix=${WRKDIR}/bootstrap --verbose .endfor @${ECHO_CMD} 'changelog-seen=2' > ${WRKSRC}/config.toml @${ECHO_CMD} '[build]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'build-dir="${WRKDIR}/_build"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'build-stage=2' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'doc-stage=2' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'test-stage=2' >> ${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} 'tools=[${_RUST_TOOLS:@.tool.@"${.tool.}"@:ts,}]' >> ${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} 'deny-warnings=false' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'verbose-tests=true' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'lld=${_RUST_BUILD_WASM}' >> ${WRKSRC}/config.toml @${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 @${ECHO_CMD} 'ninja=true' >> ${WRKSRC}/config.toml .if ${ARCH} == powerpc # Rust doesn't call the system compiler with the full version of the target. # This makes powerpc miscompile due to the secure-plt ABI change. # Additionally, force using ld.bfd to work around a linking problem in rustc_mir @${PRINTF} '#!/bin/sh\nexec ${CC} "$$@" --target=powerpc-unknown-freebsd13.0' > ${WRKDIR}/cc-wrapper @${CHMOD} +x ${WRKDIR}/cc-wrapper @${PRINTF} '#!/bin/sh\nexec ${CXX} "$$@" --target=powerpc-unknown-freebsd13.0' > ${WRKDIR}/cxx-wrapper @${CHMOD} +x ${WRKDIR}/cxx-wrapper @${PRINTF} '#!/bin/sh\nexec ${CC} -fuse-ld=bfd "$$@" --target=powerpc-unknown-freebsd13.0' > ${WRKDIR}/ld-wrapper @${CHMOD} +x ${WRKDIR}/ld-wrapper .endif .for _target in ${_RUST_TARGETS} @${ECHO_CMD} '[target.${_target}]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'ar="${AR}"' >> ${WRKSRC}/config.toml .if ${ARCH} == powerpc @${ECHO_CMD} 'cc="${WRKDIR}/cc-wrapper"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cxx="${WRKDIR}/cxx-wrapper"' >> ${WRKSRC}/config.toml .else @${ECHO_CMD} 'cc="${CC}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cxx="${CXX}"' >> ${WRKSRC}/config.toml .endif .if ${ARCH} == powerpc @${ECHO_CMD} 'linker="${WRKDIR}/ld-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 do-build: @cd ${WRKSRC} && \ ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} x.py dist --jobs=${MAKE_JOBS_NUMBER} do-install: ${RM} -r ${WRKDIR}/_extractdist .for _c in ${_COMPONENTS} ${MKDIR} ${WRKDIR}/_extractdist ${TAR} xf ${WRKDIR}/_build/dist/${_c}.tar.xz -C ${WRKDIR}/_extractdist cd ${WRKDIR}/_extractdist/${_c} && \ ${SH} install.sh \ --docdir="${STAGEDIR}${DOCSDIR}" \ --mandir="${STAGEDIR}${PREFIX}/share/man" \ --prefix="${STAGEDIR}${PREFIX}" ${RM} -r ${WRKDIR}/_extractdist .endfor # 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} ${STAGEDIR}${DOCSDIR}/*.old \ ${STAGEDIR}${PREFIX}/lib/rustlib/components \ ${STAGEDIR}${PREFIX}/lib/rustlib/install.log \ ${STAGEDIR}${PREFIX}/lib/rustlib/manifest-* \ ${STAGEDIR}${PREFIX}/lib/rustlib/rust-installer-version \ ${STAGEDIR}${PREFIX}/lib/rustlib/uninstall.sh @${FIND} ${STAGEDIR}${PREFIX}/bin ${STAGEDIR}${PREFIX}/lib \ ${STAGEDIR}${PREFIX}/libexec -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-DOCS-on: # Ignore any left behind empty directories in case some docs fail # to build (failures are ignored due to deny-warnings=false). @${FIND} ${STAGEDIR}${DOCSDIR}/html -empty -type d | \ ${SED} 's,^${STAGEDIR},@comment @dir ,' >> ${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} .include diff --git a/lang/rust/distinfo b/lang/rust/distinfo index da9267f9cf77..adf29895d635 100644 --- a/lang/rust/distinfo +++ b/lang/rust/distinfo @@ -1,63 +1,63 @@ -TIMESTAMP = 1649150849 -SHA256 (rust/rustc-1.60.0-src.tar.xz) = a025876deccbcb3f288d8e02623ea321f94623f31305d3c5c6f17855bb9685db -SIZE (rust/rustc-1.60.0-src.tar.xz) = 136183048 -SHA256 (rust/2022-02-24/rustc-1.59.0-aarch64-unknown-freebsd.tar.xz) = 0c3d2c9bc8491937932a992a489670025e3af85def7c1e539718c10e8ecd49c7 -SIZE (rust/2022-02-24/rustc-1.59.0-aarch64-unknown-freebsd.tar.xz) = 41050564 -SHA256 (rust/2022-02-24/rust-std-1.59.0-aarch64-unknown-freebsd.tar.xz) = d2486c8e4a98602901862856670635362ed7a3adde87468ef5d300d73c704c59 -SIZE (rust/2022-02-24/rust-std-1.59.0-aarch64-unknown-freebsd.tar.xz) = 22577656 -SHA256 (rust/2022-02-24/cargo-1.59.0-aarch64-unknown-freebsd.tar.xz) = 80d23f538affffcde6c48c263a2e6558958982e31da03d5ab3609c900d0f5dff -SIZE (rust/2022-02-24/cargo-1.59.0-aarch64-unknown-freebsd.tar.xz) = 4421792 -SHA256 (rust/2022-02-24/rustc-1.59.0-x86_64-unknown-freebsd.tar.xz) = 347fd661cc1c455f3b30fa53f759c9f2fcdac8f418ecf2df56c7967b7fc99f4d -SIZE (rust/2022-02-24/rustc-1.59.0-x86_64-unknown-freebsd.tar.xz) = 37789512 -SHA256 (rust/2022-02-24/rust-std-1.59.0-x86_64-unknown-freebsd.tar.xz) = 35ddf333c4c943851eb544e11531144c786a9a1fbf2e9e82e9a15a3aa9531f9a -SIZE (rust/2022-02-24/rust-std-1.59.0-x86_64-unknown-freebsd.tar.xz) = 22778748 -SHA256 (rust/2022-02-24/cargo-1.59.0-x86_64-unknown-freebsd.tar.xz) = 6066e3df548aef04b9ad9b0c7dd42e0a873d9dcae92e3ec6869ad7a7c947b459 -SIZE (rust/2022-02-24/cargo-1.59.0-x86_64-unknown-freebsd.tar.xz) = 5162252 -SHA256 (rust/2022-02-24/rustc-1.59.0-armv6-unknown-freebsd.tar.xz) = 622597d01bae8c134a4b94ea627507183f1274590b93147c9a8d18676b069ade -SIZE (rust/2022-02-24/rustc-1.59.0-armv6-unknown-freebsd.tar.xz) = 42435404 -SHA256 (rust/2022-02-24/rust-std-1.59.0-armv6-unknown-freebsd.tar.xz) = e39ab0f876741e9af5b51141ff696a8508e79897d51f66489f476243e2931469 -SIZE (rust/2022-02-24/rust-std-1.59.0-armv6-unknown-freebsd.tar.xz) = 20834404 -SHA256 (rust/2022-02-24/cargo-1.59.0-armv6-unknown-freebsd.tar.xz) = 5ff0274c0deddba82e17bbe79c12a356541604d9b153f585f51d1382998f41bc -SIZE (rust/2022-02-24/cargo-1.59.0-armv6-unknown-freebsd.tar.xz) = 4485388 -SHA256 (rust/2022-02-24/rustc-1.59.0-armv7-unknown-freebsd.tar.xz) = 1098292e557bfb7218478c08b0c1cdd0575ab7867311977b192a2180511d834c -SIZE (rust/2022-02-24/rustc-1.59.0-armv7-unknown-freebsd.tar.xz) = 42455852 -SHA256 (rust/2022-02-24/rust-std-1.59.0-armv7-unknown-freebsd.tar.xz) = 387644c5dded45b54c0f1b433851904b0afc6eb57e2c64b8cf43be50835e52e7 -SIZE (rust/2022-02-24/rust-std-1.59.0-armv7-unknown-freebsd.tar.xz) = 21911820 -SHA256 (rust/2022-02-24/cargo-1.59.0-armv7-unknown-freebsd.tar.xz) = 7458e91fc799b191b2a5a0d7be03b49568979f1bf9086aa9207c20b49f348da3 -SIZE (rust/2022-02-24/cargo-1.59.0-armv7-unknown-freebsd.tar.xz) = 4472188 -SHA256 (rust/2022-02-24/rustc-1.59.0-i686-unknown-freebsd.tar.xz) = 2c7a633fdd4baed67fec386b42240bade2b467656a1fbbf6add440183563c27c -SIZE (rust/2022-02-24/rustc-1.59.0-i686-unknown-freebsd.tar.xz) = 46912192 -SHA256 (rust/2022-02-24/rust-std-1.59.0-i686-unknown-freebsd.tar.xz) = 3964122e38d71c8e85bdfebf526e8145444ba327a1e4df7108b85818e36ba7cd -SIZE (rust/2022-02-24/rust-std-1.59.0-i686-unknown-freebsd.tar.xz) = 22754924 -SHA256 (rust/2022-02-24/cargo-1.59.0-i686-unknown-freebsd.tar.xz) = ba02bbfd73608fe77629a04baa20664f0b503e9e1b07f4c0a3f87dcdbc4c3651 -SIZE (rust/2022-02-24/cargo-1.59.0-i686-unknown-freebsd.tar.xz) = 5300496 -SHA256 (rust/2022-02-24/rustc-1.59.0-powerpc-unknown-freebsd.tar.xz) = c3a100399552b7fb1bccfcd702357e57ccb924cace09026cabbd22af0f9274c6 -SIZE (rust/2022-02-24/rustc-1.59.0-powerpc-unknown-freebsd.tar.xz) = 43965252 -SHA256 (rust/2022-02-24/rust-std-1.59.0-powerpc-unknown-freebsd.tar.xz) = 16e0139998cec181d4c31c323b069498a933fe3a2bf7ac6b27198510802a492f -SIZE (rust/2022-02-24/rust-std-1.59.0-powerpc-unknown-freebsd.tar.xz) = 20527232 -SHA256 (rust/2022-02-24/cargo-1.59.0-powerpc-unknown-freebsd.tar.xz) = 3ebebe88bcd43ed0367b8060c9f5065b7d34132f5dc8d4102ed3be9f55ff19f8 -SIZE (rust/2022-02-24/cargo-1.59.0-powerpc-unknown-freebsd.tar.xz) = 4890476 -SHA256 (rust/2022-02-24/rustc-1.59.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 97ad75f47fb6a1044f9b917d5a6ffbcfb0dadc8a878fd851acc333d3deceb19c -SIZE (rust/2022-02-24/rustc-1.59.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 50379384 -SHA256 (rust/2022-02-24/rust-std-1.59.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 33e9fa830279431040cfe3e6cc0feb2a24b2c8c2d44546051ad8019bb98de5ef -SIZE (rust/2022-02-24/rust-std-1.59.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 20765208 -SHA256 (rust/2022-02-24/cargo-1.59.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = ffdc5207e74e5ffce283ab3166d2876a2721110bc5edae8005f9493a55582f38 -SIZE (rust/2022-02-24/cargo-1.59.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 4976872 -SHA256 (rust/2022-02-24/rustc-1.59.0-powerpc64le-unknown-freebsd.tar.xz) = 1e06b3bcb63cc4498436c70d236d5c6e7b98aa92b07b01b1f7ef9f2a2e5e0887 -SIZE (rust/2022-02-24/rustc-1.59.0-powerpc64le-unknown-freebsd.tar.xz) = 44181548 -SHA256 (rust/2022-02-24/rust-std-1.59.0-powerpc64le-unknown-freebsd.tar.xz) = d6a8ec902b529ee048bac70ea8e3989317167052a3438fef3763755b720d833f -SIZE (rust/2022-02-24/rust-std-1.59.0-powerpc64le-unknown-freebsd.tar.xz) = 20722244 -SHA256 (rust/2022-02-24/cargo-1.59.0-powerpc64le-unknown-freebsd.tar.xz) = 5bb65faeea8be4f76a898b0e86e3de189b87a3a928e0a51036e616a607c67154 -SIZE (rust/2022-02-24/cargo-1.59.0-powerpc64le-unknown-freebsd.tar.xz) = 4893140 -SHA256 (rust/2022-02-24/rustc-1.59.0-riscv64gc-unknown-freebsd.tar.xz) = 919e17d5962a434cde698f020e30fd8b08e53abb94da952851699e06b186712d -SIZE (rust/2022-02-24/rustc-1.59.0-riscv64gc-unknown-freebsd.tar.xz) = 138775268 -SHA256 (rust/2022-02-24/rust-std-1.59.0-riscv64gc-unknown-freebsd.tar.xz) = f6c4ab3f101ed628f52ae4a426ad94ff531b51986998cf118321ab12d31249c7 -SIZE (rust/2022-02-24/rust-std-1.59.0-riscv64gc-unknown-freebsd.tar.xz) = 28278800 -SHA256 (rust/2022-02-24/cargo-1.59.0-riscv64gc-unknown-freebsd.tar.xz) = 3bd8b26b91b85b318e29ed27862a5214f5abec1c9479915679c66bdb805e579f -SIZE (rust/2022-02-24/cargo-1.59.0-riscv64gc-unknown-freebsd.tar.xz) = 24261364 -SHA256 (rust/2022-02-24/rustc-1.59.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 143acd58436b3e469effc8fa38c2de036ed29d4a21ea78d0778b451ff92c346b -SIZE (rust/2022-02-24/rustc-1.59.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 42083776 -SHA256 (rust/2022-02-24/rust-std-1.59.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 760b5baa42f654bcf0e26a62f48527150186024cd227cd676195aa101005d5ea -SIZE (rust/2022-02-24/rust-std-1.59.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 20682952 -SHA256 (rust/2022-02-24/cargo-1.59.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 1358d9dad2379f4342e6b189280c2bf42e1bb1de8269bba95f04d0f05c5d206e -SIZE (rust/2022-02-24/cargo-1.59.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 4645868 +TIMESTAMP = 1653476014 +SHA256 (rust/rustc-1.61.0-src.tar.xz) = a63305a3ad734f170746b337a5e3d07ccaa7aa8f253dc52336b44c0a3b549d7b +SIZE (rust/rustc-1.61.0-src.tar.xz) = 136696780 +SHA256 (rust/2022-05-19/rustc-1.60.0-aarch64-unknown-freebsd.tar.xz) = 856171555e0bad6cfcf7fbf162785af6b26307261d4fc0af72a9fb946c7aaa3c +SIZE (rust/2022-05-19/rustc-1.60.0-aarch64-unknown-freebsd.tar.xz) = 41938500 +SHA256 (rust/2022-05-19/rust-std-1.60.0-aarch64-unknown-freebsd.tar.xz) = 6c9ae993d4ddf008389ff34fa069ffe3743ce3ca7b72968a32108e8fcf00aefb +SIZE (rust/2022-05-19/rust-std-1.60.0-aarch64-unknown-freebsd.tar.xz) = 23049616 +SHA256 (rust/2022-05-19/cargo-1.60.0-aarch64-unknown-freebsd.tar.xz) = 8c12e7434ce7961846b9337d60234de3ead26d5d42c102aaf0600fa06cd78318 +SIZE (rust/2022-05-19/cargo-1.60.0-aarch64-unknown-freebsd.tar.xz) = 4621520 +SHA256 (rust/2022-05-19/rustc-1.60.0-x86_64-unknown-freebsd.tar.xz) = 50a593550807f849a5401b10c5c4e939b2d5a2bd51cc74ee16c684e169f40910 +SIZE (rust/2022-05-19/rustc-1.60.0-x86_64-unknown-freebsd.tar.xz) = 37933600 +SHA256 (rust/2022-05-19/rust-std-1.60.0-x86_64-unknown-freebsd.tar.xz) = 729fc5586175ae264878ff55358931dca8f89e4be35bcadb25f28423d970ae94 +SIZE (rust/2022-05-19/rust-std-1.60.0-x86_64-unknown-freebsd.tar.xz) = 22996636 +SHA256 (rust/2022-05-19/cargo-1.60.0-x86_64-unknown-freebsd.tar.xz) = 119141aafce4214c80042023049defe8202428de1da75b3ffe915e82880c8bbf +SIZE (rust/2022-05-19/cargo-1.60.0-x86_64-unknown-freebsd.tar.xz) = 5334672 +SHA256 (rust/2022-05-19/rustc-1.60.0-armv6-unknown-freebsd.tar.xz) = 0f39168f1aa52865409421ec542f6b4c6ea2b282b5fd0a915b4a06dffef4095d +SIZE (rust/2022-05-19/rustc-1.60.0-armv6-unknown-freebsd.tar.xz) = 42659216 +SHA256 (rust/2022-05-19/rust-std-1.60.0-armv6-unknown-freebsd.tar.xz) = 5a8ae5c6e22d323780e332758b0523b0be644c748718b0a4c11669457e3255b4 +SIZE (rust/2022-05-19/rust-std-1.60.0-armv6-unknown-freebsd.tar.xz) = 21039444 +SHA256 (rust/2022-05-19/cargo-1.60.0-armv6-unknown-freebsd.tar.xz) = 850d5a38dc64e6e1538aca3fb42fbff3708f08443ca5608d3599f5283efaf1c6 +SIZE (rust/2022-05-19/cargo-1.60.0-armv6-unknown-freebsd.tar.xz) = 4627940 +SHA256 (rust/2022-05-19/rustc-1.60.0-armv7-unknown-freebsd.tar.xz) = fb2a4409108708840736603e47c9e0cb3652700d24cd7c961a5b1624d247ddf4 +SIZE (rust/2022-05-19/rustc-1.60.0-armv7-unknown-freebsd.tar.xz) = 42735092 +SHA256 (rust/2022-05-19/rust-std-1.60.0-armv7-unknown-freebsd.tar.xz) = b640f71a425488f22560d08810c73b913794ac246a730d6983bd19bdf4d0f973 +SIZE (rust/2022-05-19/rust-std-1.60.0-armv7-unknown-freebsd.tar.xz) = 22363208 +SHA256 (rust/2022-05-19/cargo-1.60.0-armv7-unknown-freebsd.tar.xz) = a731efeffd1b9d735bfd867974a0c367317155e827ca334b0369824a32519e37 +SIZE (rust/2022-05-19/cargo-1.60.0-armv7-unknown-freebsd.tar.xz) = 4617840 +SHA256 (rust/2022-05-19/rustc-1.60.0-i686-unknown-freebsd.tar.xz) = 66bf481268d5639034a4eb89658e1620c03b153b29853264801a999a8261f830 +SIZE (rust/2022-05-19/rustc-1.60.0-i686-unknown-freebsd.tar.xz) = 47012508 +SHA256 (rust/2022-05-19/rust-std-1.60.0-i686-unknown-freebsd.tar.xz) = 5bc6b3abb047d6313464af484b34fe33648b79e128b31afd201733ea8ec966fd +SIZE (rust/2022-05-19/rust-std-1.60.0-i686-unknown-freebsd.tar.xz) = 23148528 +SHA256 (rust/2022-05-19/cargo-1.60.0-i686-unknown-freebsd.tar.xz) = 6d8beb4292c192d8ff1dc3684ab881fdf7ea0a6b9bd141329bf939fe670d82a4 +SIZE (rust/2022-05-19/cargo-1.60.0-i686-unknown-freebsd.tar.xz) = 5495444 +SHA256 (rust/2022-05-19/rustc-1.60.0-powerpc-unknown-freebsd.tar.xz) = 8e1a2c1850a89f5ef7dd18ed5236effe4395dc95732cea6179420fb1b3f32209 +SIZE (rust/2022-05-19/rustc-1.60.0-powerpc-unknown-freebsd.tar.xz) = 44903352 +SHA256 (rust/2022-05-19/rust-std-1.60.0-powerpc-unknown-freebsd.tar.xz) = ed55aad34ce284e84d9937ffcb812a3a926afbf7cb683afd396f2149fa821156 +SIZE (rust/2022-05-19/rust-std-1.60.0-powerpc-unknown-freebsd.tar.xz) = 20867312 +SHA256 (rust/2022-05-19/cargo-1.60.0-powerpc-unknown-freebsd.tar.xz) = 4f64bebbdbfb34fed496d4962b9e64085a8b9e35483f93032f8574cb8d387245 +SIZE (rust/2022-05-19/cargo-1.60.0-powerpc-unknown-freebsd.tar.xz) = 5054540 +SHA256 (rust/2022-05-19/rustc-1.60.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = f2f1e5bb5fa73edc58253cdf7eacfc172c46f922b7d3126913dc8e328a87f433 +SIZE (rust/2022-05-19/rustc-1.60.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 50827868 +SHA256 (rust/2022-05-19/rust-std-1.60.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = bf05dbc2ed003cacbe99505456ce3886f11c51b0e828322bad912657726b7426 +SIZE (rust/2022-05-19/rust-std-1.60.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 20999060 +SHA256 (rust/2022-05-19/cargo-1.60.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 3c6f48a3e59590cdd250ca8a7454d34923b1ab004f22e78c63c9ee97ed3b85cc +SIZE (rust/2022-05-19/cargo-1.60.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 5141224 +SHA256 (rust/2022-05-19/rustc-1.60.0-powerpc64le-unknown-freebsd.tar.xz) = 4441542942feb74e50f19d0bcc0918deb601abb49c54a0eec4f0653fd3776a6d +SIZE (rust/2022-05-19/rustc-1.60.0-powerpc64le-unknown-freebsd.tar.xz) = 44720396 +SHA256 (rust/2022-05-19/rust-std-1.60.0-powerpc64le-unknown-freebsd.tar.xz) = c1cf4efcf22cc7283529029abcea0a21c2347f96d1814398f62bb4d4125db9ea +SIZE (rust/2022-05-19/rust-std-1.60.0-powerpc64le-unknown-freebsd.tar.xz) = 21150980 +SHA256 (rust/2022-05-19/cargo-1.60.0-powerpc64le-unknown-freebsd.tar.xz) = 69c4c4ab60f09c4422a6840ff74cff12ebfc0637e0d141765afcdb8525085058 +SIZE (rust/2022-05-19/cargo-1.60.0-powerpc64le-unknown-freebsd.tar.xz) = 5076628 +SHA256 (rust/2022-05-19/rustc-1.60.0-riscv64gc-unknown-freebsd.tar.xz) = af8c38fa28f13d8edbd24d1bb05a0f37921dec31a945ac941a6fb7919d1f46e1 +SIZE (rust/2022-05-19/rustc-1.60.0-riscv64gc-unknown-freebsd.tar.xz) = 143639456 +SHA256 (rust/2022-05-19/rust-std-1.60.0-riscv64gc-unknown-freebsd.tar.xz) = 1f42fd5787029321bc33ec4cd4c1cb727d4408a535547617e311bfd37ae7d229 +SIZE (rust/2022-05-19/rust-std-1.60.0-riscv64gc-unknown-freebsd.tar.xz) = 28941004 +SHA256 (rust/2022-05-19/cargo-1.60.0-riscv64gc-unknown-freebsd.tar.xz) = 8859047df077edad1fe1707e4ed61739fcfdd9d895c4fd44964510934a98798e +SIZE (rust/2022-05-19/cargo-1.60.0-riscv64gc-unknown-freebsd.tar.xz) = 26042744 +SHA256 (rust/2022-05-19/rustc-1.60.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 0b84323d8654ed8fb4e9661b9d4e2e6a98a93b6336fd74a2b40de0549c8dae69 +SIZE (rust/2022-05-19/rustc-1.60.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 42733192 +SHA256 (rust/2022-05-19/rust-std-1.60.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 2d2dd654594796cfa241143fbe2c275075f7c8e62dd423867b3dfc27f30e482b +SIZE (rust/2022-05-19/rust-std-1.60.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 20979640 +SHA256 (rust/2022-05-19/cargo-1.60.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = cd104531239d5a854e1ce53e5c9f2239ed6d535b9e81b61ee880b8a55bc033a9 +SIZE (rust/2022-05-19/cargo-1.60.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 4795344 diff --git a/lang/rust/files/no-hardlinks/patch-src_bootstrap_native.rs b/lang/rust/files/no-hardlinks/patch-src_bootstrap_native.rs index 18a334c6b76c..2e4a03cd315c 100644 --- a/lang/rust/files/no-hardlinks/patch-src_bootstrap_native.rs +++ b/lang/rust/files/no-hardlinks/patch-src_bootstrap_native.rs @@ -1,35 +1,40 @@ 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-08-24 15:00:49 UTC +++ src/bootstrap/native.rs -@@ -517,26 +522,9 @@ impl Step for Lld { +@@ -634,22 +634,6 @@ impl Step for Lld { let mut cfg = cmake::Config::new(builder.src.join("src/llvm-project/lld")); - configure_cmake(builder, target, &mut cfg, true); + configure_cmake(builder, target, &mut cfg, true, LdFlags::default()); - // 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"); - + // Re-use the same flags as llvm to control the level of debug information + // generated for lld. + let profile = match (builder.config.llvm_optimize, builder.config.llvm_release_debuginfo) { +@@ -660,8 +644,7 @@ impl Step for Lld { + cfg.out_dir(&out_dir) - .profile("Release") + .profile(profile) - .env("LLVM_CONFIG_REAL", &llvm_config) - .define("LLVM_CONFIG_PATH", llvm_config_shim) + .define("LLVM_CONFIG_PATH", &llvm_config) .define("LLVM_INCLUDE_TESTS", "OFF"); // While we're using this horrible workaround to shim the execution of diff --git a/lang/rust/files/patch-compiler_rustc__target_src_spec_i686__unknown__freebsd.rs b/lang/rust/files/patch-compiler_rustc__target_src_spec_i686__unknown__freebsd.rs index 9d3dc5a067aa..0bbcd7b0f70d 100644 --- a/lang/rust/files/patch-compiler_rustc__target_src_spec_i686__unknown__freebsd.rs +++ b/lang/rust/files/patch-compiler_rustc__target_src_spec_i686__unknown__freebsd.rs @@ -1,11 +1,11 @@ --- compiler/rustc_target/src/spec/i686_unknown_freebsd.rs.orig 2020-01-23 19:40:44 UTC +++ compiler/rustc_target/src/spec/i686_unknown_freebsd.rs -@@ -2,7 +2,7 @@ use crate::spec::{LinkerFlavor, Target, TargetResult}; +@@ -2,7 +2,7 @@ pub fn target() -> Target { - pub fn target() -> TargetResult { + pub fn target() -> Target { let mut base = super::freebsd_base::opts(); -- base.cpu = "pentium4".to_string(); -+ base.cpu = "pentiumpro".to_string(); +- base.cpu = "pentium4".into(); ++ base.cpu = "pentiumpro".into(); base.max_atomic_width = Some(64); - let pre_link_args = base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap(); - pre_link_args.push("-m32".to_string()); + let pre_link_args = base.pre_link_args.entry(LinkerFlavor::Gcc).or_default(); + pre_link_args.push("-m32".into()); diff --git a/lang/rust/files/patch-src_llvm-project_llvm_lib_Transforms_Vectorize_LoopVectorize.cpp b/lang/rust/files/patch-src_llvm-project_llvm_lib_Transforms_Vectorize_LoopVectorize.cpp new file mode 100644 index 000000000000..4713a0b67630 --- /dev/null +++ b/lang/rust/files/patch-src_llvm-project_llvm_lib_Transforms_Vectorize_LoopVectorize.cpp @@ -0,0 +1,62 @@ +Fix a SIGFPE when building sysutils/exa +https://github.com/ogham/exa/issues/1068 +https://bugs.gentoo.org/847421 + +From fe8a27acd716a42667f5a572f52f2b04636010ff Mon Sep 17 00:00:00 2001 +From: Florian Hahn +Date: Tue, 29 Mar 2022 22:52:42 +0100 +Subject: [PATCH] [LV] Handle zero cost loops in selectInterleaveCount. + +In some case, like in the added test case, we can reach +selectInterleaveCount with loops that actually have a cost of 0. + +Unfortunately a loop cost of 0 is also used to communicate that the cost +has not been computed yet. To resolve the crash, bail out if the cost +remains zero after computing it. + +This seems like the best option, as there are multiple code paths that +return a cost of 0 to force a computation in selectInterleaveCount. +Computing the cost at multiple places up front there would unnecessarily +complicate the logic. + +Fixes #54413. + +(cherry picked from commit ecb4171dcbf1b433c9963fd605a74898303e850d) +--- src/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp.orig 2022-03-23 19:37:48.000000000 +0100 ++++ src/llvm-project/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp 2022-05-27 15:16:30.510761000 +0200 +@@ -6035,6 +6035,18 @@ unsigned LoopVectorizationCostModel::selectInterleaveC + !(InterleaveSmallLoopScalarReduction && HasReductions && VF.isScalar())) + return 1; + ++ // If we did not calculate the cost for VF (because the user selected the VF) ++ // then we calculate the cost of VF here. ++ if (LoopCost == 0) { ++ InstructionCost C = expectedCost(VF).first; ++ assert(C.isValid() && "Expected to have chosen a VF with valid cost"); ++ LoopCost = *C.getValue(); ++ ++ // Loop body is free and there is no need for interleaving. ++ if (LoopCost == 0) ++ return 1; ++ } ++ + RegisterUsage R = calculateRegisterUsage({VF})[0]; + // We divide by these constants so assume that we have at least one + // instruction that uses at least one register. +@@ -6125,16 +6137,6 @@ unsigned LoopVectorizationCostModel::selectInterleaveC + IC = std::max(1u, IC); + + assert(IC > 0 && "Interleave count must be greater than 0."); +- +- // If we did not calculate the cost for VF (because the user selected the VF) +- // then we calculate the cost of VF here. +- if (LoopCost == 0) { +- InstructionCost C = expectedCost(VF).first; +- assert(C.isValid() && "Expected to have chosen a VF with valid cost"); +- LoopCost = *C.getValue(); +- } +- +- assert(LoopCost && "Non-zero loop cost expected"); + + // Interleave if we vectorized this loop and there is a reduction that could + // benefit from interleaving. diff --git a/lang/rust/files/patch-src_llvm-project_llvm_lib_Transforms_Vectorize_VectorCombine.cpp b/lang/rust/files/patch-src_llvm-project_llvm_lib_Transforms_Vectorize_VectorCombine.cpp new file mode 100644 index 000000000000..88fde2f621e3 --- /dev/null +++ b/lang/rust/files/patch-src_llvm-project_llvm_lib_Transforms_Vectorize_VectorCombine.cpp @@ -0,0 +1,49 @@ +Fix a SIGFPE when building sysutils/exa +https://github.com/ogham/exa/issues/1068 +https://bugs.gentoo.org/847421 + + +From 67a290460c374d5e0d18a06c798896cac0b19e59 Mon Sep 17 00:00:00 2001 +From: Fraser Cormack +Date: Wed, 16 Mar 2022 10:14:07 +0000 +Subject: [PATCH] [VectorCombine] Insert addrspacecast when crossing address + space boundaries + +We can not bitcast pointers across different address spaces. This was +previously fixed in D89577 but then in D93229 an enhancement was added +which peeks further through the ponter operand, opening up the +possibility that address-space violations could be introduced. + +Instead of bailing as the previous fix did, simply insert an +addrspacecast cast instruction. + +Reviewed By: lebedev.ri + +Differential Revision: https://reviews.llvm.org/D121787 + +(cherry picked from commit 2e44b7872bc638ed884ae4aa86e38b3b47e0b65a) +--- src/llvm-project/llvm/lib/Transforms/Vectorize/VectorCombine.cpp.orig 2022-03-23 19:37:48.000000000 +0100 ++++ src/llvm-project/llvm/lib/Transforms/Vectorize/VectorCombine.cpp 2022-05-27 15:16:24.686183000 +0200 +@@ -152,12 +152,7 @@ bool VectorCombine::vectorizeLoadInsert(Instruction &I + Value *SrcPtr = Load->getPointerOperand()->stripPointerCasts(); + assert(isa(SrcPtr->getType()) && "Expected a pointer type"); + +- // If original AS != Load's AS, we can't bitcast the original pointer and have +- // to use Load's operand instead. Ideally we would want to strip pointer casts +- // without changing AS, but there's no API to do that ATM. + unsigned AS = Load->getPointerAddressSpace(); +- if (AS != SrcPtr->getType()->getPointerAddressSpace()) +- SrcPtr = Load->getPointerOperand(); + + // We are potentially transforming byte-sized (8-bit) memory accesses, so make + // sure we have all of our type-based constraints in place for this target. +@@ -245,7 +240,8 @@ bool VectorCombine::vectorizeLoadInsert(Instruction &I + // It is safe and potentially profitable to load a vector directly: + // inselt undef, load Scalar, 0 --> load VecPtr + IRBuilder<> Builder(Load); +- Value *CastedPtr = Builder.CreateBitCast(SrcPtr, MinVecTy->getPointerTo(AS)); ++ Value *CastedPtr = Builder.CreatePointerBitCastOrAddrSpaceCast( ++ SrcPtr, MinVecTy->getPointerTo(AS)); + Value *VecLd = Builder.CreateAlignedLoad(MinVecTy, CastedPtr, Alignment); + VecLd = Builder.CreateShuffleVector(VecLd, Mask); + diff --git a/lang/rust/files/patch-src_tools_cargo_src_cargo_sources_git_source.rs b/lang/rust/files/patch-src_tools_cargo_src_cargo_sources_git_source.rs index 90312d1fb270..ee09c8d53031 100644 --- a/lang/rust/files/patch-src_tools_cargo_src_cargo_sources_git_source.rs +++ b/lang/rust/files/patch-src_tools_cargo_src_cargo_sources_git_source.rs @@ -1,45 +1,46 @@ We run cargo update during USES=cargo ports builds to update specific crates and patch Cargo.lock for us. For normal crates this is based on what's available in the vendor dir. For Git sources this pulls new changes from the net instead even if we replace the source with a static path in a patch section in the config file. Add a hack to skip this. This is for experimentation to solve [1]. For this to maybe be useful for USES=cargo, the patch-in-config feature also needs to be stabilized first. It will be available in Rust 1.56. [1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=256581 ---- src/tools/cargo/src/cargo/sources/git/source.rs.orig 2021-09-06 18:42:51 UTC +--- src/tools/cargo/src/cargo/sources/git/source.rs.orig 2021-10-04 20:59:57 UTC +++ src/tools/cargo/src/cargo/sources/git/source.rs -@@ -84,6 +84,9 @@ impl<'cfg> Debug for GitSource<'cfg> { +@@ -86,6 +86,9 @@ impl<'cfg> Source for GitSource<'cfg> { impl<'cfg> Source for GitSource<'cfg> { - fn query(&mut self, dep: &Dependency, f: &mut dyn FnMut(Summary)) -> CargoResult<()> { + fn query(&mut self, dep: &Dependency, f: &mut dyn FnMut(Summary)) -> Poll> { + if std::env::var("CARGO_FREEBSD_PORTS_SKIP_GIT_UPDATE").is_ok() { -+ return Ok(()); ++ return Poll::Ready(Ok(())); + } - let src = self - .path_source - .as_mut() -@@ -92,6 +95,9 @@ impl<'cfg> Source for GitSource<'cfg> { - } - - fn fuzzy_query(&mut self, dep: &Dependency, f: &mut dyn FnMut(Summary)) -> CargoResult<()> { + if let Some(src) = self.path_source.as_mut() { + src.query(dep, f) + } else { +@@ -98,6 +101,9 @@ impl<'cfg> Source for GitSource<'cfg> { + dep: &Dependency, + f: &mut dyn FnMut(Summary), + ) -> Poll> { + if std::env::var("CARGO_FREEBSD_PORTS_SKIP_GIT_UPDATE").is_ok() { -+ return Ok(()); ++ return Poll::Ready(Ok(())); + } - let src = self - .path_source - .as_mut() -@@ -112,6 +118,9 @@ impl<'cfg> Source for GitSource<'cfg> { - } + if let Some(src) = self.path_source.as_mut() { + src.fuzzy_query(dep, f) + } else { +@@ -119,6 +125,10 @@ impl<'cfg> Source for GitSource<'cfg> { - fn update(&mut self) -> CargoResult<()> { -+ if std::env::var("CARGO_FREEBSD_PORTS_SKIP_GIT_UPDATE").is_ok() { + fn block_until_ready(&mut self) -> CargoResult<()> { + if self.path_source.is_some() { + return Ok(()); + } - let git_path = self.config.git_path(); - let git_path = self.config.assert_package_cache_locked(&git_path); - let db_path = git_path.join("db").join(&self.ident); ++ ++ if std::env::var("CARGO_FREEBSD_PORTS_SKIP_GIT_UPDATE").is_ok() { + return Ok(()); + } + diff --git a/lang/rust/files/powerpc64-elfv2/patch-compiler_rustc__target_src_spec_powerpc64__unknown__freebsd.rs b/lang/rust/files/powerpc64-elfv2/patch-compiler_rustc__target_src_spec_powerpc64__unknown__freebsd.rs index 5525c1f5aaac..22b0f628dade 100644 --- a/lang/rust/files/powerpc64-elfv2/patch-compiler_rustc__target_src_spec_powerpc64__unknown__freebsd.rs +++ b/lang/rust/files/powerpc64-elfv2/patch-compiler_rustc__target_src_spec_powerpc64__unknown__freebsd.rs @@ -1,14 +1,14 @@ --- compiler/rustc_target/src/spec/powerpc64_unknown_freebsd.rs.orig 2020-12-29 04:03:08 UTC +++ compiler/rustc_target/src/spec/powerpc64_unknown_freebsd.rs -@@ -11,6 +11,10 @@ pub fn target() -> Target { +@@ -12,6 +12,10 @@ pub fn target() -> Target { pointer_width: 64, - data_layout: "E-m:e-i64:64-n32:64".to_string(), - arch: "powerpc64".to_string(), -- options: TargetOptions { endian: Endian::Big, mcount: "_mcount".to_string(), ..base }, + data_layout: "E-m:e-i64:64-n32:64".into(), + arch: "powerpc64".into(), +- options: TargetOptions { endian: Endian::Big, mcount: "_mcount".into(), ..base }, + options: TargetOptions { + endian: Endian::Big, -+ mcount: "_mcount".to_string(), -+ llvm_abiname: "elfv2".to_string(), ++ mcount: "_mcount".into(), ++ llvm_abiname: "elfv2".into(), + ..base }, } }