From: "Joel Brobecker (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Cc: Luis Machado <luis.machado@linaro.org>,
Tom Tromey <tromey@sourceware.org>,
Simon Marchi <simon.marchi@polymtl.ca>
Subject: [review v3] [gdb/testsuite] Compile ada with -lgnarl_pic and -lgnat_pic if required
Date: Sat, 02 Nov 2019 00:04:00 -0000 [thread overview]
Message-ID: <20191102000356.1CCBE20AF6@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1571043363000.I3e1e40bd46236b45e2d7808c1cd744a075d4a148@gnutoolchain-gerrit.osci.io>
Joel Brobecker has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/32
......................................................................
Patch Set 3:
I think there is one weakness in the approach, which would show up if the program is to be compiled with '-bargs -shared', or when calling "gnatbind" with the '-shared' command-line argument. In that situation, it instructs the linker to use the shared version of libgnat, rather than the archive. In that case, I don't think you should be using -lgnat_pic, as I believe it would force the non-shared version to be used.
Ideally, what we would do to avoid that issue is to check whether the program is being compiled with a `-shared` option inside a `-bargs` section. This may require a bit of smart splitting, unfortunately.
The good news is that the above would effectively take care of another question of mine, which is the fact that the code links the program with libgnarl without checking that the program depends on the tasking runtime or not. For programs that don't use tasking, it's not desirable to include it like that. But the good news is, if we determine that the PIC versions are needed in general, and we don't see `-bargs -shared`, then we know we're linking against runtime archive files, and thus libgnarl ends up being ignored if nothing references it.
--
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I3e1e40bd46236b45e2d7808c1cd744a075d4a148
Gerrit-Change-Number: 32
Gerrit-PatchSet: 3
Gerrit-Owner: Tom de Vries <tdevries@suse.de>
Gerrit-Reviewer: Joel Brobecker <brobecker@adacore.com>
Gerrit-Reviewer: Luis Machado <luis.machado@linaro.org>
Gerrit-Reviewer: Tom Tromey <tromey@sourceware.org>
Gerrit-Reviewer: Tom de Vries <tdevries@suse.de>
Gerrit-CC: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Comment-Date: Sat, 02 Nov 2019 00:03:56 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
prev parent reply other threads:[~2019-11-02 0:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <gerrit.1571043363000.I3e1e40bd46236b45e2d7808c1cd744a075d4a148@gnutoolchain-gerrit.osci.io>
2019-10-21 20:52 ` [review] " Luis Machado (Code Review)
2019-10-30 16:36 ` [review v2] " Simon Marchi (Code Review)
2019-10-30 17:35 ` [review v3] " Tom de Vries (Code Review)
2019-10-30 17:35 ` [review v2] " Tom de Vries (Code Review)
2019-10-31 1:35 ` [review v3] " Luis Machado (Code Review)
2019-11-02 0:04 ` Joel Brobecker (Code Review) [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=20191102000356.1CCBE20AF6@gnutoolchain-gerrit.osci.io \
--to=gerrit@gnutoolchain-gerrit.osci.io \
--cc=gdb-patches@sourceware.org \
--cc=gnutoolchain-gerrit@osci.io \
--cc=luis.machado@linaro.org \
--cc=simon.marchi@polymtl.ca \
--cc=tdevries@suse.de \
--cc=tromey@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