git: 5f2e84015da7 - main - bsd.lib.mk: decouple lib*_pic.a from TOOLCHAIN build knob

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Mon, 01 May 2023 20:47:26 UTC
The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=5f2e84015da7a664bba0af7727349c9c3f6902ba

commit 5f2e84015da7a664bba0af7727349c9c3f6902ba
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-05-01 20:33:47 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-05-01 20:46:39 +0000

    bsd.lib.mk: decouple lib*_pic.a from TOOLCHAIN build knob
    
    A user may use a tool chain from a package or just use an existing
    tool chain from a previous installation.  There is no reason for this
    to disable the installation of lib${LIB}_pic.a.
    
    This also means we don't need to force MK_TOOLCHAIN=yes in lib/libc.
    
    This reverts part of commit c0f5aeb0329d71e6b02379133c0c9c0145c9afea.
    
    Reviewed by:    jrtc27
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D39917
---
 lib/libc/Makefile   | 3 ---
 share/mk/bsd.lib.mk | 4 ++--
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index e2a8f1473bf3..2b06bc1b3c5a 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -6,9 +6,6 @@ SHLIBDIR?= /lib
 
 .include <src.opts.mk>
 
-# Force building of libc_pic.a
-MK_TOOLCHAIN=	yes
-
 LIBC_SRCTOP?= ${.CURDIR}
 
 # Pick the current architecture directory for libc. In general, this is
diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk
index 1d4a97134d41..8e5035f6db41 100644
--- a/share/mk/bsd.lib.mk
+++ b/share/mk/bsd.lib.mk
@@ -378,7 +378,7 @@ ${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL}
 .endif
 .endif #defined(SHLIB_NAME)
 
-.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no"
+.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
 _LIBS+=		lib${LIB_PRIVATE}${LIB}_pic.a
 
 lib${LIB_PRIVATE}${LIB}_pic.a: ${SOBJS}
@@ -540,7 +540,7 @@ _libinstall:
 .endif # SHLIB_LDSCRIPT
 .endif # SHLIB_LINK
 .endif # SHIB_NAME
-.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no"
+.if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB)
 	${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
 	    ${_INSTALLFLAGS} lib${LIB}_pic.a ${DESTDIR}${_LIBDIR}/
 .endif