Re: [Buildroot] [PATCH 2/2] package/gdb: use stat() privided by the system

Pedro Alves
2018-09-11T09:51:27Z

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.

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.

Thanks,
Pedro Alves