public inbox for debugedit@sourceware.org
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: Mark Wielaard <mark@klomp.org>
Cc: Vitaly Chikunov <vt@altlinux.org>, debugedit@sourceware.org
Subject: Re: [PATCH] tests: fix for toolchains producing compressed debug sections
Date: Thu, 25 Mar 2021 02:45:48 +0300	[thread overview]
Message-ID: <20210324234548.GA5335@altlinux.org> (raw)
In-Reply-To: <6d7325b924aa56456f19316f091c76bb34252991.camel@klomp.org>

Hi Mark,

On Tue, Mar 23, 2021 at 04:05:59PM +0100, Mark Wielaard wrote:
> Hi Dmitry,
> 
> On Tue, 2021-03-23 at 17:28 +0300, Dmitry V. Levin wrote:
> > Yes, Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
> 
> Thanks, pushed.
> 
> But note that it broke the buildbot:
> https://builder.wildebeest.org/buildbot/#/builders/53/builds/2
> 
> Actually it was already broken, because that buildbot builder has an
> gcc so old that it doesn't know about -gdwarf-5.
> 
> But it also doesn't seem to know about -gz=none.
> 
> So we'll need configure checks for that and not use -gz=none and skip
> the -gdwarf-5 tests when gcc isn't able to use those options.
> 
> Cheers,

I've prepared the following fix, but it seems to be too late now.
I'll post it here anyway just in case.

From 53dfef243aa1de8331db777fe031129d5098f516 Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@altlinux.org>
Date: Tue, 23 Mar 2021 20:00:00 +0000
Subject: [PATCH] tests: skip debugedit tests that require unsupported gcc
 options

* tests/debugedit.at (RPM_DEBUGEDIT_SETUP): Do not use -gz=none if
gcc does not support it.  Skip the test if gcc does not support
the parameters passed to RPM_DEBUGEDIT_SETUP.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
 tests/debugedit.at | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/tests/debugedit.at b/tests/debugedit.at
index 2d1870b..2e72c89 100644
--- a/tests/debugedit.at
+++ b/tests/debugedit.at
@@ -23,7 +23,7 @@ AT_TESTED([debugedit])
 
 # Helper to create some test binaries.
 # Optional parameter can specify additional gcc parameters.
-m4_define([RPM_DEBUGEDIT_SETUP],[[
+m4_define([RPM_DEBUGEDIT_SETUP],[
 # Create some test binaries. Create and build them in different subdirs
 # to make sure they produce different relative/absolute paths.
 
@@ -36,12 +36,21 @@ mkdir subdir_headers
 cp "${abs_srcdir}"/data/SOURCES/foobar.h subdir_headers
 cp "${abs_srcdir}"/data/SOURCES/baz.c .
 
+for cc_debug_opts in "-g3 -gz=none $1" "-g3 $1"; do
+	if gcc $cc_debug_opts $1 -c -xc /dev/null -o /dev/null; then
+		break
+	else
+		cc_debug_opts=''
+	fi
+done
+AT_SKIP_IF([test -z "$cc_debug_opts"])
+
 # First three object files (foo.o subdir_bar/bar.o and baz.o)
-gcc -g3 -gz=none -Isubdir_headers $1 -c subdir_foo/foo.c
+gcc ${cc_debug_opts} -Isubdir_headers -c subdir_foo/foo.c
 cd subdir_bar
-gcc -g3 -gz=none -I../subdir_headers $1 -c bar.c
+gcc ${cc_debug_opts} -I../subdir_headers -c bar.c
 cd ..
-gcc -g3 -gz=none -I$(pwd)/subdir_headers $1 -c $(pwd)/baz.c
+gcc ${cc_debug_opts} -I$(pwd)/subdir_headers -c $(pwd)/baz.c
 
 # Then a partially linked object file (somewhat like a kernel module).
 # This will still have relocations between the debug sections.
@@ -49,8 +58,8 @@ ld -r -o foobarbaz.part.o foo.o subdir_bar/bar.o baz.o
 
 # Create an executable. Relocations between debug sections will
 # have been resolved.
-gcc -g3 -gz=none -o foobarbaz.exe foo.o subdir_bar/bar.o baz.o
-]])
+gcc ${cc_debug_opts} -o foobarbaz.exe foo.o subdir_bar/bar.o baz.o
+])
 
 # ===
 # Check debugedit --help doesn't crash and burn.
-- 
ldv

  reply	other threads:[~2021-03-24 23:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-22 20:00 Dmitry V. Levin
2021-03-23 14:20 ` Mark Wielaard
2021-03-23 14:28   ` Dmitry V. Levin
2021-03-23 15:05     ` Mark Wielaard
2021-03-24 23:45       ` Dmitry V. Levin [this message]
2021-03-25 23:12         ` Mark Wielaard
2021-03-28  0:46           ` Dmitry V. Levin
2021-03-28 14:01             ` Mark Wielaard

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=20210324234548.GA5335@altlinux.org \
    --to=ldv@altlinux.org \
    --cc=debugedit@sourceware.org \
    --cc=mark@klomp.org \
    --cc=vt@altlinux.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).