git: bf050595e31d - main - devel/llvm-devel: deduplicate information (NFC)

From: Brooks Davis <brooks_at_FreeBSD.org>
Date: Thu, 29 Sep 2022 22:48:49 UTC
The branch main has been updated by brooks:

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

commit bf050595e31dcb6c8cb7292ac5ad875b5839cc02
Author:     Brooks Davis <brooks@FreeBSD.org>
AuthorDate: 2022-09-29 22:48:41 +0000
Commit:     Brooks Davis <brooks@FreeBSD.org>
CommitDate: 2022-09-29 22:48:41 +0000

    devel/llvm-devel: deduplicate information (NFC)
    
    In COMPILER_RT, key the existance of <san>_ignorelist.txt files on
    libclang_rt.<san>.a in the set of installed runtimes.  This avoids
    needing to maintain per-architecture list of ignore lists.
---
 devel/llvm-devel/Makefile | 22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/devel/llvm-devel/Makefile b/devel/llvm-devel/Makefile
index 0058f2713183..624c4fb862aa 100644
--- a/devel/llvm-devel/Makefile
+++ b/devel/llvm-devel/Makefile
@@ -301,21 +301,13 @@ STRIP=
 
 .if ${ARCH} == "aarch64"
 COMPILER_RT_ARCHS=		aarch64
-COMPILER_RT_IGNORELISTS=	asan_ignorelist.txt
-COMPILER_RT_IGNORELISTS+=	cfi_ignorelist.txt
-COMPILER_RT_IGNORELISTS+=	msan_ignorelist.txt
 .elif ${ARCH} == "amd64"
 COMPILER_RT_ARCHS=		x86_64
-COMPILER_RT_IGNORELISTS=	asan_ignorelist.txt
-COMPILER_RT_IGNORELISTS+=	cfi_ignorelist.txt
-COMPILER_RT_IGNORELISTS+=	msan_ignorelist.txt
 .if exists(/usr/lib32/libc.so.7)
 COMPILER_RT_ARCHS+=		i386
 .endif
 .elif ${ARCH} == "i386"
 COMPILER_RT_ARCHS=		i386
-COMPILER_RT_IGNORELISTS=	asan_ignorelist.txt
-COMPILER_RT_IGNORELISTS+=	cfi_ignorelist.txt
 .elif ${ARCH} == "powerpc"
 COMPILER_RT_ARCHS=		powerpc
 .elif ${ARCH} == "powerpc64"
@@ -323,15 +315,10 @@ COMPILER_RT_ARCHS=		powerpc64
 .if exists(/usr/lib32/libc.so.7)
 COMPILER_RT_ARCHS+=		powerpc
 .endif
-COMPILER_RT_IGNORELISTS=	asan_ignorelist.txt
-COMPILER_RT_IGNORELISTS+=	msan_ignorelist.txt
 .elif ${ARCH} == "powerpc64le"
 COMPILER_RT_ARCHS=		powerpc64le
-COMPILER_RT_IGNORELISTS=	asan_ignorelist.txt
-COMPILER_RT_IGNORELISTS+=	msan_ignorelist.txt
 .elif ${ARCH} == "riscv64"
 COMPILER_RT_ARCHS=		riscv64
-COMPILER_RT_IGNORELISTS=	asan_ignorelist.txt
 .endif
 
 _CRTBASEDIR=	${LLVM_DIR}/lib/clang/${LLVM_RELEASE}
@@ -345,6 +332,15 @@ _COMPILER_RT_LIBS=
 _COMPILER_RT_LIBS:= ${_COMPILER_RT_LIBS} ${COMPILER_RT_LIBS_${CRT_ARCH}:S|^|${_CRTLIBDIR}/${CRT_ARCH}-portbld-${OPSYS:tl}${OSREL}/|}
 .endfor
 
+COMPILER_RT_IGNORELISTS=
+.for RT in asan cfi msan
+.if ${_COMPILER_RT_LIBS:M*/libclang_rt.${RT}.a}
+COMPILER_RT_IGNORELISTS:=	${COMPILER_RT_IGNORELISTS} ${RT}_ignorelist.txt
+.endif
+.endfor
+# Strip empty element
+COMPILER_RT_IGNORELISTS:=${COMPILER_RT_IGNORELISTS:N^$$}
+
 # Comment out plist entries for unsupported options.
 .for opt in ${_ALL_OPTIONS}
 .if !${OPTIONS_DEFINE:M${opt}}