From: Pedro Alves <palves@redhat.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: Rich Felker <dalias@aerifal.cx>,
Romain Naour <romain.naour@smile.fr>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Romain Naour <romain.naour@gmail.com>,
buildroot@buildroot.org, gdb-patches@sourceware.org
Subject: Re: [Buildroot] [PATCH 2/2] package/gdb: use stat() privided by the system
Date: Wed, 12 Sep 2018 15:26:00 -0000 [thread overview]
Message-ID: <e77a9ad7-5025-957c-f819-c34b9acd7341@redhat.com> (raw)
In-Reply-To: <87d0tjopx5.fsf@redhat.com>
On 09/11/2018 07:21 PM, Sergio Durigan Junior wrote:
> On Tuesday, September 11 2018, Pedro Alves wrote:
>
>> On 09/11/2018 01:38 AM, Sergio Durigan Junior wrote:
>>
>>> This is happening because, before the commit mentioned above,
>>> 'common-utils.c' (which gets transformed into 'common-utils-ipa.c'
>>> during the gdbserver build) wasn't calling 'stat'. It doesn't seem like
>>> a regression; it seems like a hidden problem that was uncovered by the
>>> need of 'stat'.
>>>
>>> I don't know why this problem is manifesting only when compiling IPA,
>>> and not when compiling 'common-utils.c' during GDB's/gdbserver's build.
>>
>> Because the IPA doesn't link with gnulib. And the answer to that wouldn't
>> be as simple as "just link it in", because the IPA objects are supposed
>> to be compiled with -fPIC and -fvisibility=hidden. So we'd need a third
>> build of gnulib for the IPA.
>
> That explains it. It seems strange to me that we still include the
> gnulib headers when compiling IPA; I confess I just assumed IPA was
> linking with gnulib because of this.
In order _not_ to include the gnulib headers, that would mean that we'd
be OK with going back to making sure we do any necessary portability
autoconf/#ifdefery ourselves in all of common and gdbserver code that is
used by the IPA, which doesn't sound very appealing to me.
I'd think it better / simpler maintenance-wise going forward, to work in the
direction of linking with gnulib if/when we find a need.
The IPA has so few dependencies by design that in practice just using the
headers should be fine, with gnulib ironing-out any header-only portability
issues. It's quite likely that a port that can use the IPA won't really need
any gnu_foo replacement function. And if it does, then it should be
better to use gnulib's replacements instead of duplicating what gnulib
already does, I'd think.
>
>> It doesn't seem like this code that calls stat (is_regular_file?) is
>> useful for the IPA, so a quicker/simpler fix would be to simply move
>> that function out of common-utils.c into some other file that is not
>> shared with the IPA.
>
> It's not useful for IPA; it could be moved to common/filestuff.c, for
> example.
Right.
> But IMHO, we should probably have an explicit file just for
> IPA, because otherwise we'll forget about this restriction and re-add
> some 'stat' calls to common-utils.c.
I'm afraid I don't understand what you mean here.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2018-09-12 15:26 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180909163750.14196-1-romain.naour@gmail.com>
[not found] ` <20180909163750.14196-2-romain.naour@gmail.com>
[not found] ` <20180910174900.0b9f4133@windsurf>
2018-09-10 21:21 ` Romain Naour
2018-09-10 22:41 ` Rich Felker
2018-09-11 0:38 ` Sergio Durigan Junior
2018-09-11 9:51 ` Pedro Alves
2018-09-11 14:13 ` Rich Felker
2018-09-11 16:04 ` Pedro Alves
2018-09-11 18:22 ` Sergio Durigan Junior
2018-09-12 15:26 ` Pedro Alves [this message]
2018-09-12 17:11 ` Sergio Durigan Junior
2018-09-12 17:40 ` Pedro Alves
2018-09-11 10:13 ` Pedro Alves
2018-09-11 6:47 ` Thomas Petazzoni
2018-09-12 17:31 ` [PATCH] Move 'is_regular_file' from common-utils.c to filestuff.c Sergio Durigan Junior
2018-09-12 17:41 ` Pedro Alves
2018-09-12 17:59 ` Sergio Durigan Junior
2018-09-14 21:27 ` Romain Naour
2018-09-14 21:41 ` Tom Tromey
2018-09-14 21:48 ` Sergio Durigan Junior
2018-09-14 21:55 ` Romain Naour
2018-09-14 22:09 ` Joel Brobecker
2018-09-15 13:16 ` Romain Naour
2018-09-15 13:28 ` Romain Naour
2018-09-15 20:42 ` Sergio Durigan Junior
2018-09-17 17:01 ` Joel Brobecker
2018-09-15 20:35 ` Sergio Durigan Junior
2018-09-15 21:14 ` Romain Naour
2018-09-16 4:59 ` Sergio Durigan Junior
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=e77a9ad7-5025-957c-f819-c34b9acd7341@redhat.com \
--to=palves@redhat.com \
--cc=buildroot@buildroot.org \
--cc=dalias@aerifal.cx \
--cc=gdb-patches@sourceware.org \
--cc=romain.naour@gmail.com \
--cc=romain.naour@smile.fr \
--cc=sergiodj@redhat.com \
--cc=thomas.petazzoni@bootlin.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