[libcamera-devel] [PATCH 2/4] meson: enable no-psabi for gcc 9+

Kieran Bingham kieran.bingham at ideasonboard.com
Thu Oct 8 11:18:16 CEST 2020


Hi Tomi,

On 07/10/2020 15:17, Tomi Valkeinen wrote:
> On 07/10/2020 16:47, Laurent Pinchart wrote:
>> On Wed, Oct 07, 2020 at 04:45:04PM +0300, Tomi Valkeinen wrote:
>>> On 07/10/2020 16:29, Laurent Pinchart wrote:
>>>> Hi Tomi and Kieran,
>>>>
>>>> On Wed, Oct 07, 2020 at 10:45:40AM +0100, Kieran Bingham wrote:
>>>>> On 07/10/2020 10:22, Tomi Valkeinen wrote:
>>>>>> I get the warnings related to psabi with:
>>>>>>
>>>>>> gcc 9.3.0 "arm-buildroot-linux-gnueabihf-g++.br_real (Buildroot 2020.08-24-gc5c5f1fa46) 9.3.0"
>>>>>>
>>>>>> Remove the check for gcc-9, so that -Wno-psabi is used on all gcc
>>>>>> versions over 7.1.
>>>>>
>>>>> It doesn't seem unreasonable to keep this disabled for now.
>>>>>
>>>>> Should it be < 10 instead though?
>>>>
>>>> I was going to suggest the same, for the exact same reasons :-)
>>>
>>> So what is the reason, I didn't quite get that.
>>>
>>> Do we not get the warnings on gcc 10?
>>>
>>> Why not just enable -Wno-psabi if the compiler supports it?
>>
>> In order to be notified of future ABI changes. Currently we get warned
>> that an ABI we use changed on gcc-7.1, and that's alright. If we
>> suppress the warning unconditionally, once gcc 11 gets released for
>> example, it may warn us of ABI changes introduced in gcc 11. I would
>> expect the gcc 7.1 ABI warning to get disabled at some point. I wonder
>> if there's a way to disable ABI warnings of gcc <= 7 only.
> 
> Hmm... So is the suggestion to keep increasing the gcc version number in meson.build whenever
> someone tries a more recent gcc version and gets the warning spam?

Currently, Yes ;-)


> And if in the future there's a new ABI change, we hit the warnings, and then we again add a gcc
> version range where we add -Wno-psabi to get rid of the warnings?

Yes ... until the point we declare ourselves ABI stable. At that point,
things change.

Extending the -Wno-psabi is papering over the cracks we don't care
about. But when we want to be ABI stable - those cracks are suddenly
important.


> This sounds a bit silly. Perhaps I'm missing something. I'm not sure what is the point with these
> warnings if the solution is always to add -Wno-psabi, which silences all psabi changes.


I haven't checked/seen the recent warnings, but from my understanding
they say something like

 "If you compile the library with GCC 6, and the application with GCC 7
- it will break in magical ways you would not expect"

Which could happen for instance if the library was provided by the
distribution, and an individual compiled an application with a different
tool-chain version...

We currently have a minimum GCC version of 7, so we don't care about
that, and we're happy to ignore the warnings.

If GCC one day decides to add an ABI break at gcc 10 however, that
statement would change to:

 "If you compile the library with GCC 9, and an application with GCC 10
- It will break in magical ways you would not expect"

and that would be more problematic for us.

So we're happy to defer the warnings for now, but we can't ignore any
future additions.


>  Tomi
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list