From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12595 invoked by alias); 3 Jan 2012 19:43:57 -0000 Received: (qmail 12584 invoked by uid 22791); 3 Jan 2012 19:43:56 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-iy0-f169.google.com (HELO mail-iy0-f169.google.com) (209.85.210.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Jan 2012 19:43:43 +0000 Received: by iacb35 with SMTP id b35so34469933iac.0 for ; Tue, 03 Jan 2012 11:43:43 -0800 (PST) Received: by 10.50.135.1 with SMTP id po1mr15805933igb.26.1325619823188; Tue, 03 Jan 2012 11:43:43 -0800 (PST) Received: by 10.50.135.1 with SMTP id po1mr15805915igb.26.1325619822965; Tue, 03 Jan 2012 11:43:42 -0800 (PST) Received: from coign.google.com ([72.14.225.65]) by mx.google.com with ESMTPS id x18sm180284176ibi.2.2012.01.03.11.43.41 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Jan 2012 11:43:41 -0800 (PST) From: Ian Lance Taylor To: John Marino Cc: binutils@sourceware.org Subject: Re: gold linker 2.22 regressed for DragonFly References: <4ED7FCA6.8090706@marino.st> <4ED88FA5.8050408@marino.st> <4EFF3AF3.3080404@marino.st> <4F017A8B.1000905@marino.st> <4F0204FA.2090305@marino.st> Date: Tue, 03 Jan 2012 19:43:00 -0000 In-Reply-To: <4F0204FA.2090305@marino.st> (John Marino's message of "Mon, 02 Jan 2012 20:26:50 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00039.txt.bz2 John Marino writes: > Editing ld1_LDFLAGS to add --no-ctors-in-init-array is effectively this. > Also the title of this post is "gold linker 2.22 REGRESSED for > DragonFly". gold linker 2.21 doesn't need this switch to build itself. The --no-ctors-in-init-array option is new for 2.22. It turns off new functionality which was added in gold 2.22. This new functionality only works on a system which supports the DT_INIT_ARRAY dynamic tag. My guess is that DragonFly does not support that. So, we need to have some way for the configure script to detect whether DT_INIT_ARRAY works. We should be able to use gcc_AC_INITFINI_ARRAY as a model, from gcc/acinclude.m4. > I just drilled into the testsuite directory and typed ">gmake > check-TESTS" and went through 137 tests. DragonFly failed 42 of them > (attached). That doesn't work, you have to run "make check". That is an automake thing. > I'm also getting several similar error messages like, " > Makefile:2639: warning: overriding recipe for target 'ifuncmain1picstatic' > Makefile:2636: warning: ignoring old recipe for target 'ifuncmain1picstatic'" Interesting, this looks like it might be a bug in automake. The code in gold/testsuite/Makefile.am is: if NATIVE_LINKER if GCC ... if IFUNC ... if HAVE_STATIC if IFUNC_STATIC ... check_PROGRAMS += ifuncmain1picstatic ifuncmain1picstatic: ifuncmain1pic.o ifuncmod1.o gcctestdir/ld $(LINK) -Bgcctestdir/ -static ifuncmain1pic.o ifuncmod1.o endif endif The corresponding lines in gold/testsuite/Makefile.in, which is generated by automake, are: @GCC_FALSE@ifuncmain1picstatic$(EXEEXT): $(ifuncmain1picstatic_OBJECTS) $(ifuncmain1picstatic_DEPENDENCIES) ... @HAVE_STATIC_FALSE@ifuncmain1picstatic$(EXEEXT): $(ifuncmain1picstatic_OBJECTS) $(ifuncmain1picstatic_DEPENDENCIES) ... @IFUNC_FALSE@ifuncmain1picstatic$(EXEEXT): $(ifuncmain1picstatic_OBJECTS) $(ifuncmain1picstatic_DEPENDENCIES) ... @IFUNC_STATIC_FALSE@ifuncmain1picstatic$(EXEEXT): $(ifuncmain1picstatic_OBJECTS) $(ifuncmain1picstatic_DEPENDENCIES) ... @NATIVE_LINKER_FALSE@ifuncmain1picstatic$(EXEEXT): $(ifuncmain1picstatic_OBJECTS) $(ifuncmain1picstatic_DEPENDENCIES) It seems to me that automake should only be emitting the rules for ifuncmain1picstatic$(EXEEXT) if all of the conditions are true. I don't know why it is emitting rules if any of the conditions are false. When any of the conditions are false, there is no reason to build ifuncmain1picstatic at all. Ian