Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Six, Lancelot" <Lancelot.Six@amd.com>
To: Pedro Alves <pedro@palves.net>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: "Patrange, Sarang" <SarangSudhirrao.Patrange@amd.com>
Subject: RE: [PATCH] gdb/testsuite: Always close '-x hip' with '-x none' (was: Re: [PATCH v2] gdb/testsuite: replace hipcc with amdclang++ as the HIP compiler)
Date: Mon, 7 Sep 2026 13:17:49 +0000	[thread overview]
Message-ID: <CH3PR12MB90793E4AD2D6358B853B4E4683B22@CH3PR12MB9079.namprd12.prod.outlook.com> (raw)
In-Reply-To: <292ec56d-a457-43f3-8525-474932433342@palves.net>

AMD General

>
> So we get instead:
>
>   clang++ \
>     -x hip \
>     .../device_enumerator.cpp \               << affected by -x hip
>     -x none \                                 << new
>     .../set_unbuffered_mode_saved.o \         << under -x none
>     .../windows-manifest.o \                  << under -x none
>     -o .../temp/4415
>
> ... which compiles & links fine.
>
> Change-Id: I49ab369ebba1d638f61a73673b25ffc35305875b

Hi,

This looks reasonable to me, thanks for fixing this.

Approved-by: Lancelot Six <lancelot.six@amd.com> (amdgpu)

Best,
Lancelot.

> ---
>  gdb/testsuite/lib/gdb.exp | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
> index b66e501d08d..1c02b0fa918 100644
> --- a/gdb/testsuite/lib/gdb.exp
> +++ b/gdb/testsuite/lib/gdb.exp
> @@ -7129,17 +7129,24 @@ proc gdb_compile {source dest type options} {
>      # archives, shared libraries), so the compiler does not try to
>      # parse those as HIP source.  This lets a single amdclang++
>      # invocation correctly handle a mix of sources and non-source
> -    # inputs (e.g. when set_unbuffered_mode.o is appended via ldflags
> -    # later in the command line).
> +    # inputs.
>      if {[lsearch -exact $options hip] != -1 && !$getting_compiler_info} {
>         set new_source {}
> +       set x_lang ""
>         foreach src $source {
>             set ext [string tolower [file extension $src]]
>             if {$ext in {".c" ".cc" ".cp" ".cxx" ".cpp" ".c++" ".hip"}} {
> -               lappend new_source "-x" "hip" $src
> +               set x_lang "hip"
>             } else {
> -               lappend new_source "-x" "none" $src
> +               set x_lang "none"
>             }
> +           lappend new_source "-x" $x_lang $src
> +       }
> +       # Make sure that if we last opened "-x hip", we close it off
> +       # with "-x none", in case something adds some input file via
> +       # ldflags (e.g. set_unbuffered_mode.o).
> +       if {$x_lang != "" && $x_lang != "none"} {
> +           lappend new_source "-x" "none"
>         }
>         set source $new_source
>      }
>
> base-commit: 97feaffb829a5fcf404d2d093062758123e8795f
> --
> 2.54.0
>


      reply	other threads:[~2026-09-07 13:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15  9:45 [PATCH] gdb/testsuite: replace hipcc with amdclang++ as the HIP compiler Sarang Patrange
2026-07-17 10:28 ` Lancelot SIX
2026-07-31 10:28 ` Pedro Alves
2026-08-06 11:29 ` [PATCH v2] " Sarang Patrange
2026-08-17 20:41   ` Lancelot SIX
2026-09-04 17:16   ` [PATCH] gdb/testsuite: Always close '-x hip' with '-x none' (was: Re: [PATCH v2] gdb/testsuite: replace hipcc with amdclang++ as the HIP compiler) Pedro Alves
2026-09-07 13:17     ` Six, Lancelot [this message]

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=CH3PR12MB90793E4AD2D6358B853B4E4683B22@CH3PR12MB9079.namprd12.prod.outlook.com \
    --to=lancelot.six@amd.com \
    --cc=SarangSudhirrao.Patrange@amd.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    /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