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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DD6F61396D0 for ; Fri, 29 Sep 2017 09:29:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4DC7C2BC02C; Fri, 29 Sep 2017 09:29:07 +0000 (UTC) Received: from atfriesa01.ssi-schaefer.com (atfriesa01.ssi-schaefer.com [193.186.16.100]) by pigeon.gentoo.org (Postfix) with ESMTP id A03EE2BC00C for ; Fri, 29 Sep 2017 09:29:06 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.42,452,1500933600"; d="scan'208";a="4457900" X-IPAS-Result: =?us-ascii?q?A2HsAQAnEc5Z/+shHKxeGgEBAQECAQEBAQgBAQEBhECBFYN?= =?us-ascii?q?4mkQGgQkieZcBQwojhRgChGwUAQIBAQEBAQEBA4EQgmEERikvAQEBAQEBAQEBA?= =?us-ascii?q?QEBAQEBGgINXgEFI1YQCxgCAiYCAlcTBgIBAReKCR2nOIIni0QBAQEBAQEBAwE?= =?us-ascii?q?BAQEfBYEOgh+DC4IyKwuCPTWETRcBAYMxgkEfBZE+j26HXo0GkweVToE5NoEwg?= =?us-ascii?q?QUIhhiBUHSFdw+CNAEBAQ?= Received: from samail03.wamas.com (HELO mailhost.salomon.at) ([172.28.33.235]) by atfriesa01.ssi-schaefer.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Sep 2017 11:29:04 +0200 Received: from s01en24.wamas.com ([172.28.41.101]) by mailhost.salomon.at with esmtp (Exim 4.77) (envelope-from ) id 1dxrbT-0002AZ-8K; Fri, 29 Sep 2017 11:29:03 +0200 Subject: [gentoo-dev] Re: sys-libs/ncurses: erronious deletion of *.dll.a files; possibly other packages affected To: gentoo-dev@lists.gentoo.org References: <20170921020139.kp4664tanr7cj77d@proprietary-killer.fossland> <20170929013637.gz7ntmg4fb62mzel@proprietary-killer.fossland> <9ffbcbe2-fc70-aff9-4a9f-1bcaead3f035@gentoo.org> <20170929083346.hmhvulf5oul4daet@proprietary-killer.fossland> From: Michael Haubenwallner Cc: "Marty E. Plummer" Message-ID: Date: Fri, 29 Sep 2017 11:29:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 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 MIME-Version: 1.0 In-Reply-To: <20170929083346.hmhvulf5oul4daet@proprietary-killer.fossland> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Archives-Salt: 2485b58e-5304-44a4-a41d-5cb5cacd8ccb X-Archives-Hash: 80edae31c8824ffa71de931e06afd0d6 On 09/29/2017 10:33 AM, Marty E. Plummer wrote: > On Fri, Sep 29, 2017 at 08:29:07AM +0000, Michael Haubenwallner wrote: >> On 09/29/2017 03:36 AM, Marty E. Plummer wrote: >>> On Thu, Sep 28, 2017 at 07:35:20PM +0000, Mike Gilbert wrote: >>>> On Wed, Sep 20, 2017 at 10:01 PM, Marty E. Plummer >>>> wrote: >>>>> arfrever suggests I send a mail here, as there are other packages which >>>>> may be affected by this issue and perhaps a more generalized fix is >>>>> required instead of an explicit fix in sys-libs/ncurses and other ebuilds >>>>> that may require it. >>>> >>>> I think the solution here is to remove those overly broad "find >>>> -delete" statements and replace them with something safer. >>>> >>>> Ideally the build system(s) would be patched to not compile static >>>> libs in the first place. >>>> >>>> If that's not possible, perhaps an eclass function could be created to >>>> safely remove static libs. >>>> >>> Honestly I already have a pr up that fixes this particular package's >>> issue, fairly simple fix https://github.com/gentoo/gentoo/pull/5734 >>> >>> --- a/sys-libs/ncurses/ncurses-6.0-r1.ebuild >>> +++ b/sys-libs/ncurses/ncurses-6.0-r1.ebuild >>> @@ -241,7 +241,8 @@ multilib_src_install() { >>> # Provide a link for -lcurses. >>> ln -sf libncurses$(get_libname) "${ED}"/usr/$(get_libdir)/libcurses$(get_libname) || die >>> fi >>> - use static-libs || find "${ED}"/usr/ -name '*.a' -delete >>> + # don't delete '*.dll.a', needed for linking #631468 >>> + use static-libs || find "${ED}"/usr/ -name '*.a' ! -name '*.dll.a' -delete >> >> In prefix overlay we have this version: >> >> use static-libs || find "${ED}"/usr/ -name '*.a' -not -name "*$(get_libname)" -delete >> > Won't work here, as $(get_libname) returns .dll in this case, which is > why the symlinking is busted Indeed! Although I do believe get_libname should return the (dynamically) linkable file name rather than the dynamically loadable one, because a build system's target often is the dynamically linkable file, creating the loadable as side effect. Note that only COFF based systems (AIX, Windows) may distinguish (dynamically) linkable and loadable files. Additionally (although unused in Prefix), AIX allows for one single file libN.a containing Shared Objects, which can be statically linked too! And for winnt I've yet to decide the value for $(get_libname) as the Import Library: Candidates are ".so", ".dll.a", ".dll.lib" - as I do support all of them in the msvc wrapper ("parity") to reduce the need of patching various build systems for now... So probably the real safe one here is (in case get_libname may return ".a"): use static-libs || find "${ED}"/usr/ -name '*.a' -not -name '*.dll.a' -not -name "*$(get_libname)" -delete OR: Really have some function prune_static_libs to remove library files serving as Static Library only - neither as Import Library nor Shared Library: Implemented for some platforms to ignore the file name but inspect the content instead. Remember: This is (related but) different from prune_libtool_libs, which suggests the find "${D}" -name '*.la' -delete alternative only. /haubi/