Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152498132
D23100.id66694.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D23100.id66694.diff
View Options
Index: head/Mk/Scripts/rust-compat11-canary.sh
===================================================================
--- head/Mk/Scripts/rust-compat11-canary.sh
+++ head/Mk/Scripts/rust-compat11-canary.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+# MAINTAINER: rust@FreeBSD.org
+# $FreeBSD$
+set -eu
+
+if [ "${OPSYS}" != FreeBSD ] || [ "${OSVERSION}" -lt 1200000 ]; then
+ exit 0
+fi
+
+cat <<EOF | ${CC} -o "${WRKDIR}/compat11_canary" -xc -
+#include <sys/syscall.h>
+#include <errno.h>
+#include <unistd.h>
+
+int
+main(void)
+{
+ return syscall(SYS_freebsd11_mknod, "", 0, 0) < 0 && errno == ENOSYS;
+}
+EOF
+# Canary might be aborted with SIGSYS
+ulimit -c 0
+if ! "${WRKDIR}/compat11_canary"; then
+ echo "=> Sanity check failed: kernel is missing COMPAT_FREEBSD11"
+ echo "=> Aborting build"
+ exit 1
+fi
Index: head/Mk/Uses/cargo.mk
===================================================================
--- head/Mk/Uses/cargo.mk
+++ head/Mk/Uses/cargo.mk
@@ -247,6 +247,9 @@
# configure hook. Place a config file for overriding crates-io index
# by local source directory.
cargo-configure:
+# Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64
+ @${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \
+ ${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh
@${MKDIR} ${WRKDIR}/.cargo
@${ECHO_CMD} "[source.cargo]" > ${WRKDIR}/.cargo/config
@${ECHO_CMD} "directory = '${CARGO_VENDOR_DIR}'" >> ${WRKDIR}/.cargo/config
Index: head/Mk/bsd.gecko.mk
===================================================================
--- head/Mk/bsd.gecko.mk
+++ head/Mk/bsd.gecko.mk
@@ -376,6 +376,11 @@
@${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:
Index: head/lang/rust/Makefile
===================================================================
--- head/lang/rust/Makefile
+++ head/lang/rust/Makefile
@@ -142,6 +142,9 @@
${WRKSRC}/src/bootstrap/install.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
@${ECHO_CMD} '[build]' > ${WRKSRC}/config.toml
@${ECHO_CMD} 'vendor=true' >> ${WRKSRC}/config.toml
@${ECHO_CMD} 'extended=true' >> ${WRKSRC}/config.toml
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 16, 8:30 AM (9 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31590077
Default Alt Text
D23100.id66694.diff (2 KB)
Attached To
Mode
D23100: lang/rust: Add COMPAT_FREEBSD11 canary
Attached
Detach File
Event Timeline
Log In to Comment