diff --git a/Mk/Uses/cargo.mk b/Mk/Uses/cargo.mk index 6a1f50bbd964..1388099dd895 100644 --- a/Mk/Uses/cargo.mk +++ b/Mk/Uses/cargo.mk @@ -1,353 +1,353 @@ # 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 # 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 # 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} .endfor # Build dependencies. CARGO_BUILDDEP?= yes .if ${CARGO_BUILDDEP:tl} == "yes" -BUILD_DEPENDS+= ${RUST_DEFAULT}>=1.52.1:lang/${RUST_DEFAULT} +BUILD_DEPENDS+= ${RUST_DEFAULT}>=1.53.0:lang/${RUST_DEFAULT} .endif # Location of cargo binary (default to lang/rust's Cargo binary) CARGO_CARGO_BIN?= ${LOCALBASE}/bin/cargo # Location of the cargo output directory. CARGO_TARGET_DIR?= ${WRKDIR}/target # 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_TARGET_DIR=${CARGO_TARGET_DIR} \ RUST_BACKTRACE=1 \ RUSTC=${LOCALBASE}/bin/rustc \ RUSTDOC=${LOCALBASE}/bin/rustdoc \ RUSTFLAGS="${RUSTFLAGS} -C linker=${CC:Q} ${LDFLAGS:C/.+/-C link-arg=&/}" # 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:Mpowerpc64*} 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_CARGO_RUN= \ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${CARGO_ENV} \ ${CARGO_CARGO_BIN} # 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 # Set CARGO_USE_GIT{HUB,LAB} to yes if your application requires # some dependencies from git repositories hosted on GitHub or # GitLab instances. All Cargo.toml files will be patched to point # to the right offline sources based on what is defined in # {GH,GL}_TUPLE. This makes sure that cargo does not attempt to # access the network during the build. CARGO_USE_GITHUB?= no CARGO_USE_GITLAB?= no # 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 _crate in ${CARGO_CRATES} @${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 .endfor _CARGO_GIT_PATCH_CARGOTOML= .if ${CARGO_USE_GITHUB:tl} == "yes" . for _group in ${GH_TUPLE:C@^[^:]*:[^:]*:[^:]*:(([^:/]*)?)((/.*)?)@\2@} . if empty(CARGO_GIT_SUBDIR:M${_group}\:*) _CARGO_GIT_PATCH_CARGOTOML:= ${_CARGO_GIT_PATCH_CARGOTOML} \ -e "s@git *= *['\"](https|http|git)://github.com/${GH_ACCOUNT_${_group}}/${GH_PROJECT_${_group}}(\.git)?/?[\"']@path = \"${WRKSRC_${_group}}\"@" . else . for _group2 _crate _subdir in ${CARGO_GIT_SUBDIR:M${_group}\:*:S,:, ,g} _CARGO_GIT_PATCH_CARGOTOML:= ${_CARGO_GIT_PATCH_CARGOTOML} \ -e "/^${_crate} =/ s@git *= *['\"](https|http|git)://github.com/${GH_ACCOUNT_${_group}}/${GH_PROJECT_${_group}}(\.git)?/?[\"']@path = \"${WRKSRC_${_group}}/${_subdir}\"@" . endfor . endif . endfor .endif .if ${CARGO_USE_GITLAB:tl} == "yes" . for _group in ${GL_TUPLE:C@^(([^:]*://[^:/]*(:[0-9]{1,5})?(/[^:]*[^/])?:)?)([^:]*):([^:]*):([^:]*)(:[^:/]*)((/.*)?)@\8@:S/^://} . if empty(CARGO_GIT_SUBDIR:M${_group}\:*) _CARGO_GIT_PATCH_CARGOTOML:= ${_CARGO_GIT_PATCH_CARGOTOML} \ -e "s@git *= *['\"]${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}(\.git)?/?['\"]@path = \"${WRKSRC_${_group}}\"@" . else . for _group2 _crate _subdir in ${CARGO_GIT_SUBDIR:M${_group}\:*:S,:, ,g} _CARGO_GIT_PATCH_CARGOTOML:= ${_CARGO_GIT_PATCH_CARGOTOML} \ -e "/^${_crate} = / s@git *= *['\"]${GL_SITE_${_group}}/${GL_ACCOUNT_${_group}}/${GL_PROJECT_${_group}}(\.git)?/?['\"]@path = \"${WRKSRC_${_group}}/${_subdir}\"@" . endfor . endif . endfor .endif .if !empty(_CARGO_GIT_PATCH_CARGOTOML) _USES_patch+= 600:cargo-patch-git cargo-patch-git: @${FIND} ${WRKDIR} -name Cargo.toml -type f -exec \ ${SED} -i.dist -E ${_CARGO_GIT_PATCH_CARGOTOML} {} + .endif .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 @${MKDIR} ${WRKDIR}/.cargo @${ECHO_CMD} "[source.cargo]" > ${WRKDIR}/.cargo/config @${ECHO_CMD} "directory = '${CARGO_VENDOR_DIR}'" >> ${WRKDIR}/.cargo/config @${ECHO_CMD} "[source.crates-io]" >> ${WRKDIR}/.cargo/config @${ECHO_CMD} "replace-with = 'cargo'" >> ${WRKDIR}/.cargo/config @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 @${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-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: extract @if [ ! -r "${CARGO_CARGOLOCK}" ]; then \ ${ECHO_MSG} "===> ${CARGO_CARGOLOCK} not found. Trying to generate it..."; \ ${CARGO_CARGO_RUN} generate-lockfile \ --manifest-path ${CARGO_CARGOTOML} \ --verbose; \ fi @${SETENV} USE_GITHUB=${USE_GITHUB} USE_GITLAB=${USE_GITLAB} GL_SITE=${GL_SITE} \ ${AWK} -f ${SCRIPTSDIR}/cargo-crates.awk ${CARGO_CARGOLOCK} # 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 '|' .endif diff --git a/Mk/bsd.gecko.mk b/Mk/bsd.gecko.mk index 3a48e802ea40..db118dc96b85 100644 --- a/Mk/bsd.gecko.mk +++ b/Mk/bsd.gecko.mk @@ -1,401 +1,401 @@ #-*- 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 gtk20 gtk30 USE_PERL5= build USE_XORG= x11 xcb xcomposite xdamage xext xfixes xrender xt 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.19.0:devel/rust-cbindgen \ - ${RUST_DEFAULT}>=1.52.1:lang/${RUST_DEFAULT} \ + ${RUST_DEFAULT}>=1.53.0:lang/${RUST_DEFAULT} \ node:www/node LIB_DEPENDS+= libdrm.so:graphics/libdrm .if ${MOZILLA_VER:R:R} >= 85 RUN_DEPENDS+= ${LOCALBASE}/lib/libpci.so:devel/libpci .endif 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= 12 # chase bundled LLVM in lang/rust for LTO .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:Mpowerpc64*} 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} 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} .if ${ARCH} == powerpc64le MOZ_OPTIONS+= --enable-lto=thin .else MOZ_OPTIONS+= --enable-lto=cross .endif .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 post-patch-SNDIO-on: @${REINPLACE_CMD} -e 's|OpenBSD|${OPSYS}|g' \ -e '/DISABLE_LIBSNDIO_DLOPEN/d' \ ${MOZSRC}/media/libcubeb/src/moz.build .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 . if ${ARCH} == "powerpc64" MOZ_EXPORT+= UNAME_m="${ARCH}" . endif .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 15521fd1091e..9ad0485444cb 100644 --- a/lang/rust-bootstrap/Makefile +++ b/lang/rust-bootstrap/Makefile @@ -1,254 +1,253 @@ # 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.52.1 -PORTREVISION= 1 +PORTVERSION= 1.53.0 CATEGORIES= lang MASTER_SITES= https://static.rust-lang.org/dist/:rust \ LOCAL/tobik/rust:${FLAVOR} \ https://download.freebsd.org/ftp/${_RUST_FBSD_SUBDIR_${FLAVOR}}/:${FLAVOR} # http://pkg.freebsd.org/FreeBSD:12:powerpc64/quarterly/All/gcc9-9.3.0_1.txz?dummy=/:powerpc64_gcc PKGNAMESUFFIX= -bootstrap DISTNAME= ${PORTNAME}c-${PORTVERSION}-src DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:rust \ ${_RUST_FBSD_DIST_${FLAVOR}:@f@bootstrap/$f:${FLAVOR}@} 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 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 \ powerpc64le powerpc FLAVOR?= ${FLAVORS:[1]} aarch64_PKGNAMEPREFIX= aarch64- aarch64_BUILD_DEPENDS= llvm90>0:devel/llvm90 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- powerpc64le_PKGNAMEPREFIX= powerpc64le- powerpc_PKGNAMEPREFIX= powerpc- powerpc_BUILD_DEPENDS= powerpc-binutils>0:devel/binutils@powerpc USES= ninja:build perl5 python:3.6+,build tar:xz .if ${FLAVOR} == powerpc64_elfv1 USE_GCC= 9:build .endif # for openssl-src crate USE_PERL5= build .if ${FLAVOR} == aarch64 CC= clang90 CXX= clang++90 .endif 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} _RUST_FBSD_DIST_amd64= FreeBSD-${_RUST_FBSD_VER}-amd64${EXTRACT_SUFX} # 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} _RUST_FBSD_DIST_armv7= FreeBSD-${_RUST_FBSD_VER}-arm-armv7${EXTRACT_SUFX} _RUST_FBSD_DIST_i386= FreeBSD-${_RUST_FBSD_VER}-i386${EXTRACT_SUFX} _RUST_FBSD_DIST_powerpc64_elfv1= FreeBSD-${_RUST_FBSD_VER}-powerpc64-elfv1${EXTRACT_SUFX} \ FreeBSD-${_RUST_FBSD_VER}-powerpc64-elfv1-gcc9-9.3.0${EXTRACT_SUFX} _RUST_FBSD_DIST_powerpc64_elfv2= FreeBSD-${_RUST_FBSD_VER}-powerpc64-elfv2-v1300123${EXTRACT_SUFX} _RUST_FBSD_DIST_powerpc64le= FreeBSD-${_RUST_FBSD_VER}-powerpc64le-r366300${EXTRACT_SUFX} _RUST_FBSD_DIST_powerpc= FreeBSD-${_RUST_FBSD_VER}-powerpc${EXTRACT_SUFX} _RUST_FBSD_VER= ${_RUST_FBSD_VER_${FLAVOR}:U11.4-RELEASE} _RUST_FBSD_VER_aarch64= 12.2-RELEASE _RUST_FBSD_VER_armv7= 12.2-RELEASE _RUST_FBSD_VER_powerpc64_elfv1= 12.2-RELEASE _RUST_FBSD_VER_powerpc64_elfv2= 13.0-CURRENT _RUST_FBSD_VER_powerpc64le= 13.0-CURRENT _RUST_FBSD_VER_powerpc= 13.0-RELEASE _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= _RUST_FBSD_SUBDIR_powerpc64le= snapshots/powerpc/powerpc64le/${_RUST_FBSD_VER}/base.txz?dummy= _RUST_FBSD_SUBDIR_powerpc= releases/powerpc/powerpc/${_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_ARCH_powerpc64le= powerpc64le _RUST_ARCH_powerpc= powerpc _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_TRIPLE= ${_RUST_LLVM_TRIPLE_${FLAVOR}:U${_RUST_TARGET}} _RUST_LLVM_TRIPLE_armv6= armv6-gnueabihf-freebsd _RUST_LLVM_TRIPLE_armv7= armv7-gnueabihf-freebsd _RUST_LLVM_TRIPLE_powerpc= powerpc-unknown-freebsd13.0 # secure-plt .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 ${FLAVOR} == powerpc64le && ${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 .if make(distclean) || make(makesum) .MAKEFLAGS: MASTER_SITES="${FLAVORS:@_flavor@${:!${SETENV} FLAVOR=${_flavor} ${MAKE} -VMASTER_SITES!}@:O:u:q}" # PR 249537 DISTFILES:= ${DISTFILES:M*\:rust} \ ${FLAVORS:O:@_flavor@${:!${SETENV} FLAVOR=${_flavor} ${MAKE} -V'DISTFILES:N*\:rust'!}@} .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%,${WRKDIR},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} '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 # 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 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++ .elif ${FLAVOR} == powerpc @bfd="$$(${ECHO_CMD} ${LOCALBASE}/bin/${_RUST_TARGET}*[0-9]-ld.bfd)"; \ ${PRINTF} '#!/bin/sh\nexec ${CC} --sysroot=${WRKDIR} --target=${_RUST_LLVM_TRIPLE} -Wno-unused-command-line-argument -fuse-ld=%s "$$@"\n' "$${bfd}" \ > ${WRKDIR}/${_RUST_TARGET}-cc; \ ${PRINTF} '#!/bin/sh\nexec ${CXX} --sysroot=${WRKDIR} --target=${_RUST_LLVM_TRIPLE} -Wno-unused-command-line-argument -fuse-ld=%s "$$@"\n' "$${bfd}" \ > ${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} .include diff --git a/lang/rust-bootstrap/distinfo b/lang/rust-bootstrap/distinfo index e694513bfa1a..02917e8e12ac 100644 --- a/lang/rust-bootstrap/distinfo +++ b/lang/rust-bootstrap/distinfo @@ -1,23 +1,23 @@ -TIMESTAMP = 1620658815 -SHA256 (rust/rustc-1.52.1-src.tar.xz) = 521bbaebce262264e44acb164d327cba27acf6f08bd7de672d8d1e16e7ed959e -SIZE (rust/rustc-1.52.1-src.tar.xz) = 115109508 +TIMESTAMP = 1624031696 +SHA256 (rust/rustc-1.53.0-src.tar.xz) = e53a2df2c2c26f8929d551852eeae242b9a6167fba34481f92010b30def32dec +SIZE (rust/rustc-1.53.0-src.tar.xz) = 115686332 SHA256 (rust/bootstrap/FreeBSD-12.2-RELEASE-arm64.tar.xz) = 3f82224fbcc6b2a2e1a1358cec5f32c0a08b5c5e6796e1a998369eb624a11cf3 SIZE (rust/bootstrap/FreeBSD-12.2-RELEASE-arm64.tar.xz) = 158493712 SHA256 (rust/bootstrap/FreeBSD-11.4-RELEASE-amd64.tar.xz) = 3bac8257bdd5e5b071f7b80cc591ebecd01b9314ca7839a2903096cbf82169f9 SIZE (rust/bootstrap/FreeBSD-11.4-RELEASE-amd64.tar.xz) = 132075024 SHA256 (rust/bootstrap/FreeBSD-11.4-RELEASE-arm-armv6.tar.xz) = 8a7c95aaac4fe9591f586fa274c1ffb9adba2e0f191a5a26f6222331a7ae0afb SIZE (rust/bootstrap/FreeBSD-11.4-RELEASE-arm-armv6.tar.xz) = 25605880 SHA256 (rust/bootstrap/FreeBSD-12.2-RELEASE-arm-armv7.tar.xz) = b56bfaf0e9994723b2bb8c36b268ea1d0c6e9378c83211ed84ecca5c0a5420da SIZE (rust/bootstrap/FreeBSD-12.2-RELEASE-arm-armv7.tar.xz) = 70116512 SHA256 (rust/bootstrap/FreeBSD-11.4-RELEASE-i386.tar.xz) = ae602552ff4c26f31b304e4a1ffc066db826e75d07ba9a4bf33649e9549bf27b SIZE (rust/bootstrap/FreeBSD-11.4-RELEASE-i386.tar.xz) = 110296208 SHA256 (rust/bootstrap/FreeBSD-13.0-RELEASE-powerpc.tar.xz) = 8d980deacf7db15775445d00ce49b56a2a8eb519994052a92d2c6a40985910ab SIZE (rust/bootstrap/FreeBSD-13.0-RELEASE-powerpc.tar.xz) = 146274724 SHA256 (rust/bootstrap/FreeBSD-12.2-RELEASE-powerpc64-elfv1.tar.xz) = 762ec55a9bd40dc93231e24f2df53c58d90b7cef63892b2740a59f9e8f40898e SIZE (rust/bootstrap/FreeBSD-12.2-RELEASE-powerpc64-elfv1.tar.xz) = 109121900 SHA256 (rust/bootstrap/FreeBSD-12.2-RELEASE-powerpc64-elfv1-gcc9-9.3.0.tar.xz) = b1bd46b347e0ef55e8868537aaefe323622adf6fa081bef9ca5f24fc711d40ea SIZE (rust/bootstrap/FreeBSD-12.2-RELEASE-powerpc64-elfv1-gcc9-9.3.0.tar.xz) = 36842348 SHA256 (rust/bootstrap/FreeBSD-13.0-CURRENT-powerpc64-elfv2-v1300123.tar.xz) = 0713b0c4bd3c19520714054b087d8f0d8dc7acc3610d8ae30df51ab07d566d92 SIZE (rust/bootstrap/FreeBSD-13.0-CURRENT-powerpc64-elfv2-v1300123.tar.xz) = 75289700 SHA256 (rust/bootstrap/FreeBSD-13.0-CURRENT-powerpc64le-r366300.tar.xz) = a828a3a968c9911655148fa080587ecd7673aa3d58588ed3dafa55a5c2e12dd3 SIZE (rust/bootstrap/FreeBSD-13.0-CURRENT-powerpc64le-r366300.tar.xz) = 167748612 diff --git a/lang/rust/Makefile b/lang/rust/Makefile index 23f19351a4b5..90fe2ce2fbfa 100644 --- a/lang/rust/Makefile +++ b/lang/rust/Makefile @@ -1,264 +1,264 @@ # Created by: Jyun-Yan You PORTNAME= rust -PORTVERSION?= 1.52.1 +PORTVERSION?= 1.53.0 PORTREVISION?= 0 CATEGORIES= lang MASTER_SITES= https://static.rust-lang.org/dist/:src \ https://dev-static.rust-lang.org/dist/:src \ LOCAL/tobik/rust:bootstrap \ LOCAL/mikael/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 IGNORE_FreeBSD_11_powerpc= is missing a bootstrap for FreeBSD 11.x powerpc IGNORE_FreeBSD_12_powerpc= is missing a bootstrap for FreeBSD 12.x powerpc ONLY_FOR_ARCHS?= aarch64 amd64 armv6 armv7 i386 powerpc64 powerpc64le \ powerpc ONLY_FOR_ARCHS_REASON?= requires prebuilt bootstrap compiler BUILD_DEPENDS= cmake:devel/cmake LIB_DEPENDS= libcurl.so:ftp/curl USES= ninja:build pkgconfig python:3.6+,build ssl tar:xz MAKE_ENV= DESTDIR=${STAGEDIR} \ 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 OPTIONS_EXCLUDE_armv6= DOCS OPTIONS_EXCLUDE_armv7= DOCS 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= _RUST_TOOLS+=src 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?= 2021-03-25 -RUST_BOOTSTRAP_VERSION?= 1.51.0 +BOOTSTRAPS_DATE?= 2021-05-10 +RUST_BOOTSTRAP_VERSION?= 1.52.1 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} _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} .include .if ${ARCH} == powerpc # bfd to link rustc_driver; lld currently can't BUILD_DEPENDS+= ld.bfd:devel/binutils .else # rls needs 64-bit atomics _RUST_TOOLS+= rls .endif .if exists(${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX}) EXTRA_PATCHES+= ${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX} .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 # remove when 11.4 is EOL .if ${ARCH} == aarch64 && ${OSVERSION} < 1202000 IGNORE= fails to run due to a bug in rtld, update to 12.2-RELEASE or newer .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} '/^rustfmt:/d' ${WRKSRC}/src/stage0.txt .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-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 .if defined(NIGHTLY_DATE) @${ECHO_CMD} 'codegen-units=1' >> ${WRKSRC}/config.toml .endif @${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} == 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 .elif ${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} == armv6 @${ECHO_CMD} 'linker="${WRKDIR}/cc-wrapper"' >> ${WRKSRC}/config.toml .elif ${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 build --jobs=${MAKE_JOBS_NUMBER} do-install: @cd ${WRKSRC} && \ ${SETENV} ${MAKE_ENV} ${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 \ ${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 cd921b8b1b1b..9056af6917f5 100644 --- a/lang/rust/distinfo +++ b/lang/rust/distinfo @@ -1,57 +1,57 @@ -TIMESTAMP = 1620658786 -SHA256 (rust/rustc-1.52.1-src.tar.xz) = 521bbaebce262264e44acb164d327cba27acf6f08bd7de672d8d1e16e7ed959e -SIZE (rust/rustc-1.52.1-src.tar.xz) = 115109508 -SHA256 (rust/2021-03-25/rustc-1.51.0-aarch64-unknown-freebsd.tar.xz) = b99e089e21e76c2abbe00a445c2806b087982150fe50ae1e6624a6f7a0b6745c -SIZE (rust/2021-03-25/rustc-1.51.0-aarch64-unknown-freebsd.tar.xz) = 45630240 -SHA256 (rust/2021-03-25/rust-std-1.51.0-aarch64-unknown-freebsd.tar.xz) = fab3f64f429b473a3025b0716ec296a3d366d6e1a3fb1d58e7c5f7a88a216f11 -SIZE (rust/2021-03-25/rust-std-1.51.0-aarch64-unknown-freebsd.tar.xz) = 17938532 -SHA256 (rust/2021-03-25/cargo-1.51.0-aarch64-unknown-freebsd.tar.xz) = e405b04dbc11e87cd03c99208da8a7bd64cccd45728beaa811fe8c84a2619d97 -SIZE (rust/2021-03-25/cargo-1.51.0-aarch64-unknown-freebsd.tar.xz) = 4330412 -SHA256 (rust/2021-03-25/rustc-1.51.0-x86_64-unknown-freebsd.tar.xz) = 2107f1c368339082779e5eab3d808a4543999d40839e1c0da8fd87552e6bcd26 -SIZE (rust/2021-03-25/rustc-1.51.0-x86_64-unknown-freebsd.tar.xz) = 41500384 -SHA256 (rust/2021-03-25/rust-std-1.51.0-x86_64-unknown-freebsd.tar.xz) = a6a32bfa61ad496db773fd0a170f809df4fd0ec8c0e3bf58479ea2fa047c503f -SIZE (rust/2021-03-25/rust-std-1.51.0-x86_64-unknown-freebsd.tar.xz) = 21966524 -SHA256 (rust/2021-03-25/cargo-1.51.0-x86_64-unknown-freebsd.tar.xz) = 46fcc364f37bf36f82db01c4df21e9df48cf01329226f28d4da14c865f9202d8 -SIZE (rust/2021-03-25/cargo-1.51.0-x86_64-unknown-freebsd.tar.xz) = 5114456 -SHA256 (rust/2021-03-25/rustc-1.51.0-armv6-unknown-freebsd.tar.xz) = 18236f9a245f1e0cd50a9c51371363c2c41214298d7fdb5fc601cc25fc62c4fb -SIZE (rust/2021-03-25/rustc-1.51.0-armv6-unknown-freebsd.tar.xz) = 46581244 -SHA256 (rust/2021-03-25/rust-std-1.51.0-armv6-unknown-freebsd.tar.xz) = 9d362b1355d9c3a79f22730164108014621f571608babd969d625828a1480f71 -SIZE (rust/2021-03-25/rust-std-1.51.0-armv6-unknown-freebsd.tar.xz) = 17796144 -SHA256 (rust/2021-03-25/cargo-1.51.0-armv6-unknown-freebsd.tar.xz) = f534de1b4b321a837ee4ea8bd0be9c3e4f896ed2eb2f91d85b4b8dedf07cfb5c -SIZE (rust/2021-03-25/cargo-1.51.0-armv6-unknown-freebsd.tar.xz) = 4519100 -SHA256 (rust/2021-03-25/rustc-1.51.0-armv7-unknown-freebsd.tar.xz) = f44adf926e6e00348fcf44434799f2c468c8630b84301f63b5bf0d26080d0c10 -SIZE (rust/2021-03-25/rustc-1.51.0-armv7-unknown-freebsd.tar.xz) = 46639700 -SHA256 (rust/2021-03-25/rust-std-1.51.0-armv7-unknown-freebsd.tar.xz) = 57f90622006e9a1421e3500191cc3f5cfa1c9293db8ed6ddfef01c5754415775 -SIZE (rust/2021-03-25/rust-std-1.51.0-armv7-unknown-freebsd.tar.xz) = 17999588 -SHA256 (rust/2021-03-25/cargo-1.51.0-armv7-unknown-freebsd.tar.xz) = d5efa930bfe8bf0f7aaf1da54fad1560f58631c5602dcc04179ce6b815d547c0 -SIZE (rust/2021-03-25/cargo-1.51.0-armv7-unknown-freebsd.tar.xz) = 4506736 -SHA256 (rust/2021-03-25/rustc-1.51.0-i686-unknown-freebsd.tar.xz) = f2abf46e5a015565e50f48d89b832b76d3bc1a375d5b6a237b798b181785922c -SIZE (rust/2021-03-25/rustc-1.51.0-i686-unknown-freebsd.tar.xz) = 48953716 -SHA256 (rust/2021-03-25/rust-std-1.51.0-i686-unknown-freebsd.tar.xz) = bae5ecd3bbab8524de82f724e009ce432ff0058eef60063f7a7f89656554c265 -SIZE (rust/2021-03-25/rust-std-1.51.0-i686-unknown-freebsd.tar.xz) = 21965444 -SHA256 (rust/2021-03-25/cargo-1.51.0-i686-unknown-freebsd.tar.xz) = 1e0d6b99c15b018cd07f4aa1ba79e9e7c124d9878fd096ce0b518aa300434ecf -SIZE (rust/2021-03-25/cargo-1.51.0-i686-unknown-freebsd.tar.xz) = 5189996 -SHA256 (rust/2021-03-25/rustc-1.51.0-powerpc-unknown-freebsd.tar.xz) = a95f8bae7685cf512d096f75846181bb90e6f35dc0bc29d68f4574520e7488f6 -SIZE (rust/2021-03-25/rustc-1.51.0-powerpc-unknown-freebsd.tar.xz) = 47820404 -SHA256 (rust/2021-03-25/rust-std-1.51.0-powerpc-unknown-freebsd.tar.xz) = bc7fffac703c5bf3c90325110f17c507e39f2ae795ef2894ba58a9ad6bb87004 -SIZE (rust/2021-03-25/rust-std-1.51.0-powerpc-unknown-freebsd.tar.xz) = 17509168 -SHA256 (rust/2021-03-25/cargo-1.51.0-powerpc-unknown-freebsd.tar.xz) = 96b5935082775f6ad882f6b8b27e57abc2df32efbe1e5746f998226ef5f2b20e -SIZE (rust/2021-03-25/cargo-1.51.0-powerpc-unknown-freebsd.tar.xz) = 4947120 -SHA256 (rust/2021-03-25/rustc-1.51.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 77e9d3f93daa868582edc3082af75eca10e5343322ae9a64cda93c59a1856fa8 -SIZE (rust/2021-03-25/rustc-1.51.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 55795868 -SHA256 (rust/2021-03-25/rust-std-1.51.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 24034291852f2a7520caf0cbec9b935806bb8f39a9c07a93a8d6bc6a2bb1ed7e -SIZE (rust/2021-03-25/rust-std-1.51.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 17729920 -SHA256 (rust/2021-03-25/cargo-1.51.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = e31931bf88bf83848c8eb6aa84e661724db2ee8e43d2681d6e35bcfd036e5c69 -SIZE (rust/2021-03-25/cargo-1.51.0-powerpc64-unknown-freebsd-elfv1.tar.xz) = 5002568 -SHA256 (rust/2021-03-25/rustc-1.51.0-powerpc64le-unknown-freebsd.tar.xz) = 5f361c94a331f77810d9a2fb60221a8497682947a4309d9857a853bd93ecbc87 -SIZE (rust/2021-03-25/rustc-1.51.0-powerpc64le-unknown-freebsd.tar.xz) = 48689860 -SHA256 (rust/2021-03-25/rust-std-1.51.0-powerpc64le-unknown-freebsd.tar.xz) = 25f5d93c84b652e7ffd59420945aa7ab9701dc2a0f9a78fb353eb421351069a0 -SIZE (rust/2021-03-25/rust-std-1.51.0-powerpc64le-unknown-freebsd.tar.xz) = 17903604 -SHA256 (rust/2021-03-25/cargo-1.51.0-powerpc64le-unknown-freebsd.tar.xz) = 8235649059a53f102b6347562b8e055dff3e1a867544ef3c1faaf8b7073386b5 -SIZE (rust/2021-03-25/cargo-1.51.0-powerpc64le-unknown-freebsd.tar.xz) = 4937632 -SHA256 (rust/2021-03-25/rustc-1.51.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 145e708d27582fbf5ade6c9a9ebd3c3f70a65bd2e96fc3c806affd6ca08ec54e -SIZE (rust/2021-03-25/rustc-1.51.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 46681952 -SHA256 (rust/2021-03-25/rust-std-1.51.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 766ad03a8b1f206a8e249005dfd9db68e401e05ddf3a31d244e7f1b30b313bdb -SIZE (rust/2021-03-25/rust-std-1.51.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 17645120 -SHA256 (rust/2021-03-25/cargo-1.51.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 273743a005d951a6f2836ee5c5d168d7ecf6e45b45cb5facda4eac59ef7f6722 -SIZE (rust/2021-03-25/cargo-1.51.0-powerpc64-unknown-freebsd-elfv2.tar.xz) = 4679488 +TIMESTAMP = 1624031642 +SHA256 (rust/rustc-1.53.0-src.tar.xz) = e53a2df2c2c26f8929d551852eeae242b9a6167fba34481f92010b30def32dec +SIZE (rust/rustc-1.53.0-src.tar.xz) = 115686332 +SHA256 (rust/2021-05-10/rustc-1.52.1-aarch64-unknown-freebsd.tar.xz) = db5990320065ee8898a7094b99c373a2a355ce2509282611809c750ed5129b02 +SIZE (rust/2021-05-10/rustc-1.52.1-aarch64-unknown-freebsd.tar.xz) = 44941036 +SHA256 (rust/2021-05-10/rust-std-1.52.1-aarch64-unknown-freebsd.tar.xz) = b47423a1836b0ba69d71a0b0f90e6f9c7106c09de038a7fad1e138a89a9a98e2 +SIZE (rust/2021-05-10/rust-std-1.52.1-aarch64-unknown-freebsd.tar.xz) = 17228492 +SHA256 (rust/2021-05-10/cargo-1.52.1-aarch64-unknown-freebsd.tar.xz) = 36e1ba6cd275d0e5795265e12e92653ed6251144249b2e56230d4e40d6825c1b +SIZE (rust/2021-05-10/cargo-1.52.1-aarch64-unknown-freebsd.tar.xz) = 4364328 +SHA256 (rust/2021-05-10/rustc-1.52.1-x86_64-unknown-freebsd.tar.xz) = 6a00cd20cea8f851f1232bea263a3e77689f6f253d921f81160a9ce0da1a8cab +SIZE (rust/2021-05-10/rustc-1.52.1-x86_64-unknown-freebsd.tar.xz) = 40846844 +SHA256 (rust/2021-05-10/rust-std-1.52.1-x86_64-unknown-freebsd.tar.xz) = 525c2bb01d652e692e5b54eeca34d7288ab6de29a642674df6fd3703cc481b0f +SIZE (rust/2021-05-10/rust-std-1.52.1-x86_64-unknown-freebsd.tar.xz) = 21166580 +SHA256 (rust/2021-05-10/cargo-1.52.1-x86_64-unknown-freebsd.tar.xz) = 7db91dc33459615bd4284d02756b1f1be25c6cb7002b296da5e5cc1ac66bb9c4 +SIZE (rust/2021-05-10/cargo-1.52.1-x86_64-unknown-freebsd.tar.xz) = 5110192 +SHA256 (rust/2021-05-10/rustc-1.52.1-armv6-unknown-freebsd.tar.xz) = b509b8ac6ce5c7adef573a5eb29464cb7f5b08a99e73f0e597a3ee1a41bb1e8a +SIZE (rust/2021-05-10/rustc-1.52.1-armv6-unknown-freebsd.tar.xz) = 45745500 +SHA256 (rust/2021-05-10/rust-std-1.52.1-armv6-unknown-freebsd.tar.xz) = 7a1996b52a54f4c20b10cc6af64232289a5512814fd3c3b168e6f310aca601fb +SIZE (rust/2021-05-10/rust-std-1.52.1-armv6-unknown-freebsd.tar.xz) = 17089672 +SHA256 (rust/2021-05-10/cargo-1.52.1-armv6-unknown-freebsd.tar.xz) = 8d2d251431f74148b74d430ecd87fd2cac874aae1711e1e618558dc1e8b92a28 +SIZE (rust/2021-05-10/cargo-1.52.1-armv6-unknown-freebsd.tar.xz) = 4493480 +SHA256 (rust/2021-05-10/rustc-1.52.1-armv7-unknown-freebsd.tar.xz) = 24296e541dcaf17a26c9e3359a0334402f170a52cda0c94e86f1db37d920d44f +SIZE (rust/2021-05-10/rustc-1.52.1-armv7-unknown-freebsd.tar.xz) = 45687832 +SHA256 (rust/2021-05-10/rust-std-1.52.1-armv7-unknown-freebsd.tar.xz) = 1d3776e5a51e7615d7dd513b917a87131c9372f72ca48b8cb5ec630eb5befca2 +SIZE (rust/2021-05-10/rust-std-1.52.1-armv7-unknown-freebsd.tar.xz) = 17299848 +SHA256 (rust/2021-05-10/cargo-1.52.1-armv7-unknown-freebsd.tar.xz) = 72ac9e6c4f575aa8db9150e8f2df179d8767d951a92e86bfc7c6bd8197102a3a +SIZE (rust/2021-05-10/cargo-1.52.1-armv7-unknown-freebsd.tar.xz) = 4483100 +SHA256 (rust/2021-05-10/rustc-1.52.1-i686-unknown-freebsd.tar.xz) = bcb0633b11800b7c4fa37e7c11768a67530afa77c7fcab90ed1f22281ac81868 +SIZE (rust/2021-05-10/rustc-1.52.1-i686-unknown-freebsd.tar.xz) = 48639596 +SHA256 (rust/2021-05-10/rust-std-1.52.1-i686-unknown-freebsd.tar.xz) = 104efbbcada537f1129a61b9d781001836b4dd4cebcc8ab0e6ebf3492ae41ec5 +SIZE (rust/2021-05-10/rust-std-1.52.1-i686-unknown-freebsd.tar.xz) = 21189280 +SHA256 (rust/2021-05-10/cargo-1.52.1-i686-unknown-freebsd.tar.xz) = c44859c142c4df17a0e29c0dba5b146fcc8de3211dde37a48a64743cb374f505 +SIZE (rust/2021-05-10/cargo-1.52.1-i686-unknown-freebsd.tar.xz) = 5154628 +SHA256 (rust/2021-05-10/rustc-1.52.1-powerpc-unknown-freebsd.tar.xz) = b7b57482405486d714084a141ed355cfec1dc5255d0a89738da3958de58373d8 +SIZE (rust/2021-05-10/rustc-1.52.1-powerpc-unknown-freebsd.tar.xz) = 46917676 +SHA256 (rust/2021-05-10/rust-std-1.52.1-powerpc-unknown-freebsd.tar.xz) = 5f367cf52016dddec10feb6f443ddec889017ee0dc91b1137cb4ccf16a103ca6 +SIZE (rust/2021-05-10/rust-std-1.52.1-powerpc-unknown-freebsd.tar.xz) = 16745916 +SHA256 (rust/2021-05-10/cargo-1.52.1-powerpc-unknown-freebsd.tar.xz) = 5390b24382e1b5a17e78d1a569288772b38d2dc562abb77a2eafc7c63d773ac2 +SIZE (rust/2021-05-10/cargo-1.52.1-powerpc-unknown-freebsd.tar.xz) = 4912240 +SHA256 (rust/2021-05-10/rustc-1.52.1-powerpc64-unknown-freebsd-elfv1.tar.xz) = 8471da344ec65c9ed14695f2fb21d917c1365a7ec16cd42429ee4a3dc3482301 +SIZE (rust/2021-05-10/rustc-1.52.1-powerpc64-unknown-freebsd-elfv1.tar.xz) = 55560892 +SHA256 (rust/2021-05-10/rust-std-1.52.1-powerpc64-unknown-freebsd-elfv1.tar.xz) = dec922c48865d9ebfcfbefb81b36e54096798d85c89faa9f699ee23d24206438 +SIZE (rust/2021-05-10/rust-std-1.52.1-powerpc64-unknown-freebsd-elfv1.tar.xz) = 16996816 +SHA256 (rust/2021-05-10/cargo-1.52.1-powerpc64-unknown-freebsd-elfv1.tar.xz) = 568b5941ef243839529811132d924c0d53e5f29dd966e276f79f196fe703ccc0 +SIZE (rust/2021-05-10/cargo-1.52.1-powerpc64-unknown-freebsd-elfv1.tar.xz) = 4977068 +SHA256 (rust/2021-05-10/rustc-1.52.1-powerpc64le-unknown-freebsd.tar.xz) = ba0044e6c03a832fc43a31055d7b880270fdecdd599b9f9acf1aedff31970f84 +SIZE (rust/2021-05-10/rustc-1.52.1-powerpc64le-unknown-freebsd.tar.xz) = 48166508 +SHA256 (rust/2021-05-10/rust-std-1.52.1-powerpc64le-unknown-freebsd.tar.xz) = f912b6ec961266c93eaaf8b3e48e714701ce117029072a65d65e03c0b865f803 +SIZE (rust/2021-05-10/rust-std-1.52.1-powerpc64le-unknown-freebsd.tar.xz) = 17102052 +SHA256 (rust/2021-05-10/cargo-1.52.1-powerpc64le-unknown-freebsd.tar.xz) = 789dec2c031fb89a80525017c22f51f05da3dbbb558b5f623e55ab0f50aaca8b +SIZE (rust/2021-05-10/cargo-1.52.1-powerpc64le-unknown-freebsd.tar.xz) = 4910208 +SHA256 (rust/2021-05-10/rustc-1.52.1-powerpc64-unknown-freebsd-elfv2.tar.xz) = 7250fc37fb00d6a9c4f40aa25581e8b0d02a4ad66bcf941497c96314774d5d8a +SIZE (rust/2021-05-10/rustc-1.52.1-powerpc64-unknown-freebsd-elfv2.tar.xz) = 46180492 +SHA256 (rust/2021-05-10/rust-std-1.52.1-powerpc64-unknown-freebsd-elfv2.tar.xz) = a6702ec714e445e5c14b17f7acbf696b97e3a755ee8863ba919a87ef658033d0 +SIZE (rust/2021-05-10/rust-std-1.52.1-powerpc64-unknown-freebsd-elfv2.tar.xz) = 16924328 +SHA256 (rust/2021-05-10/cargo-1.52.1-powerpc64-unknown-freebsd-elfv2.tar.xz) = e96ed74c63003c64581f9d3265be18cae439f947c6008a13ea214245f957a1b9 +SIZE (rust/2021-05-10/cargo-1.52.1-powerpc64-unknown-freebsd-elfv2.tar.xz) = 4664628 diff --git a/lang/rust/files/patch-backtrace b/lang/rust/files/patch-backtrace deleted file mode 100644 index e658bf339a5c..000000000000 --- a/lang/rust/files/patch-backtrace +++ /dev/null @@ -1,12 +0,0 @@ -https://github.com/rust-lang/rust/issues/78184 - ---- library/backtrace/src/symbolize/gimli.rs.orig 2021-02-10 17:36:59 UTC -+++ library/backtrace/src/symbolize/gimli.rs -@@ -361,6 +361,7 @@ cfg_if::cfg_if! { - } else if #[cfg(any( - target_os = "linux", - target_os = "fuchsia", -+ target_os = "freebsd", - ))] { - // Other Unix (e.g. Linux) platforms use ELF as an object file format - // and typically implement an API called `dl_iterate_phdr` to load diff --git a/lang/rust/files/patch-library_stdarch_crates_std__detect_src_detect_os_freebsd_aarch64.rs b/lang/rust/files/patch-library_stdarch_crates_std__detect_src_detect_os_freebsd_aarch64.rs new file mode 100644 index 000000000000..4b62546b16b4 --- /dev/null +++ b/lang/rust/files/patch-library_stdarch_crates_std__detect_src_detect_os_freebsd_aarch64.rs @@ -0,0 +1,10 @@ +--- library/stdarch/crates/std_detect/src/detect/os/freebsd/aarch64.rs.orig 2021-06-16 15:22:56 UTC ++++ library/stdarch/crates/std_detect/src/detect/os/freebsd/aarch64.rs +@@ -1,6 +1,6 @@ + //! Run-time feature detection for Aarch64 on FreeBSD. + +-pub use super::super::aarch64::detect_features; ++pub(crate) use super::super::aarch64::detect_features; + + #[cfg(test)] + mod tests { diff --git a/lang/rust/files/powerpc64le/patch-compiler_rustc__target_src_spec_powerpc64le__unknown__freebsd.rs b/lang/rust/files/powerpc64le/patch-compiler_rustc__target_src_spec_powerpc64le__unknown__freebsd.rs index 90aecb5a00b7..05124570bd9f 100644 --- a/lang/rust/files/powerpc64le/patch-compiler_rustc__target_src_spec_powerpc64le__unknown__freebsd.rs +++ b/lang/rust/files/powerpc64le/patch-compiler_rustc__target_src_spec_powerpc64le__unknown__freebsd.rs @@ -1,19 +1,19 @@ --- compiler/rustc_target/src/spec/powerpc64le_unknown_freebsd.rs.orig 2021-01-07 03:05:53 UTC +++ compiler/rustc_target/src/spec/powerpc64le_unknown_freebsd.rs @@ -0,0 +1,16 @@ +use crate::spec::{LinkerFlavor, Target, TargetOptions}; + +pub fn target() -> Target { + let mut base = super::freebsd_base::opts(); + base.cpu = "ppc64le".to_string(); -+ base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string()); ++ base.pre_link_args.entry(LinkerFlavor::Gcc).or_default().push("-m64".to_string()); + base.max_atomic_width = Some(64); + + Target { -+ llvm_target: "powerpc64le-unknown-freebsd".to_string(), -+ pointer_width: 64, -+ data_layout: "e-m:e-i64:64-n32:64".to_string(), -+ arch: "powerpc64".to_string(), -+ options: TargetOptions { mcount: "_mcount".to_string(), ..base }, ++ llvm_target: "powerpc64le-unknown-freebsd".to_string(), ++ pointer_width: 64, ++ data_layout: "e-m:e-i64:64-n32:64".to_string(), ++ arch: "powerpc64".to_string(), ++ options: TargetOptions { mcount: "_mcount".to_string(), ..base }, + } +}