diff options
Diffstat (limited to 'lang/rust/Makefile')
-rw-r--r-- | lang/rust/Makefile | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/lang/rust/Makefile b/lang/rust/Makefile index 568ec5e938a1..017672f2c31b 100644 --- a/lang/rust/Makefile +++ b/lang/rust/Makefile @@ -1,5 +1,5 @@ PORTNAME= rust -PORTVERSION?= 1.77.0 +PORTVERSION?= 1.88.0 PORTREVISION?= 0 CATEGORIES= lang MASTER_SITES= https://static.rust-lang.org/dist/:src \ @@ -47,28 +47,32 @@ CONFLICTS_INSTALL?= rust-nightly TMPDIR?= ${WRKDIR} OPTIONS_DEFINE= DOCS GDB LTO PORT_LLVM SOURCES WASM -OPTIONS_DEFAULT= SOURCES WASM +OPTIONS_DEFAULT= DOCS SOURCES WASM +OPTIONS_DEFINE_i386= SSE2 +OPTIONS_DEFAULT_i386= SSE2 GDB_DESC= Install ports gdb (necessary for debugging rust programs) PORT_LLVM_DESC= Build against devel/llvm instead of bundled copy (experimental) +SSE2_DESC= Enable SSE2 instructions SOURCES_DESC= Install source files WASM_DESC= Build the WebAssembly target (wasm32-unknown-unknown) +SSE2_EXTRA_PATCHES_OFF+= ${FILESDIR}/extra-patch-compiler_rustc__target_src_spec_targets_i686__unknown__freebsd.rs + DOCS_VARS= _RUST_BUILD_DOCS=true \ - _COMPONENTS+="rust-docs-${_PACKAGE_VERS}-${_RUST_TARGET} rust-docs-json-${_PACKAGE_VERS}-${_RUST_TARGET}" \ - _RUST_TOOLS+=rustdoc + _COMPONENTS+="rust-docs-${_PACKAGE_VERS}-${_RUST_TARGET} rust-docs-json-${_PACKAGE_VERS}-${_RUST_TARGET}" DOCS_VARS_OFF= _RUST_BUILD_DOCS=false GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb -PORT_LLVM_USES= llvm:min=16,lib,noexport +PORT_LLVM_USES= llvm:min=19,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.json for the date and version values -BOOTSTRAPS_DATE?= 2024-02-08 -RUST_BOOTSTRAP_VERSION?= 1.76.0 +# See WRKSRC/src/stage0 for the date and version values +BOOTSTRAPS_DATE?= 2025-05-15 +RUST_BOOTSTRAP_VERSION?= 1.87.0 CARGO_VENDOR_DIR?= ${WRKSRC}/vendor @@ -101,15 +105,10 @@ IGNORE= is only for FreeBSD .if ${ARCH} == powerpc LIB_DEPENDS+= libatomic.so:lang/gcc${GCC_DEFAULT} MAKE_ENV+= RUSTFLAGS="-L/usr/local/lib/gcc${GCC_DEFAULT}" -.else -MAKE_ENV+= RUST_BACKTRACE=1 .endif -# rls doesn't build on rust nightly -# rls needs 64-bit atomics: it doesn't build on powerpc -.if !defined(NIGHTLY_DATE) && ${ARCH} != powerpc -_RUST_TOOLS+= rls -_COMPONENTS+= rls-${_PACKAGE_VERS}-${_RUST_TARGET} +.if ${ARCH} != powerpc64le +MAKE_ENV+= RUST_BACKTRACE=1 .endif # per https://rust-lang.github.io/rustup/concepts/components.html @@ -122,6 +121,10 @@ _COMPONENTS+= rustc-dev-${_PACKAGE_VERS}-${_RUST_TARGET} _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 @@ -134,7 +137,7 @@ DISTFILES:= ${DISTFILES:M*\:src} \ post-patch: @${REINPLACE_CMD} 's,gdb,${LOCALBASE}/bin/gdb,' ${WRKSRC}/src/etc/rust-gdb .if defined(NIGHTLY_DATE) - @${REINPLACE_CMD} 's/"rustfmt"/"nothx"/' ${WRKSRC}/src/stage0.json + @${REINPLACE_CMD} 's/rustfmt/nothx/' ${WRKSRC}/src/stage0 .endif # Disable vendor checksums @${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \ @@ -153,7 +156,6 @@ do-configure: @cd ${WRKDIR}/${_component}-*-${OPSYS:tl} && \ ${SH} install.sh --prefix=${WRKDIR}/bootstrap --verbose .endfor - @${ECHO_CMD} 'changelog-seen=2' > ${WRKSRC}/config.toml @${ECHO_CMD} '[build]' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'build-dir="${WRKDIR}/_build"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'build-stage=2' >> ${WRKSRC}/config.toml @@ -179,6 +181,7 @@ do-configure: @${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'deny-warnings=false' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'verbose-tests=true' >> ${WRKSRC}/config.toml + @${ECHO_CMD} 'download-rustc=false' >> ${WRKSRC}/config.toml .if ${PORT_OPTIONS:MWASM} && !${PORT_OPTIONS:MPORT_LLVM} @${ECHO_CMD} 'lld=true' >> ${WRKSRC}/config.toml .else @@ -187,7 +190,9 @@ do-configure: .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 + @${ECHO_CMD} 'download-ci-llvm=false' >> ${WRKSRC}/config.toml .if ${PORT_OPTIONS:MLTO} @${ECHO_CMD} 'thin-lto=true' >> ${WRKSRC}/config.toml .endif @@ -201,12 +206,10 @@ do-configure: # Rust doesn't call the system compiler with the full version of the target. # This makes powerpc miscompile due to the secure-plt ABI change. # Additionally, force using ld.bfd to work around a linking problem in rustc_mir - @${PRINTF} '#!/bin/sh\nexec ${CC} "$$@" --target=powerpc-unknown-freebsd13.0' > ${WRKDIR}/cc-wrapper + @${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.0' > ${WRKDIR}/cxx-wrapper + @${PRINTF} '#!/bin/sh\nexec ${CXX} "$$@" --target=powerpc-unknown-freebsd13.2' > ${WRKDIR}/cxx-wrapper @${CHMOD} +x ${WRKDIR}/cxx-wrapper - @${PRINTF} '#!/bin/sh\nexec ${CC} -fuse-ld=bfd "$$@" --target=powerpc-unknown-freebsd13.0' > ${WRKDIR}/ld-wrapper - @${CHMOD} +x ${WRKDIR}/ld-wrapper .endif .for _target in ${_RUST_TARGETS} @${ECHO_CMD} '[target.${_target}]' >> ${WRKSRC}/config.toml @@ -218,21 +221,13 @@ do-configure: @${ECHO_CMD} 'cc="${CC}"' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'cxx="${CXX}"' >> ${WRKSRC}/config.toml .endif -.if ${ARCH} == powerpc - @${ECHO_CMD} 'linker="${WRKDIR}/ld-wrapper"' >> ${WRKSRC}/config.toml -.else @${ECHO_CMD} 'linker="${CC}"' >> ${WRKSRC}/config.toml -.endif .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 -.if defined(NIGHTLY_DATE) -# Don't abort if optional tools fail to build - @${ECHO_CMD} 'missing-tools=true' >> ${WRKSRC}/config.toml -.endif do-build: @cd ${WRKSRC} && \ |