From nobody Sun Oct 10 05:51:06 2021 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 8C4C417E710C; Sun, 10 Oct 2021 05:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HRrdQ3JQ7z4mSs; Sun, 10 Oct 2021 05:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 528FF1E9; Sun, 10 Oct 2021 05:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19A5p6x0019270; Sun, 10 Oct 2021 05:51:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19A5p63p019269; Sun, 10 Oct 2021 05:51:06 GMT (envelope-from git) Date: Sun, 10 Oct 2021 05:51:06 GMT Message-Id: <202110100551.19A5p63p019269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: 9294a2c7195a - main - ncurses: convert libncursesw.a into a static ldscript List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9294a2c7195ade0055c9d0b2917d929f5b20c035 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=9294a2c7195ade0055c9d0b2917d929f5b20c035 commit 9294a2c7195ade0055c9d0b2917d929f5b20c035 Author: Baptiste Daroussin AuthorDate: 2021-10-10 05:37:26 +0000 Commit: Baptiste Daroussin CommitDate: 2021-10-10 05:51:00 +0000 ncurses: convert libncursesw.a into a static ldscript Introduce the notion of static linker scripts to allow libncursesw.a to track its dependency on libtinfow.a this allows the build of older freebsd source tree to happen and make static linking in part with dynamic linking which already provides a ldscript This fixes a bootstrapping FreeBSD 12 or 13 on recent FreeBSD 14 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D32435 --- lib/ncurses/ncurses/Makefile | 14 ++++++++++++++ share/mk/bsd.lib.mk | 9 ++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index d2ba1007b54a..5f80def49458 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -169,6 +169,11 @@ SYMLINKS+= libncursesw_p.a ${LIBDIR}/libcurses_p.a LIBADD+= tinfow SHLIB_LDSCRIPT= libncursesw.ldscript +STATIC_LDSCRIPT= libncursesw.aldscript +CLEANFILES+= ${STATIC_LDSCRIPT} + +libncursesw.aldscript: + @${ECHO} "INPUT(-lncursesw_real -ltinfow)" >$@ libncurses.ldscript: @${ECHO} "INPUT(${SHLIB_NAME} AS NEEDED(-ltinfow))" >$@ @@ -180,4 +185,13 @@ lib_gen.c: MKlib_gen.sh ${.OBJDIR:H}/tinfo/curses.h ncurses_dll.h expanded.c: MKexpanded.sh sh ${NCURSES_DIR}/ncurses/tty/MKexpanded.sh "${CC:N${CCACHE_BIN}} -E" ${CFLAGS} >expanded.c +all: ${STATIC_LDSCRIPT} + +install-aldscript: ${STATIC_LDSCRIPT} + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${_INSTALLFLAGS} ${STATIC_LDSCRIPT} ${DESTDIR}${_LIBDI}/lib${LIB}.a + +realinstall: install-aldscript + + .include diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 4afe719b8152..10262e6bb80c 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -271,9 +271,12 @@ CLEANFILES+= ${OBJS} ${BCOBJS} ${LLOBJS} ${STATICOBJS} .endif .if defined(LIB) && !empty(LIB) -_LIBS= lib${LIB_PRIVATE}${LIB}.a +.if defined(STATIC_LDSCRIPT) +_STATICLIB_SUFFIX= _real +.endif +_LIBS= lib${LIB_PRIVATE}${LIB}${_STATICLIB_SUFFIX}.a -lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STATICOBJS} +lib${LIB_PRIVATE}${LIB}${_STATICLIB_SUFFIX}.a: ${OBJS} ${STATICOBJS} @${ECHO} building static ${LIB} library @rm -f ${.TARGET} ${AR} ${ARFLAGS} ${.TARGET} ${OBJS} ${STATICOBJS} ${ARADD} @@ -477,7 +480,7 @@ realinstall: _libinstall installpcfiles _libinstall: .if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}.a ${DESTDIR}${_LIBDIR}/ + ${_INSTALLFLAGS} lib${LIB_PRIVATE}${LIB}${_STATICLIB_SUFFIX}.a ${DESTDIR}${_LIBDIR}/ .endif .if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},dev} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \