public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: Jacob Bachmeyer <jcb62281@gmail.com>
Cc: gdb@sourceware.org,  "dejagnu@gnu.org" <dejagnu@gnu.org>
Subject: Re: GDB testsuite overrides default_target_compile and breaks
Date: Fri, 19 Jun 2020 06:57:07 -0600	[thread overview]
Message-ID: <875zbnz00s.fsf@tromey.com> (raw)
In-Reply-To: <5EE19A64.9010307@gmail.com> (Jacob Bachmeyer's message of "Wed,  10 Jun 2020 21:43:48 -0500")

I trimmed the cc list down to just gdb and dejagnu.

Jacob> What is needed in brief:
Jacob> (1) Merge the features of default_target_compile that the GDB
Jacob> testsuite depends on upstream for 1.6.3.
Jacob> (2) Find the actual extensibility that GDB needs here and add that
Jacob> support to the default_target_compile rewrite slated for 1.6.4.

Sounds reasonable to me.

Jacob> The changes were to an internal component and broke an out-of-tree
Jacob> copy of same.  I have to draw a line somewhere, and "monkeypatching
Jacob> the core is not supported and can break" is necessary for DejaGnu to
Jacob> develop at all.

FWIW this makes sense to me.  I think it's never been a great idea to
have this override in gdb.  Dejagnu wasn't very actively maintained for
a long time, and had low engagement from gdb developers, so it was more
like a convenient way to move forward.

Jacob> Monkeypatching the DejaGnu core is not supported and cannot be
Jacob> supported long-term.

gdb does it other spots as well.  For example, check-test-names.exp
overrides log_summary and reset_vars that gdb can show duplicated test
names, and gdb.exp renames "cd" to avoid problems with relative log file
names.

Jacob> GDB seems to have also extended default_target_compile, so a
Jacob> discussion on this is needed because there seems to be a need for some
Jacob> kind of language extensibility feature to allow new
Jacob> language-default-selector options to be defined without overriding the
Jacob> entire default_target_compile procedure

Yes, that would be good to have.  I think this has been patched when a
new language is added to gdb; changing this function to work in some
extensible way would be a nice improvement... while there are no
concrete plans I know of to add new languages to gdb, one never knows
when someone may show up with patches.

Jacob> If I understand correctly, merging the features currently carried in
Jacob> gdb/testsuite/lib/future.exp upstream will cause all existing GDB 
Jacob> releases to correctly use the upstream version of
Jacob> default_target_compile, making the partial reversion patch
Jacob> unnecessary.

Yes, assuming that gdb's detection code continues to work.  It does
this:

    if {[info procs find_gnatmake] == ""} {
        rename gdb_find_gnatmake find_gnatmake
        set use_gdb_compile 1
    }
    # ... sequence of such checks ...
    if {$use_gdb_compile} {
        catch {rename default_target_compile {}}
        rename gdb_default_target_compile default_target_compile
    }

Anyway, I compared gdb_default_target_compile with
default_target_compile.  I think there are two kinds of changes.

One is the addition of new languages, namely Rust and Go.  This seems
relatively straightforward.

The other is the addition of "early_flags":

	if {[regexp "^early_flags=" $i]} {
	    regsub "^early_flags=" $i "" tmp
	    append early_flags " $tmp"
	}
...
    switch $type {
	"object" {
	    set opts "$early_flags $add_flags $sources"
	}
        ... etc

This seems to be needed to adapt to some distro-specific compiler
issues.  One example is:

		if { [test_compiler_info "gcc-*"] || [test_compiler_info "clang-*"] } {
		    # Undo debian's change in the default.
		    # Put it at the front to not override any user-provided
		    # value, and to make sure it appears in front of all the
		    # shlibs!
		    lappend new_options "early_flags=-Wl,--no-as-needed"
		}

I can write some patches to merge this stuff in.

Tom

  reply	other threads:[~2020-06-19 12:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87zhac871g.fsf@euler.schwinge.homeip.net>
     [not found] ` <yddsgg31yek.fsf@CeBiTec.Uni-Bielefeld.DE>
     [not found]   ` <alpine.LFD.2.21.2005140026530.6492@redsun52.ssa.fujisawa.hgst.com>
     [not found]     ` <yddtv0izk0d.fsf@CeBiTec.Uni-Bielefeld.DE>
     [not found]       ` <274e2a71-ddb0-18cc-70c1-4ca9ccf8bd29@welcomehome.org>
     [not found]         ` <alpine.LFD.2.21.2005150018250.6492@redsun52.ssa.fujisawa.hgst.com>
     [not found]           ` <9a017568-911d-9352-859a-8721b2f47c53@welcomehome.org>
     [not found]             ` <alpine.LFD.2.21.2005170030180.21168@redsun52.ssa.fujisawa.hgst.com>
     [not found]               ` <29b3fe32-b3c9-653e-2ef3-6e89083188f6@welcomehome.org>
     [not found]                 ` <alpine.LFD.2.21.2005170507350.21168@redsun52.ssa.fujisawa.hgst.com>
     [not found]                   ` <a2e631fb-b0b1-f014-2ddd-5689f9957c73@welcomehome.org>
     [not found]                     ` <3e294014-8205-c99c-ecc7-3e9d383e5587@welcomehome.org>
     [not found]                       ` <alpine.LFD.2.21.2005270215160.21168@redsun52.ssa.fujisawa.hgst.com>
     [not found]                         ` <a1663bde-47b1-c86a-fb01-d8527365f55b@welcomehome.org>
     [not found]                           ` <alpine.LFD.2.21.2006031253380.9519@redsun52.ssa.fujisawa.hgst.com>
     [not found]                             ` <5EE04696.8090209@gmail.com>
     [not found]                               ` <5EE05F15.4070408@gmail.com>
2020-06-10 16:37                                 ` dejagnu version update? [CORRECTION: not a regression in DejaGnu; GDB testsuite bug] Maciej W. Rozycki
2020-06-11  2:43                                   ` GDB testsuite overrides default_target_compile and breaks Jacob Bachmeyer
2020-06-19 12:57                                     ` Tom Tromey [this message]
2020-06-19 15:11                                       ` Rob Savoye
2020-06-20  0:00                                       ` Jacob Bachmeyer

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=875zbnz00s.fsf@tromey.com \
    --to=tromey@adacore.com \
    --cc=dejagnu@gnu.org \
    --cc=gdb@sourceware.org \
    --cc=jcb62281@gmail.com \
    /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).