devel/llvm-{cheri,morello}: allow non-triple targets

aarch64 and aarch64-freebsd are both valid targets so remove all
attempts to validate the target in the wrapper script and slightly
expand the match for possible CHERI targets.

Reported by:	jhb
Suggestions from:	jrtc27
Sponsored by:	DARPA, AFRL
This commit is contained in:
Brooks Davis 2025-04-16 20:28:44 +01:00
parent 1c5fc51cb9
commit cbb0094aa1
2 changed files with 4 additions and 12 deletions

View file

@ -1,6 +1,6 @@
PORTNAME= llvm
PORTVERSION= ${LLVM_MAJOR}.0.d${SNAPDATE}
PORTREVISION= 0
PORTREVISION= 1
CATEGORIES= devel lang
PKGNAMESUFFIX= ${LLVM_SUFFIX}

View file

@ -82,15 +82,7 @@ set_sysroot()
set_target()
{
local target="$1"
case "$target" in
*-*-*)
_TARGET="$target"
;;
*)
echo "malformed target triple: '$target'"
;;
esac
_TARGET="$1"
}
tool=$0
@ -147,7 +139,7 @@ arch_objdump_flags=
# than a misguided -mcpu flag.
if [ $CHERIBSD_VERSION -gt 0 ]; then
case "$_TARGET" in
aarch64-*-freebsd*)
aarch64-*-freebsd*|aarch64-freebsd*)
if run_tool llvm-readelf -h ${_SYSROOT}/lib/libc.so.7 | grep "Flags:.*purecap" >/dev/null; then
tls_flags=
vararg_flags=
@ -180,7 +172,7 @@ if [ $CHERIBSD_VERSION -gt 0 ]; then
arch_objdump_flags="--mattr=+morello"
fi
;;
riscv64-*-freebsd*)
riscv64-*-freebsd*|riscv64-freebsd*)
if run_tool llvm-readelf -h ${_SYSROOT}/lib/libc.so.7 | grep "Flags:.*cheriabi" >/dev/null; then
mabi=l64pc128d
else