public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: gdb-patches@sourceware.org
Subject: [PUSHED] gdb/testsuite: only add -J option when compiling with gfortran
Date: Wed,  2 Jun 2021 10:22:46 +0100	[thread overview]
Message-ID: <20210602092246.3167565-1-andrew.burgess@embecosm.com> (raw)

We currently make use of the -J option to gfortran in order that
compiled modules should be placed in the correct output directory.
Obviously different compilers, e.g. flang, will have different options
to achieve the same result.

This commit makes it so we only add the -J flag when using a gcc
based (i.e. gfortran) compiler.

I had a look through the flang help page and tried a few likely
looking options, but couldn't find anything that seemed to do the same
thing, so, for now, I'm only adding an extra option when compiling
with gfortran.

This does mean that any compiler other than gfortran might run into
problems if running the testsuite in parallel due to modules of the
same name all being written to the same directory, and so possibly
overwriting each other.

gdb/testsuite/ChangeLog:

	* lib/gdb.exp (gdb_compile): Only add the -J option when using a
	gcc based Fortran compiler, for example, flang does not support
	this option.
---
 gdb/testsuite/ChangeLog   | 6 ++++++
 gdb/testsuite/lib/gdb.exp | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 36a5fd4feb7..f6686e19162 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -4098,7 +4098,9 @@ proc gdb_compile {source dest type options} {
 	    || [lsearch -exact $options f90] != -1 } {
 	# Fortran compile.
 	set mod_path [standard_output_file ""]
-	lappend new_options "additional_flags=-J${mod_path}"
+	if [test_compiler_info "gcc-*"] {
+	    lappend new_options "additional_flags=-J${mod_path}"
+	}
     }
 
     set shlib_found 0
-- 
2.25.4


             reply	other threads:[~2021-06-02  9:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02  9:22 Andrew Burgess [this message]
2021-06-02  9:45 ` Willgerodt, Felix
2021-06-02 17:12   ` Tom Tromey

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=20210602092246.3167565-1-andrew.burgess@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.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).