From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id E03A1158020 for ; Sun, 25 Dec 2022 22:25:00 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9A566E0BB8; Sun, 25 Dec 2022 22:16:46 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5D058E0BB5 for ; Sun, 25 Dec 2022 22:16:46 +0000 (UTC) From: David Seifert To: gentoo-dev@lists.gentoo.org Cc: David Seifert Subject: [gentoo-dev] [PATCH 35/41] usr-ldscript.eclass: drop EAPI 6 support Date: Sun, 25 Dec 2022 23:15:46 +0100 Message-Id: <20221225221552.8023-35-soap@gentoo.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20221225221552.8023-1-soap@gentoo.org> References: <20221225221552.8023-1-soap@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: d59be87e-f312-43e7-a5e9-77dfcca95aa2 X-Archives-Hash: fd3892b2b8680e1594c8fa436f4d367b Signed-off-by: David Seifert --- eclass/usr-ldscript.eclass | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/eclass/usr-ldscript.eclass b/eclass/usr-ldscript.eclass index c821abd6084..b73d538ae5b 100644 --- a/eclass/usr-ldscript.eclass +++ b/eclass/usr-ldscript.eclass @@ -4,11 +4,11 @@ # @ECLASS: usr-ldscript.eclass # @MAINTAINER: # Toolchain Ninjas -# @SUPPORTED_EAPIS: 6 7 8 +# @SUPPORTED_EAPIS: 7 8 # @BLURB: Defines the gen_usr_ldscript function. case ${EAPI} in - 6|7|8) ;; + 7|8) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac @@ -84,27 +84,27 @@ gen_usr_ldscript() { # Ensure /lib/${lib} exists to avoid dangling scripts/symlinks. # This especially is for AIX where $(get_libname) can return ".a", # so /lib/${lib} might be moved to /usr/lib/${lib} (by accident). - [[ -r ${ED%/}/${libdir}/${lib} ]] || continue + [[ -r ${ED}/${libdir}/${lib} ]] || continue #TODO: better die here? fi case ${CTARGET:-${CHOST}} in *-darwin*) if ${auto} ; then - tlib=$(scanmacho -qF'%S#F' "${ED%/}"/usr/${libdir}/${lib}) + tlib=$(scanmacho -qF'%S#F' "${ED}"/usr/${libdir}/${lib}) else - tlib=$(scanmacho -qF'%S#F' "${ED%/}"/${libdir}/${lib}) + tlib=$(scanmacho -qF'%S#F' "${ED}"/${libdir}/${lib}) fi [[ -z ${tlib} ]] && die "unable to read install_name from ${lib}" tlib=${tlib##*/} if ${auto} ; then - mv "${ED%/}"/usr/${libdir}/${lib%${suffix}}.*${suffix#.} "${ED%/}"/${libdir}/ || die + mv "${ED}"/usr/${libdir}/${lib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die # some install_names are funky: they encode a version if [[ ${tlib} != ${lib%${suffix}}.*${suffix#.} ]] ; then - mv "${ED%/}"/usr/${libdir}/${tlib%${suffix}}.*${suffix#.} "${ED%/}"/${libdir}/ || die + mv "${ED}"/usr/${libdir}/${tlib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die fi - rm -f "${ED%/}"/${libdir}/${lib} + rm -f "${ED}"/${libdir}/${lib} fi # Mach-O files have an id, which is like a soname, it tells how @@ -114,34 +114,36 @@ gen_usr_ldscript() { # libdir=/lib because that messes up libtool files. # Make sure we don't lose the specific version, so just modify the # existing install_name - if [[ ! -w "${ED%/}/${libdir}/${tlib}" ]] ; then - chmod u+w "${ED%/}/${libdir}/${tlib}" # needed to write to it + if [[ ! -w "${ED}/${libdir}/${tlib}" ]] ; then + chmod u+w "${ED}/${libdir}/${tlib}" || die # needed to write to it local nowrite=yes fi install_name_tool \ -id "${EPREFIX}"/${libdir}/${tlib} \ - "${ED%/}"/${libdir}/${tlib} || die "install_name_tool failed" - [[ -n ${nowrite} ]] && chmod u-w "${ED%/}/${libdir}/${tlib}" + "${ED}"/${libdir}/${tlib} || die "install_name_tool failed" + if [[ -n ${nowrite} ]] ; then + chmod u-w "${ED}/${libdir}/${tlib}" || die + fi # Now as we don't use GNU binutils and our linker doesn't # understand linker scripts, just create a symlink. - pushd "${ED%/}/usr/${libdir}" > /dev/null + pushd "${ED}/usr/${libdir}" > /dev/null ln -snf "../../${libdir}/${tlib}" "${lib}" popd > /dev/null ;; *) if ${auto} ; then - tlib=$(scanelf -qF'%S#F' "${ED%/}"/usr/${libdir}/${lib}) + tlib=$(scanelf -qF'%S#F' "${ED}"/usr/${libdir}/${lib}) [[ -z ${tlib} ]] && die "unable to read SONAME from ${lib}" - mv "${ED%/}"/usr/${libdir}/${lib}* "${ED%/}"/${libdir}/ || die + mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die # some SONAMEs are funky: they encode a version before the .so if [[ ${tlib} != ${lib}* ]] ; then - mv "${ED%/}"/usr/${libdir}/${tlib}* "${ED%/}"/${libdir}/ || die + mv "${ED}"/usr/${libdir}/${tlib}* "${ED}"/${libdir}/ || die fi - rm -f "${ED%/}"/${libdir}/${lib} + rm -f "${ED}"/${libdir}/${lib} else tlib=${lib} fi - cat > "${ED%/}/usr/${libdir}/${lib}" <<-END_LDSCRIPT + cat > "${ED}/usr/${libdir}/${lib}" <<-END_LDSCRIPT /* GNU ld script Since Gentoo has critical dynamic libraries in /lib, and the static versions in /usr/lib, we need to have a "fake" dynamic lib in /usr/lib, otherwise we -- 2.39.0