From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-2.6 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,URIBL_SBL, URIBL_SBL_A shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 264211F453 for ; Thu, 24 Jan 2019 08:50:11 +0000 (UTC) Received: from localhost ([127.0.0.1]:49749 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmai9-00053Z-Ju for normalperson@yhbt.net; Thu, 24 Jan 2019 03:50:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47411) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmai5-00053S-J1 for bug-gnulib@gnu.org; Thu, 24 Jan 2019 03:50:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gmai4-0007lu-DB for bug-gnulib@gnu.org; Thu, 24 Jan 2019 03:50:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34290) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gmai4-0007hc-4Y for bug-gnulib@gnu.org; Thu, 24 Jan 2019 03:50:04 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 075BAC0495B8; Thu, 24 Jan 2019 08:50:03 +0000 (UTC) Received: from localhost (ovpn-117-203.ams2.redhat.com [10.36.117.203]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3992B18966; Thu, 24 Jan 2019 08:50:02 +0000 (UTC) Date: Thu, 24 Jan 2019 08:50:00 +0000 From: "Richard W.M. Jones" To: "Dmitry V. Levin" Subject: Re: test-rwlock1 failing on latest Fedora Rawhide Message-ID: <20190124085000.GG12500@redhat.com> References: <20190123193730.GA9768@redhat.com> <1903559.vGX8tUDGlp@omega> <20190123204506.GB12500@redhat.com> <20190123210321.GA22317@altlinux.org> <20190123211430.GC12500@redhat.com> <20190123220952.GA23568@altlinux.org> <20190123222426.GE12500@redhat.com> <20190123223828.GA23722@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190123223828.GA23722@altlinux.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 24 Jan 2019 08:50:03 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bug-gnulib@gnu.org, Bruno Haible Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" On Thu, Jan 24, 2019 at 01:38:28AM +0300, Dmitry V. Levin wrote: > On Wed, Jan 23, 2019 at 10:24:26PM +0000, Richard W.M. Jones wrote: > > On Thu, Jan 24, 2019 at 01:09:52AM +0300, Dmitry V. Levin wrote: > > > On Wed, Jan 23, 2019 at 09:14:30PM +0000, Richard W.M. Jones wrote: > > > > On Thu, Jan 24, 2019 at 12:03:21AM +0300, Dmitry V. Levin wrote: > > > > > Hi, > > > > > > > > > > On Wed, Jan 23, 2019 at 08:45:06PM +0000, Richard W.M. Jones wrote: > > > > > > On Wed, Jan 23, 2019 at 09:01:19PM +0100, Bruno Haible wrote: > > > > > [...] > > > > > > I checked the history of the Fedora package which adds these flags, and > > > > > > it seems like --as-needed was added for: > > > > > > > > > > > > https://fedoraproject.org/wiki/Changes/RemoveExcessiveLinking > > > > > > > > > > > > Removing -Wl,--as-needed fixes the problem. However I'm still unclear > > > > > > about this. Is Fedora wrong? Is hivex using gnulib wrongly? Is > > > > > > gnulib wrong? > > > > > > > > > > We also build everything with --as-needed by default, but > > > > > gnulib does the right thing nowadays by using > > > > > -Wl,--push-state -Wl,--no-as-needed -lpthread -Wl,--pop-state > > > > > instead of plain -lpthread. > > > > > > > > hivex is using a very recent gnulib (34290cb926). > > > > > > > > The test is linked with: > > > > > > > > /bin/sh ../../libtool --tag=CC --preserve-dup-deps --mode=link gcc -O2 > > > > -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 > > > > -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong > > > > -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 > > > > -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic > > > > -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection > > > > -Wl,-z,relro -Wl,--as-needed -Wl,-z,now > > > > -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o test-thread_create > > > > test-thread_create.o libtests.a ../../gnulib/lib/libgnu.la libtests.a > > > > -pthread -Wl,--push-state -Wl,--no-as-needed -lpthread -Wl,--pop-state > > > > > > > > As you can see from the last bit, the --push-state ... --pop-state > > > > seems correct. Yet the test still fails. > > > > > > I see libtool is involved, and libtool is known to reorder arguments > > > in a very unhelpful way. Could you show the actual link command invoked > > > by libtool, please? I expect to see something like > > > -Wl,--push-state -Wl,--no-as-needed -Wl,--pop-state ... -lpthread > > > which doesn't make sense. > > > > I've posted the entire build/check with V=1 here: > > > > http://oirase.annexia.org/tmp/2019-01-gnulib-hivex.txt > > > > If you grep through that for "test-thread_create" you should find the > > appropriate lines. > > According to the log, it was libtool that broke a valid command > > /bin/sh ../../libtool --tag=CC --preserve-dup-deps --mode=link gcc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o test-rwlock1 test-rwlock1.o libtests.a ../../gnulib/lib/libgnu.la libtests.a -pthread -Wl,--push-state -Wl,--no-as-needed -lpthread -Wl,--pop-state -lrt > > into an invalid command > > libtool: link: gcc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wl,-z -Wl,relro -Wl,--as-needed -Wl,-z -Wl,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o test-rwlock1 test-rwlock1.o -pthread -Wl,--push-state -Wl,--no-as-needed -Wl,--pop-state libtests.a ../../gnulib/lib/.libs/libgnu.a libtests.a -lpthread -lrt -pthread > > What's the version of libtool that's produced such a mess? libtool-2.4.6-28.fc30.x86_64 Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v