git: 283c8d9c70ca - main - devel/llvm-{cheri,morello}: explain --start/end-no-unused-arguments use

From: Brooks Davis <brooks_at_FreeBSD.org>
Date: Fri, 31 Jan 2025 17:39:55 UTC
The branch main has been updated by brooks:

URL: https://cgit.FreeBSD.org/ports/commit/?id=283c8d9c70ca5f625e11236507ae6c167139dc84

commit 283c8d9c70ca5f625e11236507ae6c167139dc84
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2025-01-30 18:57:46 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2025-01-31 17:39:45 +0000

    devel/llvm-{cheri,morello}: explain --start/end-no-unused-arguments use
    
    I'd misunderstood the case where --start/end-no-unused-arguments were
    needed in my previous commit.  Add a comment with the correct
    explanation which is not future proofing, but instead that some
    invocations of the compiler (e.g., clang -v) don't end up consuming
    the -Xclang arguments.
    
    Reported by:    jrtc27
    Fixes:          1cf80317e3ec devel/llvm-{cheri,morello}: future-proof ABI arguments
---
 devel/llvm-cheri/Makefile                  | 2 +-
 devel/llvm-cheri/files/wrapper-cheri.sh.in | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/devel/llvm-cheri/Makefile b/devel/llvm-cheri/Makefile
index c6855d280205..b79256732509 100644
--- a/devel/llvm-cheri/Makefile
+++ b/devel/llvm-cheri/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	llvm
 PORTVERSION=	${LLVM_MAJOR}.0.d${SNAPDATE}
-PORTREVISION=	3
+PORTREVISION=	4
 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 023833f23195..da080f250d3f 100644
--- a/devel/llvm-cheri/files/wrapper-cheri.sh.in
+++ b/devel/llvm-cheri/files/wrapper-cheri.sh.in
@@ -160,6 +160,10 @@ if [ $CHERIBSD_VERSION -gt 0 ]; then
 				vararg_flags="-Xclang -morello-vararg=new -Xclang -morello-bounded-memargs"
 			fi
 
+			# Some compiler invocations (e.g., "clang -v") don't
+			# consume -Xclang arguments which can lead to unused
+			# argument warnings so we supress them with
+			# --start/end-no-unused-arguments.
 			arch_cflags="-march=morello -mabi=purecap --start-no-unused-arguments $tls_flags $vararg_flags --end-no-unused-arguments"
 			arch_objdump_flags="--mattr=+morello"
 		else