From cbb0094aa11dda2e06aa264acfb6c19481ae100f Mon Sep 17 00:00:00 2001 From: Brooks Davis Date: Wed, 16 Apr 2025 20:28:44 +0100 Subject: [PATCH] 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 --- devel/llvm-cheri/Makefile | 2 +- devel/llvm-cheri/files/wrapper-cheri.sh.in | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/devel/llvm-cheri/Makefile b/devel/llvm-cheri/Makefile index 733933c863e4..66c195ea5d11 100644 --- a/devel/llvm-cheri/Makefile +++ b/devel/llvm-cheri/Makefile @@ -1,6 +1,6 @@ PORTNAME= llvm PORTVERSION= ${LLVM_MAJOR}.0.d${SNAPDATE} -PORTREVISION= 0 +PORTREVISION= 1 CATEGORIES= devel lang PKGNAMESUFFIX= ${LLVM_SUFFIX} diff --git a/devel/llvm-cheri/files/wrapper-cheri.sh.in b/devel/llvm-cheri/files/wrapper-cheri.sh.in index a99decb9b056..113aacf20a5a 100644 --- a/devel/llvm-cheri/files/wrapper-cheri.sh.in +++ b/devel/llvm-cheri/files/wrapper-cheri.sh.in @@ -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