From 045a9ef829fa30c2ba7af47ab34d3b2443024207 Mon Sep 17 00:00:00 2001 From: Lexi Winter Date: Mon, 4 May 2026 14:49:20 +0100 Subject: [PATCH] llvm: Don't install /usr/bin/{gcov,objdump} twice Commit c4f08d46c7f7 moved the symlinks for the LLVM binutils from LLVM itself to the toolchain (usr.bin/clang/toolchain), but did not remove the links for /usr/bin/gcov and /usr/bin/objdump from the llvm version, meaning we installed them twice, once in the clang package and once in the toolchain package. Remove the links from the llvm version and move the MLINKs to toolchain, which is where the other MLINKs dwell. While here, fix toolchain to use the correct build option for llvm-cov, MK_LLVM_COV. Fixes: c4f08d46c7f7 ("llvm-*: Move all LLVM_BINUTILS symlinks to toolchain package") Reported by: jrm Reviewed by: jrm, dim, emaste Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D56788 --- usr.bin/clang/Makefile | 1 + usr.bin/clang/llvm-cov/Makefile | 2 -- usr.bin/clang/llvm-objdump/Makefile | 3 --- usr.bin/clang/toolchain/Makefile | 4 ++++ 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/usr.bin/clang/Makefile b/usr.bin/clang/Makefile index d8650882953..1d80fad2936 100644 --- a/usr.bin/clang/Makefile +++ b/usr.bin/clang/Makefile @@ -65,6 +65,7 @@ SUBDIR+= lldb-server .if ${MK_LLVM_COV} != "no" SUBDIR+= llvm-cov SUBDIR+= llvm-profdata +SUBDIR_DEPEND_toolchain= llvm-cov .endif .endif # TOOLS_PREFIX diff --git a/usr.bin/clang/llvm-cov/Makefile b/usr.bin/clang/llvm-cov/Makefile index 3c02d4b7d14..67a93fa593b 100644 --- a/usr.bin/clang/llvm-cov/Makefile +++ b/usr.bin/clang/llvm-cov/Makefile @@ -1,8 +1,6 @@ .include PROG_CXX= llvm-cov -SYMLINKS= llvm-cov ${BINDIR}/gcov -MLINKS= llvm-cov.1 gcov.1 SRCDIR= llvm/tools/llvm-cov SRCS+= CodeCoverage.cpp diff --git a/usr.bin/clang/llvm-objdump/Makefile b/usr.bin/clang/llvm-objdump/Makefile index 86281217ee0..c0c201b6808 100644 --- a/usr.bin/clang/llvm-objdump/Makefile +++ b/usr.bin/clang/llvm-objdump/Makefile @@ -29,7 +29,4 @@ DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} -SYMLINKS= llvm-objdump ${BINDIR}/objdump -MLINKS= llvm-objdump.1 objdump.1 - .include "../llvm.prog.mk" diff --git a/usr.bin/clang/toolchain/Makefile b/usr.bin/clang/toolchain/Makefile index 1a7db32274e..5f66ae1433b 100644 --- a/usr.bin/clang/toolchain/Makefile +++ b/usr.bin/clang/toolchain/Makefile @@ -7,7 +7,10 @@ SYMLINKS+= llvm-ar ${BINDIR}/ar SYMLINKS+= llvm-ranlib ${BINDIR}/ranlib MLINKS+= llvm-ar.1 ar.1 llvm-ar.1 ranlib.1 +.if ${MK_LLVM_COV} != "no" SYMLINKS+= llvm-cov ${BINDIR}/gcov +MLINKS= llvm-cov.1 gcov.1 +.endif SYMLINKS+= llvm-cxxfilt ${BINDIR}/c++filt MLINKS+= llvm-cxxfilt.1 c++filt.1 @@ -21,6 +24,7 @@ MLINKS+= llvm-objcopy.1 objcopy.1 MLINKS+= llvm-objcopy.1 strip.1 SYMLINKS+= llvm-objdump ${BINDIR}/objdump +MLINKS= llvm-objdump.1 objdump.1 SYMLINKS+= llvm-readelf ${BINDIR}/readelf MLINKS+= llvm-readelf.1 readelf.1