public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: bonzini@gnu.org, neroden@gcc.gnu.org,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	aoliva@gcc.gnu.org
Subject: Re: [PATCH] configure: arrange to use appropriate objcopy
Date: Tue, 7 Jun 2022 09:41:29 +0200	[thread overview]
Message-ID: <Yp8BKQF0fLiN6+C9@tucnak> (raw)
In-Reply-To: <2e3d0a43-89a6-11ac-21f9-efa6d6d0aaed@suse.com>

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


  reply	other threads:[~2022-06-07  7:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02 15:32 Jan Beulich
2022-06-03  6:44 ` Alexandre Oliva
2022-06-04  8:32 ` Jakub Jelinek
2022-06-07  6:12   ` Jan Beulich
2022-06-07  7:41     ` Jakub Jelinek [this message]
2022-06-07  8:13       ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yp8BKQF0fLiN6+C9@tucnak \
    --to=jakub@redhat.com \
    --cc=aoliva@gcc.gnu.org \
    --cc=bonzini@gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jbeulich@suse.com \
    --cc=neroden@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).