Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F105944202
D32654.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D32654.diff
View Options
diff --git a/lang/rust/Makefile b/lang/rust/Makefile
--- a/lang/rust/Makefile
+++ b/lang/rust/Makefile
@@ -48,10 +48,11 @@
# ?= to allow users to still overwrite it in make.conf.
TMPDIR?= ${WRKDIR}
-OPTIONS_DEFINE= DOCS GDB LTO SOURCES WASM
+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)
@@ -60,12 +61,12 @@
_RUST_TOOLS+=rustdoc
DOCS_VARS_OFF= _RUST_BUILD_DOCS=false
GDB_RUN_DEPENDS= ${LOCALBASE}/bin/gdb:devel/gdb
+PORT_LLVM_USES= llvm:min=14,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_BUILD_WASM=true \
_RUST_TARGETS+=wasm32-unknown-unknown
-WASM_VARS_OFF= _RUST_BUILD_WASM=false
# See WRKSRC/src/stage0.json for the date and version values
BOOTSTRAPS_DATE?= 2023-07-13
@@ -95,6 +96,13 @@
.include <bsd.port.pre.mk>
+.ifndef NIGHTLY_DATE
+PATCH_SITES= https://github.com/rust-lang/rust/commit/
+# LLVM 17 API compatibility fixes
+PATCHFILES= 71958da4854176c50a8b12470b956d5c7ed11817.patch:-p1 \
+ 6ddf9128b2b55f9def80af57f7353d2521527c6a.patch:-p1
+.endif
+
.if ${OPSYS} != FreeBSD
IGNORE= is only for FreeBSD
.endif
@@ -156,6 +164,11 @@
@${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_DEFAULT}"|' \
+ ${WRKSRC}/compiler/rustc_target/src/spec/wasm_base.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}" \
@@ -190,7 +203,11 @@
@${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml
@${ECHO_CMD} 'deny-warnings=false' >> ${WRKSRC}/config.toml
@${ECHO_CMD} 'verbose-tests=true' >> ${WRKSRC}/config.toml
- @${ECHO_CMD} 'lld=${_RUST_BUILD_WASM}' >> ${WRKSRC}/config.toml
+.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
@@ -230,6 +247,9 @@
.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
diff --git a/lang/rust/distinfo b/lang/rust/distinfo
--- a/lang/rust/distinfo
+++ b/lang/rust/distinfo
@@ -49,3 +49,7 @@
SIZE (rust/2023-07-13/rust-std-1.71.0-riscv64gc-unknown-freebsd.tar.xz) = 24375500
SHA256 (rust/2023-07-13/cargo-1.71.0-riscv64gc-unknown-freebsd.tar.xz) = b49977e17a42a9175cfa016941a6006f8e188f610f4ed59945f114fcb9f04820
SIZE (rust/2023-07-13/cargo-1.71.0-riscv64gc-unknown-freebsd.tar.xz) = 10130160
+SHA256 (rust/71958da4854176c50a8b12470b956d5c7ed11817.patch) = 5a6b67dfc1218ea953421816834ffe3aa8ac1fc078dfaea4ebab121460ca5211
+SIZE (rust/71958da4854176c50a8b12470b956d5c7ed11817.patch) = 2007
+SHA256 (rust/6ddf9128b2b55f9def80af57f7353d2521527c6a.patch) = 6eaaaf6714c496b610712aa9ecbe1a1614e042323ec872fbf31a0a74c9020f29
+SIZE (rust/6ddf9128b2b55f9def80af57f7353d2521527c6a.patch) = 1278
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 23, 10:22 PM (19 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15580445
Default Alt Text
D32654.diff (3 KB)
Attached To
Mode
D32654: lang/rust: restore PORT_LLVM
Attached
Detach File
Event Timeline
Log In to Comment