freebsd-ports/Mk/Scripts/rust-compat11-canary.sh
Rene Ladan 620968a43a cleanup: drop support for EOL FreeBSD 11.X
Search criteria used:
- 11.4
- OSREL*
- OSVER*
- *_FreeBSD_11

Input from:
- adridg: devel/qca-legacy
- jbeich: _WITH_DPRINTF, _WITH_GETLINE, GNU bfd workarounds
- sunpoet: security/p5-*OpenSSL*

Reviewed by:	doceng, kde, multimedia, perl, python, ruby, rust
Differential Revision: https://reviews.freebsd.org/D32008
Test Plan: make index
2021-09-30 23:23:30 +02:00

27 lines
521 B
Bash

#!/bin/sh
# MAINTAINER: rust@FreeBSD.org
set -eu
set -o pipefail
if [ "${OPSYS}" != FreeBSD ] ; 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