diff --git a/Mk/Uses/cargo.mk b/Mk/Uses/cargo.mk index 8a7e2539896f..c265ddfc4627 100644 --- a/Mk/Uses/cargo.mk +++ b/Mk/Uses/cargo.mk @@ -1,414 +1,414 @@ # 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.81.0:lang/${RUST_DEFAULT} +BUILD_DEPENDS+= ${RUST_DEFAULT}>=1.82.0:lang/${RUST_DEFAULT} . elif ${CARGO_BUILDDEP:tl} == "any-version" BUILD_DEPENDS+= ${RUST_DEFAULT}>=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 _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_TARGET_DIR=${CARGO_TARGET_DIR} \ RUSTC=${RUSTC} \ RUSTDOC=${RUSTDOC} \ RUSTFLAGS="${RUSTFLAGS} ${LDFLAGS:C/.+/-C link-arg=&/}" . if ${ARCH} != powerpc64le CARGO_ENV+= RUST_BACKTRACE=1 . endif . if !defined(WITHOUT_LTO) _CARGO_MSG= "===> Additional optimization to port applied" WITH_LTO= yes . 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/} . elif ${ARCH} == aarch64 || ${ARCH} == armv7 RUSTFLAGS+= -C target-cpu=${CPUTYPE:C/\+.+//g} . else RUSTFLAGS+= ${CFLAGS:M-mcpu=*:S/-mcpu=/-C target-cpu=/} . endif # Helper to shorten cargo calls. _CARGO_RUN= ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${CARGO_ENV} ${CARGO} CARGO_CARGO_RUN= cd ${WRKSRC}; ${SETENVI} ${WRK_ENV} ${MAKE_ENV} ${CARGO_ENV} \ CARGO_FREEBSD_PORTS_SKIP_GIT_UPDATE=1 ${CARGO} # 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-core . 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 . if ${_CARGO_CRATES:Mzstd-sys} # Use the system's zstd instead of building the bundled version CARGO_ENV+= ZSTD_SYS_USE_PKG_CONFIG=1 . 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 . if defined(_CARGO_MSG) @${ECHO_MSG} ${_CARGO_MSG} . endif @${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}; \ ${ECHO_CMD} 'strip = "symbols"' >> ${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 ${CARGO_CARGOLOCK:H}; ${_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 c6fb935ba593..50e9e1dc2a56 100644 --- a/Mk/bsd.gecko.mk +++ b/Mk/bsd.gecko.mk @@ -1,387 +1,387 @@ #-*- 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 elfctl gl gmake gnome iconv \ llvm:min=17,noexport localbase \ pkgconfig python:build desktop-file-utils CPE_VENDOR?=mozilla USE_GL= gl USE_GNOME= cairo gdkpixbuf2 gtk30 USE_XORG= x11 xcb xcomposite xdamage xext xfixes xrandr xrender xt xtst HAS_CONFIGURE= yes CONFIGURE_OUTSOURCE= yes LDFLAGS+= -Wl,--as-needed -Wl,--undefined-version BINARY_ALIAS+= python3=${PYTHON_CMD} ELF_FEATURES+= +wxneeded:dist/bin/${MOZILLA} +wxneeded:dist/bin/${MOZILLA}-bin BUNDLE_LIBS= yes BUILD_DEPENDS+= rust-cbindgen>=0.26.0:devel/rust-cbindgen \ - ${RUST_DEFAULT}>=1.81.0:lang/${RUST_DEFAULT} \ + ${RUST_DEFAULT}>=1.82.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} \ PYTHON3="${PYTHON_CMD}" \ RUSTFLAGS="${RUSTFLAGS}" MOZ_OPTIONS+= --prefix="${PREFIX}" MOZ_MK_OPTIONS+=MOZ_OBJDIR="${BUILD_WRKSRC}" MOZ_OPTIONS+= --with-libclang-path="${LLVM_PREFIX:S/${PREFIX}/${LOCALBASE}/}/lib" . if !exists(/usr/bin/llvm-objdump) MOZ_EXPORT+= LLVM_OBJDUMP="${LOCALBASE}/bin/llvm-objdump${LLVM_VERSION}" . endif # Require newer Clang than what's in base system unless user opted out . if ${CC} == cc && ${CXX} == c++ && exists(/usr/lib/libc++.so) CPP= ${LOCALBASE}/bin/clang-cpp${LLVM_VERSION} CC= ${LOCALBASE}/bin/clang${LLVM_VERSION} CXX= ${LOCALBASE}/bin/clang++${LLVM_VERSION} 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 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>=6.0,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 MOZ_OPTIONS+= --enable-sndio . else MOZ_OPTIONS+= --disable-sndio . 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 721bde7e0f50..fe577802b840 100644 --- a/lang/rust-bootstrap/Makefile +++ b/lang/rust-bootstrap/Makefile @@ -1,141 +1,141 @@ # 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.81.0 +PORTVERSION= 1.82.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 WWW= https://www.rust-lang.org/ LICENSE= APACHE20 MIT LICENSE_COMB= dual LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE-APACHE LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-MIT ONLY_FOR_ARCHS= amd64 powerpc64 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-core \ gmake:devel/gmake \ rust>=${PORTVERSION}:lang/rust FLAVORS= aarch64 amd64 armv7 i386 powerpc powerpc64 powerpc64le riscv64 FLAVOR?= ${FLAVORS:[1]} USES= cpe ninja:build perl5 python:build tar:xz CPE_VENDOR= ${PORTNAME}-lang # 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= 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_armv7= ARM _RUST_LLVM_TARGET_i386= X86 _RUST_LLVM_TARGET_powerpc64= 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 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 do-configure: # Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 @${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ ${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh @${ECHO_CMD} '[build]' >> ${WRKSRC}/config.toml @${ECHO_CMD} '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 @${ECHO_CMD} 'deny-warnings=false' >> ${WRKSRC}/config.toml @${ECHO_CMD} '[llvm]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'link-shared=false' >> ${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 # 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} @cd ${STAGEDIR}${PREFIX} && \ ${FIND} rust-bootstrap -type f >> ${TMPPLIST} .include diff --git a/lang/rust-bootstrap/distinfo b/lang/rust-bootstrap/distinfo index fa537b259d6c..6597985415ff 100644 --- a/lang/rust-bootstrap/distinfo +++ b/lang/rust-bootstrap/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1725563033 -SHA256 (rust/rustc-1.81.0-src.tar.xz) = e8fc54fea3df1a5081c00563cdc0fe2ac567104a557aa07116966c013f3d0195 -SIZE (rust/rustc-1.81.0-src.tar.xz) = 216764824 +TIMESTAMP = 1729451664 +SHA256 (rust/rustc-1.82.0-src.tar.xz) = 1276a0bb8fa12288ba6fa96597d28b40e74c44257c051d3bc02c2b049bb38210 +SIZE (rust/rustc-1.82.0-src.tar.xz) = 219769328 diff --git a/lang/rust/Makefile b/lang/rust/Makefile index 5da879672316..004fa9de631c 100644 --- a/lang/rust/Makefile +++ b/lang/rust/Makefile @@ -1,285 +1,285 @@ PORTNAME= rust -PORTVERSION?= 1.81.0 +PORTVERSION?= 1.82.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}${EXTRACT_SUFX}:bootstrap \ ${_RUST_STD_BOOTSTRAP}${EXTRACT_SUFX}:bootstrap \ ${_CARGO_BOOTSTRAP}${EXTRACT_SUFX}:bootstrap DIST_SUBDIR?= rust MAINTAINER= rust@FreeBSD.org COMMENT= Language with a focus on memory safety and concurrency WWW= https://www.rust-lang.org/ LICENSE= APACHE20 MIT LICENSE_COMB= dual LICENSE_FILE_APACHE20= ${WRKSRC}/LICENSE-APACHE LICENSE_FILE_MIT= ${WRKSRC}/LICENSE-MIT ONLY_FOR_ARCHS?= aarch64 amd64 armv7 i386 powerpc64 powerpc64le powerpc \ riscv64 ONLY_FOR_ARCHS_REASON?= requires prebuilt bootstrap compiler LIB_DEPENDS= libcurl.so:ftp/curl USES= cmake:indirect cpe ninja:build pkgconfig python:build 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 LTO PORT_LLVM SOURCES WASM OPTIONS_DEFAULT= SOURCES WASM GDB_DESC= Install ports gdb (necessary for debugging rust programs) PORT_LLVM_DESC= Build against devel/llvm instead of bundled copy (experimental) SOURCES_DESC= Install source files WASM_DESC= Build the WebAssembly target (wasm32-unknown-unknown) DOCS_VARS= _RUST_BUILD_DOCS=true \ _COMPONENTS+="rust-docs-${_PACKAGE_VERS}-${_RUST_TARGET} rust-docs-json-${_PACKAGE_VERS}-${_RUST_TARGET}" \ _RUST_TOOLS+=rustdoc DOCS_VARS_OFF= _RUST_BUILD_DOCS=false GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb PORT_LLVM_USES= llvm:min=17,max=18,lib,noexport PORT_LLVM_MAKE_ENV= RUSTFLAGS="-Lnative=${LOCALBASE}/lib" 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_TARGETS+=wasm32-unknown-unknown # See WRKSRC/src/stage0 for the date and version values -BOOTSTRAPS_DATE?= 2024-08-08 -RUST_BOOTSTRAP_VERSION?= 1.80.0 +BOOTSTRAPS_DATE?= 2024-09-05 +RUST_BOOTSTRAP_VERSION?= 1.81.0 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 rust-analyzer rustdoc 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} .include .if ${OPSYS} != FreeBSD IGNORE= is only for FreeBSD .endif .if ${ARCH} == powerpc LIB_DEPENDS+= libatomic.so:lang/gcc${GCC_DEFAULT} MAKE_ENV+= RUSTFLAGS="-L/usr/local/lib/gcc${GCC_DEFAULT}" .endif # rls doesn't build on rust nightly .if !defined(NIGHTLY_DATE) _RUST_TOOLS+= rls _COMPONENTS+= rls-${_PACKAGE_VERS}-${_RUST_TARGET} .endif .if ${ARCH} != powerpc64le MAKE_ENV+= RUST_BACKTRACE=1 .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 ${PORT_OPTIONS:MWASM} && ${PORT_OPTIONS:MDOCS} _COMPONENTS+= rust-docs-${_PACKAGE_VERS}-wasm32-unknown-unknown rust-docs-json-${_PACKAGE_VERS}-wasm32-unknown-unknown .endif .if exists(${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX}) EXTRA_PATCHES+= ${PATCHDIR}/${ARCH}${BOOTSTRAPS_SUFFIX} .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} -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 .endif # Disable vendor checksums @${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \ ${CARGO_VENDOR_DIR}/*/.cargo-checksum.json post-patch-PORT_LLVM-on: # WASM target hardcodes bundled lld @${REINPLACE_CMD} 's|"rust-lld"|"wasm-ld${LLVM_VERSION}"|' \ ${WRKSRC}/compiler/rustc_target/src/spec/base/wasm.rs do-configure: # Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 @${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ ${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh .for _component in cargo rust-std rustc @cd ${WRKDIR}/${_component}-*-${OPSYS:tl} && \ ${SH} install.sh --prefix=${WRKDIR}/bootstrap --verbose .endfor @${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 .if ${PORT_OPTIONS:MWASM} && !${PORT_OPTIONS:MPORT_LLVM} @${ECHO_CMD} 'lld=true' >> ${WRKSRC}/config.toml .else @${ECHO_CMD} 'lld=false' >> ${WRKSRC}/config.toml .endif .if ${PORT_OPTIONS:MLTO} @${ECHO_CMD} 'lto="thin"' >> ${WRKSRC}/config.toml .endif @${ECHO_CMD} 'remap-debuginfo=true' >> ${WRKSRC}/config.toml @${ECHO_CMD} '[llvm]' >> ${WRKSRC}/config.toml .if defined(NIGHTLY_DATE) @${ECHO_CMD} 'download-ci-llvm = false' >> ${WRKSRC}/config.toml .endif .if ${PORT_OPTIONS:MLTO} @${ECHO_CMD} 'thin-lto=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 @${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.2' > ${WRKDIR}/cc-wrapper @${CHMOD} +x ${WRKDIR}/cc-wrapper @${PRINTF} '#!/bin/sh\nexec ${CXX} "$$@" --target=powerpc-unknown-freebsd13.2' > ${WRKDIR}/cxx-wrapper @${CHMOD} +x ${WRKDIR}/cxx-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 @${ECHO_CMD} 'linker="${CC}"' >> ${WRKSRC}/config.toml .if ${PORT_OPTIONS:MPORT_LLVM} @${ECHO_CMD} 'llvm-config="${LOCALBASE}/bin/${LLVM_CONFIG}"' >> ${WRKSRC}/config.toml .endif .endfor @${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} 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 c92b012c4d90..1a29d5172aa4 100644 --- a/lang/rust/distinfo +++ b/lang/rust/distinfo @@ -1,51 +1,51 @@ -TIMESTAMP = 1725563031 -SHA256 (rust/rustc-1.81.0-src.tar.xz) = e8fc54fea3df1a5081c00563cdc0fe2ac567104a557aa07116966c013f3d0195 -SIZE (rust/rustc-1.81.0-src.tar.xz) = 216764824 -SHA256 (rust/2024-08-08/rustc-1.80.0-aarch64-unknown-freebsd.tar.xz) = 321c18de125baaf82255ad7cea9a48b20d7c2050d5dd65401e4bc3c4ca6fb4c7 -SIZE (rust/2024-08-08/rustc-1.80.0-aarch64-unknown-freebsd.tar.xz) = 59522160 -SHA256 (rust/2024-08-08/rust-std-1.80.0-aarch64-unknown-freebsd.tar.xz) = ca9359056396c909dd2fb9cc38b0ff8821643ebf3429cccc71d38ceca052f993 -SIZE (rust/2024-08-08/rust-std-1.80.0-aarch64-unknown-freebsd.tar.xz) = 25757812 -SHA256 (rust/2024-08-08/cargo-1.80.0-aarch64-unknown-freebsd.tar.xz) = 3dc67773101dda81883421d0ba160240e8a3d71baa63972df67a48a7971ea721 -SIZE (rust/2024-08-08/cargo-1.80.0-aarch64-unknown-freebsd.tar.xz) = 9032180 -SHA256 (rust/2024-08-08/rustc-1.80.0-x86_64-unknown-freebsd.tar.xz) = 878fb757076782cb056f2b97d9daae582b51982f0e71886fa5e4e62935fdaec0 -SIZE (rust/2024-08-08/rustc-1.80.0-x86_64-unknown-freebsd.tar.xz) = 47968520 -SHA256 (rust/2024-08-08/rust-std-1.80.0-x86_64-unknown-freebsd.tar.xz) = b9296b743c3ae8aa3eb8888e0fc8bb0643a90100cf982867d9f6bb9c1b802c76 -SIZE (rust/2024-08-08/rust-std-1.80.0-x86_64-unknown-freebsd.tar.xz) = 26546140 -SHA256 (rust/2024-08-08/cargo-1.80.0-x86_64-unknown-freebsd.tar.xz) = 486f0b85afb4483c0abd1aa3e2c6a133f02c53a32d97fd1225e6d4b11927eb09 -SIZE (rust/2024-08-08/cargo-1.80.0-x86_64-unknown-freebsd.tar.xz) = 10100468 -SHA256 (rust/2024-08-08/rustc-1.80.0-armv7-unknown-freebsd.tar.xz) = 830502080628bb0b811da34291216283bdc77a3845ca8c3127d72d115a4b0c8c -SIZE (rust/2024-08-08/rustc-1.80.0-armv7-unknown-freebsd.tar.xz) = 59701744 -SHA256 (rust/2024-08-08/rust-std-1.80.0-armv7-unknown-freebsd.tar.xz) = 34badba19462d3f54279a0deca9c4288419334ca0eda8c28fec929b8db478ef2 -SIZE (rust/2024-08-08/rust-std-1.80.0-armv7-unknown-freebsd.tar.xz) = 25224376 -SHA256 (rust/2024-08-08/cargo-1.80.0-armv7-unknown-freebsd.tar.xz) = fe82727748ef8ac694072be9ad59c10110f7621f2bcb92c7283bd22849c965aa -SIZE (rust/2024-08-08/cargo-1.80.0-armv7-unknown-freebsd.tar.xz) = 9100116 -SHA256 (rust/2024-08-08/rustc-1.80.0-i686-unknown-freebsd.tar.xz) = 87bdc1d84ce27d953277330f95673b9c67f98be72982387f73c723081166f442 -SIZE (rust/2024-08-08/rustc-1.80.0-i686-unknown-freebsd.tar.xz) = 66337464 -SHA256 (rust/2024-08-08/rust-std-1.80.0-i686-unknown-freebsd.tar.xz) = 08f85ee367e6033f1b16f30435d082909cc020a2a66078cad4ab2a303d1c8f9e -SIZE (rust/2024-08-08/rust-std-1.80.0-i686-unknown-freebsd.tar.xz) = 26239164 -SHA256 (rust/2024-08-08/cargo-1.80.0-i686-unknown-freebsd.tar.xz) = ae8499d4c964969c505efc1e585705a3ab450e9f552935dfddb8b718245f82f2 -SIZE (rust/2024-08-08/cargo-1.80.0-i686-unknown-freebsd.tar.xz) = 10487336 -SHA256 (rust/2024-08-08/rustc-1.80.0-powerpc-unknown-freebsd.tar.xz) = dda3b18497bceb17c626f7c976a0a68ac50b4b14268e951babe892e28bd780ea -SIZE (rust/2024-08-08/rustc-1.80.0-powerpc-unknown-freebsd.tar.xz) = 63260996 -SHA256 (rust/2024-08-08/rust-std-1.80.0-powerpc-unknown-freebsd.tar.xz) = efb90b880f16f4c49c3060c4d9d5e3ee86e27b05e4771990bb6d2bc6249e5635 -SIZE (rust/2024-08-08/rust-std-1.80.0-powerpc-unknown-freebsd.tar.xz) = 24368468 -SHA256 (rust/2024-08-08/cargo-1.80.0-powerpc-unknown-freebsd.tar.xz) = 193640fa0bea88ea7f712fa509feacd6a69e8798aaa00f4e2be4afc731eb547f -SIZE (rust/2024-08-08/cargo-1.80.0-powerpc-unknown-freebsd.tar.xz) = 9724748 -SHA256 (rust/2024-08-08/rustc-1.80.0-powerpc64-unknown-freebsd.tar.xz) = 8ad48d991a511951fa10e6c209bba482d0bc027b068bc9e749d7b32b8b575b0c -SIZE (rust/2024-08-08/rustc-1.80.0-powerpc64-unknown-freebsd.tar.xz) = 61456824 -SHA256 (rust/2024-08-08/rust-std-1.80.0-powerpc64-unknown-freebsd.tar.xz) = 4157145584fd5b47a4e72e013907c97fea5206a1006582bdd116f62afe2b9614 -SIZE (rust/2024-08-08/rust-std-1.80.0-powerpc64-unknown-freebsd.tar.xz) = 24437572 -SHA256 (rust/2024-08-08/cargo-1.80.0-powerpc64-unknown-freebsd.tar.xz) = 2e15b5174474359afcab26a007ca0c5c9f85961846516c760d4d41c95dac1cbb -SIZE (rust/2024-08-08/cargo-1.80.0-powerpc64-unknown-freebsd.tar.xz) = 9348928 -SHA256 (rust/2024-08-08/rustc-1.80.0-powerpc64le-unknown-freebsd.tar.xz) = 74d641b8df414557bb9cf9220c5e74e7a08311e57321bf040f1ba0686778a490 -SIZE (rust/2024-08-08/rustc-1.80.0-powerpc64le-unknown-freebsd.tar.xz) = 63158368 -SHA256 (rust/2024-08-08/rust-std-1.80.0-powerpc64le-unknown-freebsd.tar.xz) = f791fd3d02ef6f048cedec8b53d7347f101f75c6c10dccf4ac248d27af44af55 -SIZE (rust/2024-08-08/rust-std-1.80.0-powerpc64le-unknown-freebsd.tar.xz) = 24500892 -SHA256 (rust/2024-08-08/cargo-1.80.0-powerpc64le-unknown-freebsd.tar.xz) = c127afbdd810f8e004af8f7913865f7a4acb6adf25ec8aa498e0baf6d426194b -SIZE (rust/2024-08-08/cargo-1.80.0-powerpc64le-unknown-freebsd.tar.xz) = 9610648 -SHA256 (rust/2024-08-08/rustc-1.80.0-riscv64gc-unknown-freebsd.tar.xz) = a36d350e11e3c5ed3ded4f7edbf553290bd5d2b4728cdd3cf606ba210a22eb9c -SIZE (rust/2024-08-08/rustc-1.80.0-riscv64gc-unknown-freebsd.tar.xz) = 70271380 -SHA256 (rust/2024-08-08/rust-std-1.80.0-riscv64gc-unknown-freebsd.tar.xz) = 69a7a6592258a20fdd636f8a4df2bf3868e9cf06fdaab44265dfec6923960ca0 -SIZE (rust/2024-08-08/rust-std-1.80.0-riscv64gc-unknown-freebsd.tar.xz) = 24436056 -SHA256 (rust/2024-08-08/cargo-1.80.0-riscv64gc-unknown-freebsd.tar.xz) = 2e8fbfcd2cca3c90b6e64505d7bc7debcd60316266eb9b8e69a9909ffc73d029 -SIZE (rust/2024-08-08/cargo-1.80.0-riscv64gc-unknown-freebsd.tar.xz) = 11852028 +TIMESTAMP = 1729451663 +SHA256 (rust/rustc-1.82.0-src.tar.xz) = 1276a0bb8fa12288ba6fa96597d28b40e74c44257c051d3bc02c2b049bb38210 +SIZE (rust/rustc-1.82.0-src.tar.xz) = 219769328 +SHA256 (rust/2024-09-05/rustc-1.81.0-aarch64-unknown-freebsd.tar.xz) = 721beae8927fc82313d397ce8de7f11a298d3f966344943dae98605a4042758c +SIZE (rust/2024-09-05/rustc-1.81.0-aarch64-unknown-freebsd.tar.xz) = 61258492 +SHA256 (rust/2024-09-05/rust-std-1.81.0-aarch64-unknown-freebsd.tar.xz) = 4d3a685ea57f94ab78d35da7bc8290a7a21eac70a6b23240d058ce9e5934af50 +SIZE (rust/2024-09-05/rust-std-1.81.0-aarch64-unknown-freebsd.tar.xz) = 26107012 +SHA256 (rust/2024-09-05/cargo-1.81.0-aarch64-unknown-freebsd.tar.xz) = a213e3470c9d4c4b867657be419c47db6f34047837b0fbcc4e18fa7add181dbf +SIZE (rust/2024-09-05/cargo-1.81.0-aarch64-unknown-freebsd.tar.xz) = 9206832 +SHA256 (rust/2024-09-05/rustc-1.81.0-x86_64-unknown-freebsd.tar.xz) = a1875f80c608dc5e7cf431d782512b36753c7b8a8a7e68b2828542a1b15f4797 +SIZE (rust/2024-09-05/rustc-1.81.0-x86_64-unknown-freebsd.tar.xz) = 50002544 +SHA256 (rust/2024-09-05/rust-std-1.81.0-x86_64-unknown-freebsd.tar.xz) = dd34a1f363e4f36e8814520cd19cb41b8dea4991bf58effa28b68bed5309aa6f +SIZE (rust/2024-09-05/rust-std-1.81.0-x86_64-unknown-freebsd.tar.xz) = 26944964 +SHA256 (rust/2024-09-05/cargo-1.81.0-x86_64-unknown-freebsd.tar.xz) = 0e2578c6d00860bcfcb7f7f55a85a162d98538c8c4ad856cfa0fe8cacf64a564 +SIZE (rust/2024-09-05/cargo-1.81.0-x86_64-unknown-freebsd.tar.xz) = 10321608 +SHA256 (rust/2024-09-05/rustc-1.81.0-armv7-unknown-freebsd.tar.xz) = e9eb04946449d13db88c5f24f431d54b607941ad15ac84d008a9e43aa68e9e9b +SIZE (rust/2024-09-05/rustc-1.81.0-armv7-unknown-freebsd.tar.xz) = 61790324 +SHA256 (rust/2024-09-05/rust-std-1.81.0-armv7-unknown-freebsd.tar.xz) = 13207803e0670b0e3c3edeac90ec7d5925f00304e871e4712f137175f114fc97 +SIZE (rust/2024-09-05/rust-std-1.81.0-armv7-unknown-freebsd.tar.xz) = 25711244 +SHA256 (rust/2024-09-05/cargo-1.81.0-armv7-unknown-freebsd.tar.xz) = 0524f6d8454100be00f7fb7738773ecaa366d8cebcdf55caaf95cfd4c28c2d5c +SIZE (rust/2024-09-05/cargo-1.81.0-armv7-unknown-freebsd.tar.xz) = 9338728 +SHA256 (rust/2024-09-05/rustc-1.81.0-i686-unknown-freebsd.tar.xz) = 5562e52a5d3bc7e6072838c0aa8e7e518fe2db74c0e3792204e1dc5306559b20 +SIZE (rust/2024-09-05/rustc-1.81.0-i686-unknown-freebsd.tar.xz) = 68846504 +SHA256 (rust/2024-09-05/rust-std-1.81.0-i686-unknown-freebsd.tar.xz) = 7f0422aa60f4df0fabc4a07708319b09f496833cc6c4111544710a683b0571b2 +SIZE (rust/2024-09-05/rust-std-1.81.0-i686-unknown-freebsd.tar.xz) = 26734268 +SHA256 (rust/2024-09-05/cargo-1.81.0-i686-unknown-freebsd.tar.xz) = 762a7d113f8c77ae8c50f07da840ccb917cb836b6fbd2427b09967e82189d50a +SIZE (rust/2024-09-05/cargo-1.81.0-i686-unknown-freebsd.tar.xz) = 10756764 +SHA256 (rust/2024-09-05/rustc-1.81.0-powerpc-unknown-freebsd.tar.xz) = 801950501c837591740febb71f4ef70b461a665e6e899badd1dee7010b2b1757 +SIZE (rust/2024-09-05/rustc-1.81.0-powerpc-unknown-freebsd.tar.xz) = 65322316 +SHA256 (rust/2024-09-05/rust-std-1.81.0-powerpc-unknown-freebsd.tar.xz) = 3704d7d1c404698920373db1131a81eb3d5ec0c6b3dd4620c896144dddf3fe53 +SIZE (rust/2024-09-05/rust-std-1.81.0-powerpc-unknown-freebsd.tar.xz) = 24778908 +SHA256 (rust/2024-09-05/cargo-1.81.0-powerpc-unknown-freebsd.tar.xz) = 23f8b7c3195ba7626ac5c897707e36d5a5e701de79c950b3e58bd647e786faba +SIZE (rust/2024-09-05/cargo-1.81.0-powerpc-unknown-freebsd.tar.xz) = 9923104 +SHA256 (rust/2024-09-05/rustc-1.81.0-powerpc64-unknown-freebsd.tar.xz) = 478d738a735eb0d1d6dddaee977c4ce0dc5168fcbd9dcadf67a6fc571cc8986a +SIZE (rust/2024-09-05/rustc-1.81.0-powerpc64-unknown-freebsd.tar.xz) = 63419468 +SHA256 (rust/2024-09-05/rust-std-1.81.0-powerpc64-unknown-freebsd.tar.xz) = 451227b91ed09e7813ffba77b4e17f9b919b11ad373b0bc87a84eec64b7b9a01 +SIZE (rust/2024-09-05/rust-std-1.81.0-powerpc64-unknown-freebsd.tar.xz) = 24849284 +SHA256 (rust/2024-09-05/cargo-1.81.0-powerpc64-unknown-freebsd.tar.xz) = 92dae5616bb090c9ae99d0006fe7612d64773d145f574a091b90cc764287f4ac +SIZE (rust/2024-09-05/cargo-1.81.0-powerpc64-unknown-freebsd.tar.xz) = 9533220 +SHA256 (rust/2024-09-05/rustc-1.81.0-powerpc64le-unknown-freebsd.tar.xz) = 5be810fe0ee72c734c8e00941f1c01a43506ef6063a3aa51e1e6dbb2fefb520b +SIZE (rust/2024-09-05/rustc-1.81.0-powerpc64le-unknown-freebsd.tar.xz) = 65284584 +SHA256 (rust/2024-09-05/rust-std-1.81.0-powerpc64le-unknown-freebsd.tar.xz) = 247759fa4d96ec7c7ee88290700a4ef4c2799e8c8e66e7dafe81ca678d57e4f3 +SIZE (rust/2024-09-05/rust-std-1.81.0-powerpc64le-unknown-freebsd.tar.xz) = 24899100 +SHA256 (rust/2024-09-05/cargo-1.81.0-powerpc64le-unknown-freebsd.tar.xz) = 6e5141477f52caf26583e9d3263698ae427c89bec23b3af8b8e0d59f4e6b46ec +SIZE (rust/2024-09-05/cargo-1.81.0-powerpc64le-unknown-freebsd.tar.xz) = 9825936 +SHA256 (rust/2024-09-05/rustc-1.81.0-riscv64gc-unknown-freebsd.tar.xz) = eec81507223597baa72979407ac0594506aed0d3c42299eb0b8fcc49f27d2251 +SIZE (rust/2024-09-05/rustc-1.81.0-riscv64gc-unknown-freebsd.tar.xz) = 72380112 +SHA256 (rust/2024-09-05/rust-std-1.81.0-riscv64gc-unknown-freebsd.tar.xz) = 160ebd04a8e49ab9b6b3cff4c0e913a433810557fd5ccdb8839ba4facfbdcc3a +SIZE (rust/2024-09-05/rust-std-1.81.0-riscv64gc-unknown-freebsd.tar.xz) = 24745684 +SHA256 (rust/2024-09-05/cargo-1.81.0-riscv64gc-unknown-freebsd.tar.xz) = a42a1fe5cf41c0baf74e69e0d6f9baf3e592570b232bd2c0f752a56f3622a446 +SIZE (rust/2024-09-05/cargo-1.81.0-riscv64gc-unknown-freebsd.tar.xz) = 11996032 diff --git a/lang/rust/files/patch-compiler_rustc__target_src_abi_call_powerpc64.rs b/lang/rust/files/patch-compiler_rustc__target_src_abi_call_powerpc64.rs index 2524e1872984..814822d5b7c7 100644 --- a/lang/rust/files/patch-compiler_rustc__target_src_abi_call_powerpc64.rs +++ b/lang/rust/files/patch-compiler_rustc__target_src_abi_call_powerpc64.rs @@ -1,11 +1,11 @@ --- compiler/rustc_target/src/abi/call/powerpc64.rs.orig 2020-03-09 22:11:17 UTC +++ compiler/rustc_target/src/abi/call/powerpc64.rs -@@ -123,7 +123,7 @@ where +@@ -95,7 +95,7 @@ where ELFv2 } else { match cx.data_layout().endian { - Endian::Big => ELFv1, + Endian::Big => ELFv2, Endian::Little => ELFv2, } }; diff --git a/lang/rust/files/patch-library_backtrace_src_backtrace_mod.rs b/lang/rust/files/patch-library_backtrace_src_backtrace_mod.rs index b1ebad360bc8..f4f618ac6bf1 100644 --- a/lang/rust/files/patch-library_backtrace_src_backtrace_mod.rs +++ b/lang/rust/files/patch-library_backtrace_src_backtrace_mod.rs @@ -1,10 +1,10 @@ --- library/backtrace/src/backtrace/mod.rs.orig 2021-11-29 19:27:28 UTC +++ library/backtrace/src/backtrace/mod.rs -@@ -139,6 +139,7 @@ cfg_if::cfg_if! { +@@ -176,6 +176,7 @@ cfg_if::cfg_if! { + unix, not(target_os = "emscripten"), not(all(target_os = "ios", target_arch = "arm")), - not(all(target_os = "nto", target_env = "nto70")), + not(all(target_os = "freebsd", target_arch = "riscv64")), ), all( target_env = "sgx", diff --git a/lang/rust/files/patch-vendor_cc.rs b/lang/rust/files/patch-vendor_cc.rs index 2d28eb8be9b5..cd36c492c22d 100644 --- a/lang/rust/files/patch-vendor_cc.rs +++ b/lang/rust/files/patch-vendor_cc.rs @@ -1,91 +1,119 @@ When the compiler has "clang" in its name the cc crate will pass an LLVM target triple to it. Rust uses a triple that lacks the OS version and LLVM will default to FreeBSD 9 behavior, i.e., it will default to libstdc++ which is no longer available in newer releases. To avoid this issue assume we have a GNU compatible toolchain instead until LLVM can be updated to use libc++ by default. https://reviews.llvm.org/D77776 --- vendor/cc-1.0.79/src/lib.rs.orig 2021-03-04 20:58:54 UTC +++ vendor/cc-1.0.79/src/lib.rs @@ -2659,24 +2659,7 @@ impl Tool { } fn with_features(path: PathBuf, clang_driver: Option<&str>, cuda: bool) -> Self { - // Try to detect family of the tool from its name, falling back to Gnu. - let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) { - if fname.contains("clang-cl") { - ToolFamily::Msvc { clang_cl: true } - } else if fname.ends_with("cl") || fname == "cl.exe" { - ToolFamily::Msvc { clang_cl: false } - } else if fname.contains("clang") { - match clang_driver { - Some("cl") => ToolFamily::Msvc { clang_cl: true }, - _ => ToolFamily::Clang, - } - } else { - ToolFamily::Gnu - } - } else { - ToolFamily::Gnu - }; - + let family = ToolFamily::Gnu; Tool { path: path, cc_wrapper_path: None, ---- vendor/cc-1.0.90/src/tool.rs.orig 2024-03-18 11:23:17 UTC -+++ vendor/cc-1.0.90/src/tool.rs -@@ -122,22 +122,7 @@ impl Tool { - }; - - // Try to detect family of the tool from its name, falling back to Gnu. -- let family = if let Some(fname) = path.file_name().and_then(|p| p.to_str()) { -- if fname.contains("clang-cl") { -- ToolFamily::Msvc { clang_cl: true } -- } else if fname.ends_with("cl") || fname == "cl.exe" { -- ToolFamily::Msvc { clang_cl: false } -- } else if fname.contains("clang") { -- match clang_driver { -- Some("cl") => ToolFamily::Msvc { clang_cl: true }, -- _ => ToolFamily::Clang, -- } -- } else { -- detect_family(&path) -- } -- } else { -- detect_family(&path) -- }; -+ let family = ToolFamily::Gnu; - - Tool { - path, --- vendor/cc-1.0.97/src/tool.rs.orig 2024-05-09 18:20:47 UTC +++ vendor/cc-1.0.97/src/tool.rs @@ -151,9 +151,7 @@ impl Tool { match (clang, accepts_cl_style_flags, gcc) { (clang_cl, true, _) => Ok(ToolFamily::Msvc { clang_cl }), - (true, false, _) => Ok(ToolFamily::Clang { - zig_cc: is_zig_cc(path, cargo_output), - }), + (true, false, _) => Ok(ToolFamily::Gnu), (false, false, true) => Ok(ToolFamily::Gnu), (false, false, false) => { cargo_output.print_warning(&"Compiler family detection failed since it does not define `__clang__`, `__GNUC__` or `_MSC_VER`, fallback to treating it as GNU"); --- vendor/cc-1.0.99/src/tool.rs.orig 2024-05-09 18:20:47 UTC +++ vendor/cc-1.0.99/src/tool.rs @@ -151,9 +151,7 @@ impl Tool { match (clang, accepts_cl_style_flags, gcc) { (clang_cl, true, _) => Ok(ToolFamily::Msvc { clang_cl }), - (true, false, _) => Ok(ToolFamily::Clang { - zig_cc: is_zig_cc(path, cargo_output), - }), + (true, false, _) => Ok(ToolFamily::Gnu), (false, false, true) => Ok(ToolFamily::Gnu), (false, false, false) => { cargo_output.print_warning(&"Compiler family detection failed since it does not define `__clang__`, `__GNUC__` or `_MSC_VER`, fallback to treating it as GNU"); +--- vendor/cc-1.0.105/src/tool.rs.orig 2024-05-09 18:20:47 UTC ++++ vendor/cc-1.0.105/src/tool.rs +@@ -151,9 +151,7 @@ impl Tool { + + match (clang, accepts_cl_style_flags, gcc) { + (clang_cl, true, _) => Ok(ToolFamily::Msvc { clang_cl }), +- (true, false, _) => Ok(ToolFamily::Clang { +- zig_cc: is_zig_cc(path, cargo_output), +- }), ++ (true, false, _) => Ok(ToolFamily::Gnu), + (false, false, true) => Ok(ToolFamily::Gnu), + (false, false, false) => { + cargo_output.print_warning(&"Compiler family detection failed since it does not define `__clang__`, `__GNUC__` or `_MSC_VER`, fallback to treating it as GNU"); +--- vendor/cc-1.1.5/src/tool.rs.orig 2024-05-09 18:20:47 UTC ++++ vendor/cc-1.1.5/src/tool.rs +@@ -151,9 +151,7 @@ impl Tool { + + match (clang, accepts_cl_style_flags, gcc) { + (clang_cl, true, _) => Ok(ToolFamily::Msvc { clang_cl }), +- (true, false, _) => Ok(ToolFamily::Clang { +- zig_cc: is_zig_cc(path, cargo_output), +- }), ++ (true, false, _) => Ok(ToolFamily::Gnu), + (false, false, true) => Ok(ToolFamily::Gnu), + (false, false, false) => { + cargo_output.print_warning(&"Compiler family detection failed since it does not define `__clang__`, `__GNUC__` or `_MSC_VER`, fallback to treating it as GNU"); + +--- vendor/cc-1.1.6/src/tool.rs.orig 2024-05-09 18:20:47 UTC ++++ vendor/cc-1.1.6/src/tool.rs +@@ -151,9 +151,7 @@ impl Tool { + + match (clang, accepts_cl_style_flags, gcc) { + (clang_cl, true, _) => Ok(ToolFamily::Msvc { clang_cl }), +- (true, false, _) => Ok(ToolFamily::Clang { +- zig_cc: is_zig_cc(path, cargo_output), +- }), ++ (true, false, _) => Ok(ToolFamily::Gnu), + (false, false, true) => Ok(ToolFamily::Gnu), + (false, false, false) => { + cargo_output.print_warning(&"Compiler family detection failed since it does not define `__clang__`, `__GNUC__` or `_MSC_VER`, fallback to treating it as GNU"); + +--- vendor/cc-1.1.10/src/tool.rs.orig 2024-05-09 18:20:47 UTC ++++ vendor/cc-1.1.10/src/tool.rs +@@ -151,9 +151,7 @@ impl Tool { + + match (clang, accepts_cl_style_flags, gcc) { + (clang_cl, true, _) => Ok(ToolFamily::Msvc { clang_cl }), +- (true, false, _) => Ok(ToolFamily::Clang { +- zig_cc: is_zig_cc(path, cargo_output), +- }), ++ (true, false, _) => Ok(ToolFamily::Gnu), + (false, false, true) => Ok(ToolFamily::Gnu), + (false, false, false) => { + cargo_output.print_warning(&"Compiler family detection failed since it does not define `__clang__`, `__GNUC__` or `_MSC_VER`, fallback to treating it as GNU"); diff --git a/lang/rust/files/patch-vendor_libc-0.2.155 b/lang/rust/files/patch-vendor_libc-0.2.155 new file mode 100644 index 000000000000..69c2a03f7062 --- /dev/null +++ b/lang/rust/files/patch-vendor_libc-0.2.155 @@ -0,0 +1,745 @@ +https://github.com/rust-lang/rust/issues/130677 + +From 9049542fabce9eea669d1fe3d4d973931c9d7d23 Mon Sep 17 00:00:00 2001 +From: Alan Somers +Date: Mon, 23 Sep 2024 10:22:32 -0600 +Subject: [PATCH] Fix the definition of ino_t on 32-bit FreeBSD 12+ + +Commit 7437d0a6f1 erroneously defined it as "ulong" instead of u64. +Nobody noticed the mistake, probably because it was only tested on +64-bit architectures, where those are equivalent. But it's a problem +now, after #3723 , which switched the standard library to a FreeBSD 12 +ABI. + +Issue https://github.com/rust-lang/rust/issues/130677 +--- + src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs | 2 +- + src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs | 2 +- + src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs | 2 +- + src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs | 2 +- + src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +index de34069eabdf2..68a8364194607 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +@@ -4,7 +4,7 @@ + pub type nlink_t = u16; + // Type of `dev_t` changed from `u32` to `u64` in FreeBSD 12: + pub type dev_t = u32; +-// Type of `ino_t` changed from `unsigned int` to `unsigned long` in FreeBSD 12: ++// Type of `ino_t` changed from `__uint32_t` to `__uint64_t` in FreeBSD 12: + pub type ino_t = u32; + + s! { +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +index 10fcaa03a4ef6..197400ffb4e28 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +@@ -2,7 +2,7 @@ + + pub type nlink_t = u64; + pub type dev_t = u64; +-pub type ino_t = ::c_ulong; ++pub type ino_t = u64; + pub type shmatt_t = ::c_uint; + + s! { +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +index ec6bce2a03091..d3a77d03c48d0 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +@@ -2,7 +2,7 @@ + + pub type nlink_t = u64; + pub type dev_t = u64; +-pub type ino_t = ::c_ulong; ++pub type ino_t = u64; + pub type shmatt_t = ::c_uint; + pub type kpaddr_t = u64; + pub type kssize_t = i64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +index 160a4baae481b..9d65317d29cb4 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +@@ -2,7 +2,7 @@ + + pub type nlink_t = u64; + pub type dev_t = u64; +-pub type ino_t = ::c_ulong; ++pub type ino_t = u64; + pub type shmatt_t = ::c_uint; + pub type kpaddr_t = u64; + pub type kssize_t = i64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +index d73215a68ec33..f76208400f324 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +@@ -2,7 +2,7 @@ + + pub type nlink_t = u64; + pub type dev_t = u64; +-pub type ino_t = ::c_ulong; ++pub type ino_t = u64; + pub type shmatt_t = ::c_uint; + pub type kpaddr_t = u64; + pub type kssize_t = i64; + + +From 8aca9c0126f3aa5a7dce1ad7fc016b4a0d6af70a Mon Sep 17 00:00:00 2001 +From: Alan Somers +Date: Mon, 23 Sep 2024 10:44:13 -0600 +Subject: [PATCH] Fix the definition of "struct stat" on 32-bit FreeBSD 12+ + +The original definitions were never correct. But nobody noticed because +we don't do CI on 32-bit FreeBSD. The problem is apparent now due to + #3723 , which caused the nightly toolchain to switch to a FreeBSD 12 +ABI. + +Fixes https://github.com/rust-lang/rust/issues/130677 +--- + .../{freebsd12/b64.rs => freebsd11/b32.rs} | 13 +++--- + .../bsd/freebsdlike/freebsd/freebsd11/mod.rs | 7 +-- + .../bsd/freebsdlike/freebsd/freebsd12/mod.rs | 43 +++++++++++++++---- + .../bsd/freebsdlike/freebsd/freebsd13/b64.rs | 34 --------------- + .../bsd/freebsdlike/freebsd/freebsd13/mod.rs | 43 +++++++++++++++---- + .../bsd/freebsdlike/freebsd/freebsd14/b64.rs | 34 --------------- + .../bsd/freebsdlike/freebsd/freebsd14/mod.rs | 43 +++++++++++++++---- + .../bsd/freebsdlike/freebsd/freebsd15/b64.rs | 34 --------------- + .../bsd/freebsdlike/freebsd/freebsd15/mod.rs | 43 +++++++++++++++---- + src/unix/bsd/freebsdlike/freebsd/x86.rs | 25 ----------- + 10 files changed, 146 insertions(+), 173 deletions(-) + rename src/unix/bsd/freebsdlike/freebsd/{freebsd12/b64.rs => freebsd11/b32.rs} (89%) + delete mode 100644 src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs + delete mode 100644 src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs + delete mode 100644 src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs + +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs +similarity index 89% +rename from src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs +rename to src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs + +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs.orig 2024-10-24 17:21:07.154172000 +0200 ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs 2024-10-24 17:21:02.029962000 +0200 +@@ -0,0 +1,34 @@ ++#[repr(C)] ++#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] ++pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++} ++ ++impl ::Copy for ::stat {} ++impl ::Clone for ::stat { ++ fn clone(&self) -> ::stat { ++ *self ++ } ++} + + +index 80c6fa1684530..5c1156581fd61 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs +@@ -3,12 +3,10 @@ + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, +- pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, +- st_padding0: i16, ++ pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, +- st_padding1: i32, + pub st_rdev: ::dev_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, +@@ -16,14 +14,15 @@ pub struct stat { + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, + pub st_size: ::off_t, + pub st_blocks: ::blkcnt_t, + pub st_blksize: ::blksize_t, + pub st_flags: ::fflags_t, +- pub st_gen: u64, +- pub st_spare: [u64; 10], ++ pub st_gen: u32, ++ pub st_lspare: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ __unused: [u8; 8], + } + + impl ::Copy for ::stat {} +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +index 68a8364194607..e416ebf745841 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +@@ -479,10 +479,11 @@ extern "C" { + } + + cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { ++ if #[cfg(target_pointer_width = "64")] { + mod b64; + pub use self::b64::*; ++ } else { ++ mod b32; ++ pub use self::b32::*; + } + } +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +index 197400ffb4e28..c4431a6458e8f 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +@@ -218,6 +218,40 @@ s! { + /// kthread flag. + pub ki_tdflags: ::c_long, + } ++ ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } + } + + s_no_extra_traits! { +@@ -488,15 +522,6 @@ extern "C" { + pub fn basename(path: *mut ::c_char) -> *mut ::c_char; + } + +-cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { +- mod b64; +- pub use self::b64::*; +- } +-} +- + cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs +deleted file mode 100644 +index 80c6fa1684530..0000000000000 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs ++++ /dev/null +@@ -1,34 +0,0 @@ +-#[repr(C)] +-#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] +-pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_nlink: ::nlink_t, +- pub st_mode: ::mode_t, +- st_padding0: i16, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- st_padding1: i32, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u64, +- pub st_spare: [u64; 10], +-} +- +-impl ::Copy for ::stat {} +-impl ::Clone for ::stat { +- fn clone(&self) -> ::stat { +- *self +- } +-} +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +index d3a77d03c48d0..118404e8b089b 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +@@ -228,6 +228,40 @@ s! { + /// kthread flag. + pub ki_tdflags: ::c_long, + } ++ ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } + } + + s_no_extra_traits! { +@@ -529,15 +563,6 @@ extern "C" { + pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t; + } + +-cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { +- mod b64; +- pub use self::b64::*; +- } +-} +- + cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs +deleted file mode 100644 +index 80c6fa1684530..0000000000000 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs ++++ /dev/null +@@ -1,34 +0,0 @@ +-#[repr(C)] +-#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] +-pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_nlink: ::nlink_t, +- pub st_mode: ::mode_t, +- st_padding0: i16, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- st_padding1: i32, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u64, +- pub st_spare: [u64; 10], +-} +- +-impl ::Copy for ::stat {} +-impl ::Clone for ::stat { +- fn clone(&self) -> ::stat { +- *self +- } +-} +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +index 9d65317d29cb4..e624dd7201b0a 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +@@ -228,6 +228,40 @@ s! { + /// kthread flag. + pub ki_tdflags: ::c_long, + } ++ ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } + } + + s_no_extra_traits! { +@@ -529,15 +563,6 @@ extern "C" { + pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t; + } + +-cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { +- mod b64; +- pub use self::b64::*; +- } +-} +- + cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs +deleted file mode 100644 +index 80c6fa1684530..0000000000000 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs ++++ /dev/null +@@ -1,34 +0,0 @@ +-#[repr(C)] +-#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] +-pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_nlink: ::nlink_t, +- pub st_mode: ::mode_t, +- st_padding0: i16, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- st_padding1: i32, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u64, +- pub st_spare: [u64; 10], +-} +- +-impl ::Copy for ::stat {} +-impl ::Clone for ::stat { +- fn clone(&self) -> ::stat { +- *self +- } +-} +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +index f76208400f324..a299af7d5d53e 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +@@ -228,6 +228,40 @@ s! { + /// kthread flag. + pub ki_tdflags: ::c_long, + } ++ ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } + } + + s_no_extra_traits! { +@@ -529,15 +563,6 @@ extern "C" { + pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t; + } + +-cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { +- mod b64; +- pub use self::b64::*; +- } +-} +- + cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/x86.rs b/src/unix/bsd/freebsdlike/freebsd/x86.rs +index c3c576ed66681..31a660e7d0a22 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/x86.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/x86.rs +@@ -42,31 +42,6 @@ s_no_extra_traits! { + } + + s! { +- pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_mode: ::mode_t, +- pub st_nlink: ::nlink_t, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u32, +- pub st_lspare: i32, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- __unused: [u8; 8], +- } +- + pub struct ucontext_t { + pub uc_sigmask: ::sigset_t, + pub uc_mcontext: ::mcontext_t, + + +From f381e010b2439579c9f548ef86fb06409c2c55d2 Mon Sep 17 00:00:00 2001 +From: Alan Somers +Date: Mon, 23 Sep 2024 16:03:48 -0600 +Subject: [PATCH] fixup: fix build on powerpc, powerpc64, and arm + +--- + src/unix/bsd/freebsdlike/freebsd/arm.rs | 30 ------------------- + src/unix/bsd/freebsdlike/freebsd/powerpc.rs | 26 ---------------- + src/unix/bsd/freebsdlike/freebsd/powerpc64.rs | 26 ---------------- + 3 files changed, 82 deletions(-) + +diff --git a/src/unix/bsd/freebsdlike/freebsd/arm.rs b/src/unix/bsd/freebsdlike/freebsd/arm.rs +index 300b3dd45ca9d..8ff500c65981c 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/arm.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/arm.rs +@@ -6,36 +6,6 @@ pub type time_t = i64; + pub type suseconds_t = i32; + pub type register_t = i32; + +-s! { +- pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_mode: ::mode_t, +- pub st_nlink: ::nlink_t, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_atime_pad: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_mtime_pad: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_ctime_pad: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u32, +- pub st_lspare: i32, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- pub st_birthtime_pad: ::c_long, +- } +-} +- + // should be pub(crate), but that requires Rust 1.18.0 + cfg_if! { + if #[cfg(libc_const_size_of)] { +diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc.rs +index a0120c337e0ad..f84062ba34b93 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/powerpc.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/powerpc.rs +@@ -6,32 +6,6 @@ pub type time_t = i64; + pub type suseconds_t = i32; + pub type register_t = i32; + +-s! { +- pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_mode: ::mode_t, +- pub st_nlink: ::nlink_t, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u32, +- pub st_lspare: i32, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- } +-} +- + // should be pub(crate), but that requires Rust 1.18.0 + cfg_if! { + if #[cfg(libc_const_size_of)] { +diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs +index 7f5b9752264e3..69cf4c5fc88c7 100644 +--- vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs ++++ vendor/libc-0.2.155/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs +@@ -6,32 +6,6 @@ pub type time_t = i64; + pub type suseconds_t = i64; + pub type register_t = i64; + +-s! { +- pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_mode: ::mode_t, +- pub st_nlink: ::nlink_t, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u32, +- pub st_lspare: i32, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- } +-} +- + // should be pub(crate), but that requires Rust 1.18.0 + cfg_if! { + if #[cfg(libc_const_size_of)] { diff --git a/lang/rust/files/patch-vendor_libc-0.2.157 b/lang/rust/files/patch-vendor_libc-0.2.157 new file mode 100644 index 000000000000..7a3a31bffed5 --- /dev/null +++ b/lang/rust/files/patch-vendor_libc-0.2.157 @@ -0,0 +1,745 @@ +https://github.com/rust-lang/rust/issues/130677 + +From 9049542fabce9eea669d1fe3d4d973931c9d7d23 Mon Sep 17 00:00:00 2001 +From: Alan Somers +Date: Mon, 23 Sep 2024 10:22:32 -0600 +Subject: [PATCH] Fix the definition of ino_t on 32-bit FreeBSD 12+ + +Commit 7437d0a6f1 erroneously defined it as "ulong" instead of u64. +Nobody noticed the mistake, probably because it was only tested on +64-bit architectures, where those are equivalent. But it's a problem +now, after #3723 , which switched the standard library to a FreeBSD 12 +ABI. + +Issue https://github.com/rust-lang/rust/issues/130677 +--- + src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs | 2 +- + src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs | 2 +- + src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs | 2 +- + src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs | 2 +- + src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +index de34069eabdf2..68a8364194607 100644 +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs ++++ vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +@@ -4,7 +4,7 @@ + pub type nlink_t = u16; + // Type of `dev_t` changed from `u32` to `u64` in FreeBSD 12: + pub type dev_t = u32; +-// Type of `ino_t` changed from `unsigned int` to `unsigned long` in FreeBSD 12: ++// Type of `ino_t` changed from `__uint32_t` to `__uint64_t` in FreeBSD 12: + pub type ino_t = u32; + + s! { +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +index 10fcaa03a4ef6..197400ffb4e28 100644 +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs ++++ vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +@@ -2,7 +2,7 @@ + + pub type nlink_t = u64; + pub type dev_t = u64; +-pub type ino_t = ::c_ulong; ++pub type ino_t = u64; + pub type shmatt_t = ::c_uint; + + s! { +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +index ec6bce2a03091..d3a77d03c48d0 100644 +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs ++++ vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +@@ -2,7 +2,7 @@ + + pub type nlink_t = u64; + pub type dev_t = u64; +-pub type ino_t = ::c_ulong; ++pub type ino_t = u64; + pub type shmatt_t = ::c_uint; + pub type kpaddr_t = u64; + pub type kssize_t = i64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +index 160a4baae481b..9d65317d29cb4 100644 +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs ++++ vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +@@ -2,7 +2,7 @@ + + pub type nlink_t = u64; + pub type dev_t = u64; +-pub type ino_t = ::c_ulong; ++pub type ino_t = u64; + pub type shmatt_t = ::c_uint; + pub type kpaddr_t = u64; + pub type kssize_t = i64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +index d73215a68ec33..f76208400f324 100644 +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs ++++ vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +@@ -2,7 +2,7 @@ + + pub type nlink_t = u64; + pub type dev_t = u64; +-pub type ino_t = ::c_ulong; ++pub type ino_t = u64; + pub type shmatt_t = ::c_uint; + pub type kpaddr_t = u64; + pub type kssize_t = i64; + + +From 8aca9c0126f3aa5a7dce1ad7fc016b4a0d6af70a Mon Sep 17 00:00:00 2001 +From: Alan Somers +Date: Mon, 23 Sep 2024 10:44:13 -0600 +Subject: [PATCH] Fix the definition of "struct stat" on 32-bit FreeBSD 12+ + +The original definitions were never correct. But nobody noticed because +we don't do CI on 32-bit FreeBSD. The problem is apparent now due to + #3723 , which caused the nightly toolchain to switch to a FreeBSD 12 +ABI. + +Fixes https://github.com/rust-lang/rust/issues/130677 +--- + .../{freebsd12/b64.rs => freebsd11/b32.rs} | 13 +++--- + .../bsd/freebsdlike/freebsd/freebsd11/mod.rs | 7 +-- + .../bsd/freebsdlike/freebsd/freebsd12/mod.rs | 43 +++++++++++++++---- + .../bsd/freebsdlike/freebsd/freebsd13/b64.rs | 34 --------------- + .../bsd/freebsdlike/freebsd/freebsd13/mod.rs | 43 +++++++++++++++---- + .../bsd/freebsdlike/freebsd/freebsd14/b64.rs | 34 --------------- + .../bsd/freebsdlike/freebsd/freebsd14/mod.rs | 43 +++++++++++++++---- + .../bsd/freebsdlike/freebsd/freebsd15/b64.rs | 34 --------------- + .../bsd/freebsdlike/freebsd/freebsd15/mod.rs | 43 +++++++++++++++---- + src/unix/bsd/freebsdlike/freebsd/x86.rs | 25 ----------- + 10 files changed, 146 insertions(+), 173 deletions(-) + rename src/unix/bsd/freebsdlike/freebsd/{freebsd12/b64.rs => freebsd11/b32.rs} (89%) + delete mode 100644 src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs + delete mode 100644 src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs + delete mode 100644 src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs + +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs +similarity index 89% +rename from src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs +rename to src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs + +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs.orig 2024-10-24 17:21:07.154172000 +0200 ++++ vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs 2024-10-24 17:21:02.029962000 +0200 +@@ -0,0 +1,34 @@ ++#[repr(C)] ++#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] ++pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++} ++ ++impl ::Copy for ::stat {} ++impl ::Clone for ::stat { ++ fn clone(&self) -> ::stat { ++ *self ++ } ++} + + +index 80c6fa1684530..5c1156581fd61 100644 +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs ++++ vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs +@@ -3,12 +3,10 @@ + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, +- pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, +- st_padding0: i16, ++ pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, +- st_padding1: i32, + pub st_rdev: ::dev_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, +@@ -16,14 +14,15 @@ pub struct stat { + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, + pub st_size: ::off_t, + pub st_blocks: ::blkcnt_t, + pub st_blksize: ::blksize_t, + pub st_flags: ::fflags_t, +- pub st_gen: u64, +- pub st_spare: [u64; 10], ++ pub st_gen: u32, ++ pub st_lspare: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ __unused: [u8; 8], + } + + impl ::Copy for ::stat {} +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +index 68a8364194607..e416ebf745841 100644 +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs ++++ vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +@@ -479,10 +479,11 @@ extern "C" { + } + + cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { ++ if #[cfg(target_pointer_width = "64")] { + mod b64; + pub use self::b64::*; ++ } else { ++ mod b32; ++ pub use self::b32::*; + } + } +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +index 197400ffb4e28..c4431a6458e8f 100644 +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs ++++ vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +@@ -218,6 +218,40 @@ s! { + /// kthread flag. + pub ki_tdflags: ::c_long, + } ++ ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } + } + + s_no_extra_traits! { +@@ -488,15 +522,6 @@ extern "C" { + pub fn basename(path: *mut ::c_char) -> *mut ::c_char; + } + +-cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { +- mod b64; +- pub use self::b64::*; +- } +-} +- + cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs +deleted file mode 100644 +index 80c6fa1684530..0000000000000 +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs ++++ /dev/null +@@ -1,34 +0,0 @@ +-#[repr(C)] +-#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] +-pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_nlink: ::nlink_t, +- pub st_mode: ::mode_t, +- st_padding0: i16, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- st_padding1: i32, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u64, +- pub st_spare: [u64; 10], +-} +- +-impl ::Copy for ::stat {} +-impl ::Clone for ::stat { +- fn clone(&self) -> ::stat { +- *self +- } +-} +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +index d3a77d03c48d0..118404e8b089b 100644 +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs ++++ vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +@@ -228,6 +228,40 @@ s! { + /// kthread flag. + pub ki_tdflags: ::c_long, + } ++ ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } + } + + s_no_extra_traits! { +@@ -529,15 +563,6 @@ extern "C" { + pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t; + } + +-cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { +- mod b64; +- pub use self::b64::*; +- } +-} +- + cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs +deleted file mode 100644 +index 80c6fa1684530..0000000000000 +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs ++++ /dev/null +@@ -1,34 +0,0 @@ +-#[repr(C)] +-#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] +-pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_nlink: ::nlink_t, +- pub st_mode: ::mode_t, +- st_padding0: i16, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- st_padding1: i32, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u64, +- pub st_spare: [u64; 10], +-} +- +-impl ::Copy for ::stat {} +-impl ::Clone for ::stat { +- fn clone(&self) -> ::stat { +- *self +- } +-} +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +index 9d65317d29cb4..e624dd7201b0a 100644 +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs ++++ vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +@@ -228,6 +228,40 @@ s! { + /// kthread flag. + pub ki_tdflags: ::c_long, + } ++ ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } + } + + s_no_extra_traits! { +@@ -529,15 +563,6 @@ extern "C" { + pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t; + } + +-cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { +- mod b64; +- pub use self::b64::*; +- } +-} +- + cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs +deleted file mode 100644 +index 80c6fa1684530..0000000000000 +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs ++++ /dev/null +@@ -1,34 +0,0 @@ +-#[repr(C)] +-#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] +-pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_nlink: ::nlink_t, +- pub st_mode: ::mode_t, +- st_padding0: i16, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- st_padding1: i32, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u64, +- pub st_spare: [u64; 10], +-} +- +-impl ::Copy for ::stat {} +-impl ::Clone for ::stat { +- fn clone(&self) -> ::stat { +- *self +- } +-} +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +index f76208400f324..a299af7d5d53e 100644 +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs ++++ vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +@@ -228,6 +228,40 @@ s! { + /// kthread flag. + pub ki_tdflags: ::c_long, + } ++ ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } + } + + s_no_extra_traits! { +@@ -529,15 +563,6 @@ extern "C" { + pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t; + } + +-cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { +- mod b64; +- pub use self::b64::*; +- } +-} +- + cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/x86.rs b/src/unix/bsd/freebsdlike/freebsd/x86.rs +index c3c576ed66681..31a660e7d0a22 100644 +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/x86.rs ++++ vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/x86.rs +@@ -42,31 +42,6 @@ s_no_extra_traits! { + } + + s! { +- pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_mode: ::mode_t, +- pub st_nlink: ::nlink_t, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u32, +- pub st_lspare: i32, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- __unused: [u8; 8], +- } +- + pub struct ucontext_t { + pub uc_sigmask: ::sigset_t, + pub uc_mcontext: ::mcontext_t, + + +From f381e010b2439579c9f548ef86fb06409c2c55d2 Mon Sep 17 00:00:00 2001 +From: Alan Somers +Date: Mon, 23 Sep 2024 16:03:48 -0600 +Subject: [PATCH] fixup: fix build on powerpc, powerpc64, and arm + +--- + src/unix/bsd/freebsdlike/freebsd/arm.rs | 30 ------------------- + src/unix/bsd/freebsdlike/freebsd/powerpc.rs | 26 ---------------- + src/unix/bsd/freebsdlike/freebsd/powerpc64.rs | 26 ---------------- + 3 files changed, 82 deletions(-) + +diff --git a/src/unix/bsd/freebsdlike/freebsd/arm.rs b/src/unix/bsd/freebsdlike/freebsd/arm.rs +index 300b3dd45ca9d..8ff500c65981c 100644 +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/arm.rs ++++ vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/arm.rs +@@ -6,36 +6,6 @@ pub type time_t = i64; + pub type suseconds_t = i32; + pub type register_t = i32; + +-s! { +- pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_mode: ::mode_t, +- pub st_nlink: ::nlink_t, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_atime_pad: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_mtime_pad: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_ctime_pad: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u32, +- pub st_lspare: i32, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- pub st_birthtime_pad: ::c_long, +- } +-} +- + // should be pub(crate), but that requires Rust 1.18.0 + cfg_if! { + if #[cfg(libc_const_size_of)] { +diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc.rs +index a0120c337e0ad..f84062ba34b93 100644 +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/powerpc.rs ++++ vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/powerpc.rs +@@ -6,32 +6,6 @@ pub type time_t = i64; + pub type suseconds_t = i32; + pub type register_t = i32; + +-s! { +- pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_mode: ::mode_t, +- pub st_nlink: ::nlink_t, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u32, +- pub st_lspare: i32, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- } +-} +- + // should be pub(crate), but that requires Rust 1.18.0 + cfg_if! { + if #[cfg(libc_const_size_of)] { +diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs +index 7f5b9752264e3..69cf4c5fc88c7 100644 +--- vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs ++++ vendor/libc-0.2.157/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs +@@ -6,32 +6,6 @@ pub type time_t = i64; + pub type suseconds_t = i64; + pub type register_t = i64; + +-s! { +- pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_mode: ::mode_t, +- pub st_nlink: ::nlink_t, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u32, +- pub st_lspare: i32, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- } +-} +- + // should be pub(crate), but that requires Rust 1.18.0 + cfg_if! { + if #[cfg(libc_const_size_of)] { diff --git a/lang/rust/files/patch-vendor_libc-0.2.158 b/lang/rust/files/patch-vendor_libc-0.2.158 new file mode 100644 index 000000000000..6f8b8d093a71 --- /dev/null +++ b/lang/rust/files/patch-vendor_libc-0.2.158 @@ -0,0 +1,745 @@ +https://github.com/rust-lang/rust/issues/130677 + +From 9049542fabce9eea669d1fe3d4d973931c9d7d23 Mon Sep 17 00:00:00 2001 +From: Alan Somers +Date: Mon, 23 Sep 2024 10:22:32 -0600 +Subject: [PATCH] Fix the definition of ino_t on 32-bit FreeBSD 12+ + +Commit 7437d0a6f1 erroneously defined it as "ulong" instead of u64. +Nobody noticed the mistake, probably because it was only tested on +64-bit architectures, where those are equivalent. But it's a problem +now, after #3723 , which switched the standard library to a FreeBSD 12 +ABI. + +Issue https://github.com/rust-lang/rust/issues/130677 +--- + src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs | 2 +- + src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs | 2 +- + src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs | 2 +- + src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs | 2 +- + src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +index de34069eabdf2..68a8364194607 100644 +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs ++++ vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +@@ -4,7 +4,7 @@ + pub type nlink_t = u16; + // Type of `dev_t` changed from `u32` to `u64` in FreeBSD 12: + pub type dev_t = u32; +-// Type of `ino_t` changed from `unsigned int` to `unsigned long` in FreeBSD 12: ++// Type of `ino_t` changed from `__uint32_t` to `__uint64_t` in FreeBSD 12: + pub type ino_t = u32; + + s! { +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +index 10fcaa03a4ef6..197400ffb4e28 100644 +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs ++++ vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +@@ -2,7 +2,7 @@ + + pub type nlink_t = u64; + pub type dev_t = u64; +-pub type ino_t = ::c_ulong; ++pub type ino_t = u64; + pub type shmatt_t = ::c_uint; + + s! { +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +index ec6bce2a03091..d3a77d03c48d0 100644 +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs ++++ vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +@@ -2,7 +2,7 @@ + + pub type nlink_t = u64; + pub type dev_t = u64; +-pub type ino_t = ::c_ulong; ++pub type ino_t = u64; + pub type shmatt_t = ::c_uint; + pub type kpaddr_t = u64; + pub type kssize_t = i64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +index 160a4baae481b..9d65317d29cb4 100644 +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs ++++ vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +@@ -2,7 +2,7 @@ + + pub type nlink_t = u64; + pub type dev_t = u64; +-pub type ino_t = ::c_ulong; ++pub type ino_t = u64; + pub type shmatt_t = ::c_uint; + pub type kpaddr_t = u64; + pub type kssize_t = i64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +index d73215a68ec33..f76208400f324 100644 +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs ++++ vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +@@ -2,7 +2,7 @@ + + pub type nlink_t = u64; + pub type dev_t = u64; +-pub type ino_t = ::c_ulong; ++pub type ino_t = u64; + pub type shmatt_t = ::c_uint; + pub type kpaddr_t = u64; + pub type kssize_t = i64; + + +From 8aca9c0126f3aa5a7dce1ad7fc016b4a0d6af70a Mon Sep 17 00:00:00 2001 +From: Alan Somers +Date: Mon, 23 Sep 2024 10:44:13 -0600 +Subject: [PATCH] Fix the definition of "struct stat" on 32-bit FreeBSD 12+ + +The original definitions were never correct. But nobody noticed because +we don't do CI on 32-bit FreeBSD. The problem is apparent now due to + #3723 , which caused the nightly toolchain to switch to a FreeBSD 12 +ABI. + +Fixes https://github.com/rust-lang/rust/issues/130677 +--- + .../{freebsd12/b64.rs => freebsd11/b32.rs} | 13 +++--- + .../bsd/freebsdlike/freebsd/freebsd11/mod.rs | 7 +-- + .../bsd/freebsdlike/freebsd/freebsd12/mod.rs | 43 +++++++++++++++---- + .../bsd/freebsdlike/freebsd/freebsd13/b64.rs | 34 --------------- + .../bsd/freebsdlike/freebsd/freebsd13/mod.rs | 43 +++++++++++++++---- + .../bsd/freebsdlike/freebsd/freebsd14/b64.rs | 34 --------------- + .../bsd/freebsdlike/freebsd/freebsd14/mod.rs | 43 +++++++++++++++---- + .../bsd/freebsdlike/freebsd/freebsd15/b64.rs | 34 --------------- + .../bsd/freebsdlike/freebsd/freebsd15/mod.rs | 43 +++++++++++++++---- + src/unix/bsd/freebsdlike/freebsd/x86.rs | 25 ----------- + 10 files changed, 146 insertions(+), 173 deletions(-) + rename src/unix/bsd/freebsdlike/freebsd/{freebsd12/b64.rs => freebsd11/b32.rs} (89%) + delete mode 100644 src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs + delete mode 100644 src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs + delete mode 100644 src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs + +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs +similarity index 89% +rename from src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs +rename to src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs + +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs.orig 2024-10-24 17:21:07.154172000 +0200 ++++ vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs 2024-10-24 17:21:02.029962000 +0200 +@@ -0,0 +1,34 @@ ++#[repr(C)] ++#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] ++pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++} ++ ++impl ::Copy for ::stat {} ++impl ::Clone for ::stat { ++ fn clone(&self) -> ::stat { ++ *self ++ } ++} + + +index 80c6fa1684530..5c1156581fd61 100644 +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd12/b64.rs ++++ vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs +@@ -3,12 +3,10 @@ + pub struct stat { + pub st_dev: ::dev_t, + pub st_ino: ::ino_t, +- pub st_nlink: ::nlink_t, + pub st_mode: ::mode_t, +- st_padding0: i16, ++ pub st_nlink: ::nlink_t, + pub st_uid: ::uid_t, + pub st_gid: ::gid_t, +- st_padding1: i32, + pub st_rdev: ::dev_t, + pub st_atime: ::time_t, + pub st_atime_nsec: ::c_long, +@@ -16,14 +14,15 @@ pub struct stat { + pub st_mtime_nsec: ::c_long, + pub st_ctime: ::time_t, + pub st_ctime_nsec: ::c_long, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, + pub st_size: ::off_t, + pub st_blocks: ::blkcnt_t, + pub st_blksize: ::blksize_t, + pub st_flags: ::fflags_t, +- pub st_gen: u64, +- pub st_spare: [u64; 10], ++ pub st_gen: u32, ++ pub st_lspare: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ __unused: [u8; 8], + } + + impl ::Copy for ::stat {} +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +index 68a8364194607..e416ebf745841 100644 +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs ++++ vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +@@ -479,10 +479,11 @@ extern "C" { + } + + cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { ++ if #[cfg(target_pointer_width = "64")] { + mod b64; + pub use self::b64::*; ++ } else { ++ mod b32; ++ pub use self::b32::*; + } + } +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +index 197400ffb4e28..c4431a6458e8f 100644 +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs ++++ vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +@@ -218,6 +218,40 @@ s! { + /// kthread flag. + pub ki_tdflags: ::c_long, + } ++ ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } + } + + s_no_extra_traits! { +@@ -488,15 +522,6 @@ extern "C" { + pub fn basename(path: *mut ::c_char) -> *mut ::c_char; + } + +-cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { +- mod b64; +- pub use self::b64::*; +- } +-} +- + cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs +deleted file mode 100644 +index 80c6fa1684530..0000000000000 +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd13/b64.rs ++++ /dev/null +@@ -1,34 +0,0 @@ +-#[repr(C)] +-#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] +-pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_nlink: ::nlink_t, +- pub st_mode: ::mode_t, +- st_padding0: i16, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- st_padding1: i32, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u64, +- pub st_spare: [u64; 10], +-} +- +-impl ::Copy for ::stat {} +-impl ::Clone for ::stat { +- fn clone(&self) -> ::stat { +- *self +- } +-} +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +index d3a77d03c48d0..118404e8b089b 100644 +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs ++++ vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +@@ -228,6 +228,40 @@ s! { + /// kthread flag. + pub ki_tdflags: ::c_long, + } ++ ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } + } + + s_no_extra_traits! { +@@ -529,15 +563,6 @@ extern "C" { + pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t; + } + +-cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { +- mod b64; +- pub use self::b64::*; +- } +-} +- + cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs +deleted file mode 100644 +index 80c6fa1684530..0000000000000 +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs ++++ /dev/null +@@ -1,34 +0,0 @@ +-#[repr(C)] +-#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] +-pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_nlink: ::nlink_t, +- pub st_mode: ::mode_t, +- st_padding0: i16, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- st_padding1: i32, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u64, +- pub st_spare: [u64; 10], +-} +- +-impl ::Copy for ::stat {} +-impl ::Clone for ::stat { +- fn clone(&self) -> ::stat { +- *self +- } +-} +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +index 9d65317d29cb4..e624dd7201b0a 100644 +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs ++++ vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +@@ -228,6 +228,40 @@ s! { + /// kthread flag. + pub ki_tdflags: ::c_long, + } ++ ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } + } + + s_no_extra_traits! { +@@ -529,15 +563,6 @@ extern "C" { + pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t; + } + +-cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { +- mod b64; +- pub use self::b64::*; +- } +-} +- + cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs +deleted file mode 100644 +index 80c6fa1684530..0000000000000 +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd15/b64.rs ++++ /dev/null +@@ -1,34 +0,0 @@ +-#[repr(C)] +-#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] +-pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_nlink: ::nlink_t, +- pub st_mode: ::mode_t, +- st_padding0: i16, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- st_padding1: i32, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u64, +- pub st_spare: [u64; 10], +-} +- +-impl ::Copy for ::stat {} +-impl ::Clone for ::stat { +- fn clone(&self) -> ::stat { +- *self +- } +-} +diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +index f76208400f324..a299af7d5d53e 100644 +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs ++++ vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +@@ -228,6 +228,40 @@ s! { + /// kthread flag. + pub ki_tdflags: ::c_long, + } ++ ++ pub struct stat { ++ pub st_dev: ::dev_t, ++ pub st_ino: ::ino_t, ++ pub st_nlink: ::nlink_t, ++ pub st_mode: ::mode_t, ++ st_padding0: i16, ++ pub st_uid: ::uid_t, ++ pub st_gid: ::gid_t, ++ st_padding1: i32, ++ pub st_rdev: ::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: ::time_t, ++ pub st_atime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: ::time_t, ++ pub st_mtime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: ::time_t, ++ pub st_ctime_nsec: ::c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: ::time_t, ++ pub st_birthtime_nsec: ::c_long, ++ pub st_size: ::off_t, ++ pub st_blocks: ::blkcnt_t, ++ pub st_blksize: ::blksize_t, ++ pub st_flags: ::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } + } + + s_no_extra_traits! { +@@ -529,15 +563,6 @@ extern "C" { + pub fn kvm_kerndisp(kd: *mut ::kvm_t) -> ::kssize_t; + } + +-cfg_if! { +- if #[cfg(any(target_arch = "x86_64", +- target_arch = "aarch64", +- target_arch = "riscv64"))] { +- mod b64; +- pub use self::b64::*; +- } +-} +- + cfg_if! { + if #[cfg(target_arch = "x86_64")] { + mod x86_64; +diff --git a/src/unix/bsd/freebsdlike/freebsd/x86.rs b/src/unix/bsd/freebsdlike/freebsd/x86.rs +index c3c576ed66681..31a660e7d0a22 100644 +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/x86.rs ++++ vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/x86.rs +@@ -42,31 +42,6 @@ s_no_extra_traits! { + } + + s! { +- pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_mode: ::mode_t, +- pub st_nlink: ::nlink_t, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u32, +- pub st_lspare: i32, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- __unused: [u8; 8], +- } +- + pub struct ucontext_t { + pub uc_sigmask: ::sigset_t, + pub uc_mcontext: ::mcontext_t, + + +From f381e010b2439579c9f548ef86fb06409c2c55d2 Mon Sep 17 00:00:00 2001 +From: Alan Somers +Date: Mon, 23 Sep 2024 16:03:48 -0600 +Subject: [PATCH] fixup: fix build on powerpc, powerpc64, and arm + +--- + src/unix/bsd/freebsdlike/freebsd/arm.rs | 30 ------------------- + src/unix/bsd/freebsdlike/freebsd/powerpc.rs | 26 ---------------- + src/unix/bsd/freebsdlike/freebsd/powerpc64.rs | 26 ---------------- + 3 files changed, 82 deletions(-) + +diff --git a/src/unix/bsd/freebsdlike/freebsd/arm.rs b/src/unix/bsd/freebsdlike/freebsd/arm.rs +index 300b3dd45ca9d..8ff500c65981c 100644 +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/arm.rs ++++ vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/arm.rs +@@ -6,36 +6,6 @@ pub type time_t = i64; + pub type suseconds_t = i32; + pub type register_t = i32; + +-s! { +- pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_mode: ::mode_t, +- pub st_nlink: ::nlink_t, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_atime_pad: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_mtime_pad: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_ctime_pad: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u32, +- pub st_lspare: i32, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- pub st_birthtime_pad: ::c_long, +- } +-} +- + // should be pub(crate), but that requires Rust 1.18.0 + cfg_if! { + if #[cfg(libc_const_size_of)] { +diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc.rs +index a0120c337e0ad..f84062ba34b93 100644 +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/powerpc.rs ++++ vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/powerpc.rs +@@ -6,32 +6,6 @@ pub type time_t = i64; + pub type suseconds_t = i32; + pub type register_t = i32; + +-s! { +- pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_mode: ::mode_t, +- pub st_nlink: ::nlink_t, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u32, +- pub st_lspare: i32, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- } +-} +- + // should be pub(crate), but that requires Rust 1.18.0 + cfg_if! { + if #[cfg(libc_const_size_of)] { +diff --git a/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs b/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs +index 7f5b9752264e3..69cf4c5fc88c7 100644 +--- vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs ++++ vendor/libc-0.2.158/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs +@@ -6,32 +6,6 @@ pub type time_t = i64; + pub type suseconds_t = i64; + pub type register_t = i64; + +-s! { +- pub struct stat { +- pub st_dev: ::dev_t, +- pub st_ino: ::ino_t, +- pub st_mode: ::mode_t, +- pub st_nlink: ::nlink_t, +- pub st_uid: ::uid_t, +- pub st_gid: ::gid_t, +- pub st_rdev: ::dev_t, +- pub st_atime: ::time_t, +- pub st_atime_nsec: ::c_long, +- pub st_mtime: ::time_t, +- pub st_mtime_nsec: ::c_long, +- pub st_ctime: ::time_t, +- pub st_ctime_nsec: ::c_long, +- pub st_size: ::off_t, +- pub st_blocks: ::blkcnt_t, +- pub st_blksize: ::blksize_t, +- pub st_flags: ::fflags_t, +- pub st_gen: u32, +- pub st_lspare: i32, +- pub st_birthtime: ::time_t, +- pub st_birthtime_nsec: ::c_long, +- } +-} +- + // should be pub(crate), but that requires Rust 1.18.0 + cfg_if! { + if #[cfg(libc_const_size_of)] {