From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1062) id 024883857346; Wed, 26 Apr 2023 02:35:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 024883857346 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Alan Modra To: bfd-cvs@sourceware.org Subject: [binutils-gdb] binutils runtest $CC X-Act-Checkin: binutils-gdb X-Git-Author: Alan Modra X-Git-Refname: refs/heads/master X-Git-Oldrev: 5b429b870767e2107bcc7d5d849e04d6901b5912 X-Git-Newrev: 4a8635cbecbd4eefa6dafdc4510014ad1755ddc3 Message-Id: <20230426023543.024883857346@sourceware.org> Date: Wed, 26 Apr 2023 02:35:43 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Apr 2023 02:35:43 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D4a8635cbecbd= 4eefa6dafdc4510014ad1755ddc3 commit 4a8635cbecbd4eefa6dafdc4510014ad1755ddc3 Author: Alan Modra Date: Wed Apr 26 09:59:40 2023 +0930 binutils runtest $CC =20 I noticed in the binutile Makefile that runtest is being invoked with CC, CC_FOR_BUILD and other compiler related flags in the environment. That doesn't work. Those variables ought to be passed on the runtest command line. =20 After fixing that I had some fails due to binutils testprog.c now being compiled with the default "-g -O2" picked up in CFLAGS_FOR_TARGET. Hack around that by passing -O0. =20 Also, with the binutils testsuite now taking notice of CC_FOR_TARGET, I found a couple of debuginfod.exp fails with one of my compilers that happened to be built without --debug-id being enabled by default. =20 * Makefile.am (check-DEJAGNU): Pass $CC and other variable on the runtest command line rather than futilely in the environment. Add -O0 to CFLAGS_FOR_TARGET. * Makefile.in: Regenerate. * testsuite/binutils-all/debuginfod.exp: Compile testprog.c with -Wl,--build-id. Diff: --- binutils/Makefile.am | 10 ++++++---- binutils/Makefile.in | 10 ++++++---- binutils/testsuite/binutils-all/debuginfod.exp | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/binutils/Makefile.am b/binutils/Makefile.am index 26de6b2955a..8e51310cf55 100644 --- a/binutils/Makefile.am +++ b/binutils/Makefile.am @@ -210,10 +210,12 @@ check-DEJAGNU: site.exp EXPECT=3D$(EXPECT); export EXPECT; \ runtest=3D$(RUNTEST); \ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ - CC=3D"$(CC)" CC_FOR_BUILD=3D"$(CC_FOR_BUILD)" \ - CC_FOR_TARGET=3D"$(CC_FOR_TARGET)" CFLAGS_FOR_TARGET=3D"$(CFLAGS)" \ - $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \ - $(RUNTESTFLAGS); \ + $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \ + CC=3D"$(CC)" CFLAGS=3D"$(CFLAGS)" \ + CC_FOR_BUILD=3D"$(CC_FOR_BUILD)" \ + CC_FOR_TARGET=3D"$(CC_FOR_TARGET)" \ + CFLAGS_FOR_TARGET=3D"$(CFLAGS_FOR_TARGET) -O0" \ + $(RUNTESTFLAGS); \ else echo "WARNING: could not find \`runtest'" 1>&2; :;\ fi =20 diff --git a/binutils/Makefile.in b/binutils/Makefile.in index 27315addc0f..a58c8aea259 100644 --- a/binutils/Makefile.in +++ b/binutils/Makefile.in @@ -1832,10 +1832,12 @@ check-DEJAGNU: site.exp EXPECT=3D$(EXPECT); export EXPECT; \ runtest=3D$(RUNTEST); \ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ - CC=3D"$(CC)" CC_FOR_BUILD=3D"$(CC_FOR_BUILD)" \ - CC_FOR_TARGET=3D"$(CC_FOR_TARGET)" CFLAGS_FOR_TARGET=3D"$(CFLAGS)" \ - $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \ - $(RUNTESTFLAGS); \ + $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \ + CC=3D"$(CC)" CFLAGS=3D"$(CFLAGS)" \ + CC_FOR_BUILD=3D"$(CC_FOR_BUILD)" \ + CC_FOR_TARGET=3D"$(CC_FOR_TARGET)" \ + CFLAGS_FOR_TARGET=3D"$(CFLAGS_FOR_TARGET) -O0" \ + $(RUNTESTFLAGS); \ else echo "WARNING: could not find \`runtest'" 1>&2; :;\ fi =20 diff --git a/binutils/testsuite/binutils-all/debuginfod.exp b/binutils/test= suite/binutils-all/debuginfod.exp index 7212d16e85f..f86d8deb2fb 100644 --- a/binutils/testsuite/binutils-all/debuginfod.exp +++ b/binutils/testsuite/binutils-all/debuginfod.exp @@ -44,7 +44,7 @@ if { [which $OBJDUMP] =3D=3D 0} { } =20 # Compile testprog.c, move the debuginfo to a separate file and add .gnu_d= ebuglink. -if { [target_compile $srcdir/$subdir/testprog.c tmpdir/testprog executable= debug] !=3D ""} { +if { [target_compile $srcdir/$subdir/testprog.c tmpdir/testprog executable= "debug additional_flags=3D-Wl,--build-id"] !=3D ""} { unsupported "$test (compilation failed)" return }