git: 3b63f0b70671 - stable/13 - llvm: fix some llvm-* tool links when WITH_LLVM_BINUTILS is set

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Thu, 27 Apr 2023 18:20:08 UTC
The branch stable/13 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=3b63f0b7067129ec7a75b9324acf4ded30d8fc44

commit 3b63f0b7067129ec7a75b9324acf4ded30d8fc44
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-04-21 13:11:45 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-04-27 17:03:26 +0000

    llvm: fix some llvm-* tool links when WITH_LLVM_BINUTILS is set
    
    A few Makefiles overrode LINKS and MLINKS when WITH_LLVM_BINUTILS was
    set, which caused some llvm- prefixed tools to disappear.  One such case
    was llvm-ranlib, which some ports invoke explicitly.
    
    Use += when adding to LINKS and MLINKS under WITH_LLVM_BINUTILS.
    
    PR:             270955, 270956, 270959
    Submitted by:   jbeich
    Reviewed by:    arichardson
    Fixes: 021385aba562 ("Add WITH_LLVM_BINUTILS to install LLVM binuti...")
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D39747
    
    (cherry picked from commit 41df1d60e3237df2106dddf357e3205bf29f85d5)
---
 usr.bin/clang/llvm-ar/Makefile         | 4 ++--
 usr.bin/clang/llvm-nm/Makefile         | 4 ++--
 usr.bin/clang/llvm-size/Makefile       | 4 ++--
 usr.bin/clang/llvm-symbolizer/Makefile | 4 ++--
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/usr.bin/clang/llvm-ar/Makefile b/usr.bin/clang/llvm-ar/Makefile
index a6a480bce359..3718248f5de9 100644
--- a/usr.bin/clang/llvm-ar/Makefile
+++ b/usr.bin/clang/llvm-ar/Makefile
@@ -15,8 +15,8 @@ LIBADD+=	z
 LINKS+=		${BINDIR}/llvm-ar ${BINDIR}/llvm-ranlib
 
 .if ${MK_LLVM_BINUTILS} != "no"
-LINKS=		${BINDIR}/llvm-ar ${BINDIR}/ar ${BINDIR}/llvm-ar ${BINDIR}/ranlib
-MLINKS=		llvm-ar.1 ar.1 llvm-ar.1 ranlib.1
+LINKS+=		${BINDIR}/llvm-ar ${BINDIR}/ar ${BINDIR}/llvm-ar ${BINDIR}/ranlib
+MLINKS+=	llvm-ar.1 ar.1 llvm-ar.1 ranlib.1
 .endif
 
 .include "../llvm.prog.mk"
diff --git a/usr.bin/clang/llvm-nm/Makefile b/usr.bin/clang/llvm-nm/Makefile
index 0df48744632d..e0c41e4a0254 100644
--- a/usr.bin/clang/llvm-nm/Makefile
+++ b/usr.bin/clang/llvm-nm/Makefile
@@ -26,8 +26,8 @@ CLEANFILES+=	${TGHDRS} ${TGHDRS:C/$/.d/}
 LIBADD+=	z
 
 .if ${MK_LLVM_BINUTILS} != "no"
-LINKS=		${BINDIR}/llvm-nm ${BINDIR}/nm
-MLINKS=		llvm-nm.1 nm.1
+LINKS+=		${BINDIR}/llvm-nm ${BINDIR}/nm
+MLINKS+=	llvm-nm.1 nm.1
 .endif
 
 .include "../llvm.prog.mk"
diff --git a/usr.bin/clang/llvm-size/Makefile b/usr.bin/clang/llvm-size/Makefile
index 20bd5de61192..bce5cf834e0c 100644
--- a/usr.bin/clang/llvm-size/Makefile
+++ b/usr.bin/clang/llvm-size/Makefile
@@ -24,8 +24,8 @@ DPSRCS+=	${TGHDRS}
 CLEANFILES+=	${TGHDRS} ${TGHDRS:C/$/.d/}
 
 .if ${MK_LLVM_BINUTILS} != "no"
-LINKS=		${BINDIR}/llvm-size ${BINDIR}/size
-MLINKS=		llvm-size.1 size.1
+LINKS+=		${BINDIR}/llvm-size ${BINDIR}/size
+MLINKS+=	llvm-size.1 size.1
 .endif
 
 .include "../llvm.prog.mk"
diff --git a/usr.bin/clang/llvm-symbolizer/Makefile b/usr.bin/clang/llvm-symbolizer/Makefile
index c4677169f912..fcaf8facf1b8 100644
--- a/usr.bin/clang/llvm-symbolizer/Makefile
+++ b/usr.bin/clang/llvm-symbolizer/Makefile
@@ -29,8 +29,8 @@ LIBADD+=	z
 LINKS+=		${BINDIR}/llvm-symbolizer ${BINDIR}/llvm-addr2line
 
 .if ${MK_LLVM_BINUTILS} != "no"
-LINKS=		${BINDIR}/llvm-symbolizer ${BINDIR}/addr2line
-MLINKS=		llvm-addr2line.1 addr2line.1
+LINKS+=		${BINDIR}/llvm-symbolizer ${BINDIR}/addr2line
+MLINKS+=	llvm-addr2line.1 addr2line.1
 .endif
 
 .include "../llvm.prog.mk"