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

Tomi Valkeinen tomi.valkeinen at iki.fi
Thu Oct 8 12:27:30 CEST 2020


Hi,

On 08/10/2020 12:18, Kieran Bingham wrote:

>> 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"

note: parameter passing for argument of type ‘std::_Rb_tree_const_iterator<std::pair<const
libcamera::PixelFormat, libcamera::PixelFormatInfo> >’ changed in GCC 7.1

> 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.

But... What does libcamera's minimum gcc version affect? A library libcamera uses against could be
compiled with earlier gcc, no?

Or if we consider the ABI from libcamera, libcamera could be compiled on gcc 7, and the application
on gcc 6.

> 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.

But how do we separate the two different ABI breakages? There's just -Wno-psabi. If I understand
what you say correctly, we'd like to see the new warning, but not the old one.

And... So what's the fix? Rewrite all the code affected by the ABI change in some other way, so that
you don't hit the ABI change? Is that even realistic? Isn't the only real fix just requiring the
people to compile libraries and apps with gcc versions that are ABI compatible?

I don't think I get this whole thing =). But I'm fine with increasing the version check to < 10, as
I'm currently using gcc 9. I'll probably switch my buildroot to gcc 10 at some point in the near
future, and then I can send a new patch.

 Tomi


More information about the libcamera-devel mailing list