From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id F2729382CCA4 for ; Tue, 7 Jun 2022 07:41:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F2729382CCA4 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-593-5d0NDLgMNCuyWELhEPbwhw-1; Tue, 07 Jun 2022 03:41:35 -0400 X-MC-Unique: 5d0NDLgMNCuyWELhEPbwhw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A1A99185A7A4; Tue, 7 Jun 2022 07:41:34 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5375F2026D64; Tue, 7 Jun 2022 07:41:34 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 2577fVgt2091447 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 7 Jun 2022 09:41:31 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 2577fUTu2091446; Tue, 7 Jun 2022 09:41:30 +0200 Date: Tue, 7 Jun 2022 09:41:29 +0200 From: Jakub Jelinek To: Jan Beulich Cc: bonzini@gnu.org, neroden@gcc.gnu.org, "gcc-patches@gcc.gnu.org" , aoliva@gcc.gnu.org Subject: Re: [PATCH] configure: arrange to use appropriate objcopy Message-ID: Reply-To: Jakub Jelinek References: <0fddf82b-750a-67b8-028e-ba0a71a35cf6@suse.com> <2e3d0a43-89a6-11ac-21f9-efa6d6d0aaed@suse.com> MIME-Version: 1.0 In-Reply-To: <2e3d0a43-89a6-11ac-21f9-efa6d6d0aaed@suse.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2022 07:41:42 -0000 On Tue, Jun 07, 2022 at 08:12:26AM +0200, Jan Beulich via Gcc-patches wrote: > > This regressed > > Executing on host: /home/jakub/src/gcc/obj44/gcc/xgcc -B/home/jakub/src/gcc/obj44/gcc/ -fdiagnostics-plain-output -flto -g -gsplit-dwarf -c -o c_lto_pr83719_0.o /home/jakub/src/gcc/gcc/testsuite/gcc.dg/lto/pr83719_0.c (timeout = 300) > > spawn -ignore SIGHUP /home/jakub/src/gcc/obj44/gcc/xgcc -B/home/jakub/src/gcc/obj44/gcc/ -fdiagnostics-plain-output -flto -g -gsplit-dwarf -c -o c_lto_pr83719_0.o /home/jakub/src/gcc/gcc/testsuite/gcc.dg/lto/pr83719_0.c > > cc1: note: '-gsplit-dwarf' is not supported with LTO, disabling > > /home/jakub/src/gcc/obj44/gcc/objcopy: line 120: exec: --: invalid option > > exec: usage: exec [-cl] [-a name] [command [argument ...]] [redirection ...] > > compiler exited with status 1 > > FAIL: gcc.dg/lto/pr83719 c_lto_pr83719_0.o assemble, -flto -g -gsplit-dwarf > > for me, both on x86_64-linux and i686-linux. > > Hmm, it surely worked for me for both, with and without in-tree binutils > (you don't say which variant you saw the failure with). System binutils. grep ORIGINAL_ gcc/Makefile ORIGINAL_AS_FOR_TARGET = /usr/bin/as ORIGINAL_LD_FOR_TARGET = /usr/bin/ld ORIGINAL_NM_FOR_TARGET = /usr/bin/nm ORIGINAL_OBJCOPY_FOR_TARGET = ls -l /usr/bin/{as,ld,nm,objcopy} -rwxr-xr-x. 1 root root 439192 Mar 10 12:51 /usr/bin/as lrwxrwxrwx. 1 root root 20 May 20 13:28 /usr/bin/ld -> /etc/alternatives/ld -rwxr-xr-x. 1 root root 47928 Mar 10 12:51 /usr/bin/nm -rwxr-xr-x. 1 root root 184304 Mar 10 12:51 /usr/bin/objcopy (but ditto grep ORIGINAL_ stage1-gcc/Makefile or grep ORIGINAL_ prev-gcc/Makefile). > > For some reason, I have > > grep OBJCOPY *gcc/Makefile > > gcc/Makefile:ORIGINAL_OBJCOPY_FOR_TARGET = > > prev-gcc/Makefile:ORIGINAL_OBJCOPY_FOR_TARGET = > > stage1-gcc/Makefile:ORIGINAL_OBJCOPY_FOR_TARGET = > > What about the corresponding ORIGINAL_NM_FOR_TARGET? And could you provide > one of the config.log instances? config.log has: configure:23317: checking what linker to use configure:23351: result: /usr/bin/ld configure:23379: checking for nm configure:23397: found /usr/bin/nm configure:23409: result: /usr/bin/nm configure:23420: checking what nm to use configure:23428: result: /usr/bin/nm configure:23498: checking what objcopy to use configure:23506: result: configure:23536: checking for objdump configure:23554: found /usr/bin/objdump configure:23566: result: /usr/bin/objdump configure:23577: checking what objdump to use configure:23587: result: /usr/bin/objdump It is a bootstrapped compiler: ../configure --enable-languages=default,obj-c++,lto,go,d --enable-checking=yes,rtl,extra --enable-libstdcxx-backtrace=yes && make -j32 bootstrap > LOG 2>&1 on Fedora 36 x86_64-linux (ada left out because it is currently broken). Comparing the toplevel Makefile, I see some differences: grep NM_FOR_TARGET Makefile NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \ NM="$(COMPILER_NM_FOR_TARGET)"; export NM; \ NM_FOR_TARGET=$(NM) COMPILER_NM_FOR_TARGET=$$r/$(HOST_SUBDIR)/gcc/nm "NM_FOR_TARGET=$(NM_FOR_TARGET)" \ 'NM=$(COMPILER_NM_FOR_TARGET)' \ grep OBJCOPY_FOR_TARGET Makefile OBJCOPY_FOR_TARGET="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY_FOR_TARGET; \ OBJCOPY="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY; \ OBJCOPY_FOR_TARGET=$(OBJCOPY) "OBJCOPY_FOR_TARGET=$(OBJCOPY_FOR_TARGET)" \ 'OBJCOPY=$$(OBJCOPY_FOR_TARGET)' \ E.g. the COMPILER_*_FOR_TARGET line is missing completely for OBJCOPY and the last line is different too. Also: grep ^NM[[:space:]]*= Makefile; echo end NM = nm end grep ^OBJCOPY[[:space:]]*= Makefile; echo end end Note, I see S["OBJDUMP"]="objdump" S["OBJCOPY"]="objcopy" S["WINDMC"]="windmc" S["WINDRES"]="windres" S["STRIP"]="strip" S["RANLIB"]="ranlib" S["NM"]="nm" in toplevel status, it is just that toplevel: grep ^NM Makefile.tpl NM_FOR_BUILD = @NM_FOR_BUILD@ NM = @NM@ NM_FOR_TARGET=@NM_FOR_TARGET@ grep ^OBJCOPY Makefile.tpl OBJCOPY_FOR_TARGET=@OBJCOPY_FOR_TARGET@ doesn't have the OBJCOPY = @OBJCOPY@ line, and perhaps the COMPILER_OBJCOPY_FOR_TARGET stuff. Jakub