[libcamera-devel] [RFC PATCH] lc-compliance: Disable clang builds
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Thu Sep 9 17:12:56 CEST 2021
Hi Kieran,
On Thu, Sep 09, 2021 at 04:10:27PM +0100, Kieran Bingham wrote:
> On 09/09/2021 16:06, Laurent Pinchart wrote:
> > On Thu, Sep 09, 2021 at 04:02:38PM +0100, Kieran Bingham wrote:
> >> On distributions with clang and gcc, the gtest library is usually
> >> expected to be compiled with gcc. This causes a build failure due
> >> to the abi incompatibility.
> >>
> >> Ideally this would be solved, or detected to be incompatible, but it may
> >> not be simple to identify the ABI used for an installed library with
> >> meson to check if it is compatible.
> >>
> >> Restrict lc-compliance to gcc builds only, knowing that if a fully
> >> clang-built OS or environment later wants to enable this, a new solution
> >> will need to be found.
> >
> > This makes it impossible to compile lc-compliance on CrOS, which isn't
> > nice :-(
>
> Can it run there? I guess it can as gtest will have been compiled by
> clang in that instance.
>
> Any way that we can detect the abi of gtest and only disable if it's
> incorrect?
I haven't investigated ABI issues yet. I wonder if we're doing something
wrong somehow, as I can compile and link qcam with clang with a Qt
version compiled with gcc.
By the way, technically speaking, this is about libstdc++ vs. libc++,
not about gcc vs. clang.
> Feels like a minefield :-( but now my clang builds are broken because I
> have gtest installed ...
I have the same issue, I set the lc-compliance option to disabled
manually on clang builds for now.
> >> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> >> ---
> >> src/lc-compliance/meson.build | 6 ++++++
> >> 1 file changed, 6 insertions(+)
> >>
> >> diff --git a/src/lc-compliance/meson.build b/src/lc-compliance/meson.build
> >> index aa5852f6cb87..416405b4e67b 100644
> >> --- a/src/lc-compliance/meson.build
> >> +++ b/src/lc-compliance/meson.build
> >> @@ -8,6 +8,12 @@ if not (libevent.found() and libgtest.found())
> >> subdir_done()
> >> endif
> >>
> >> +if cc.get_id() == 'clang'
> >> + lc_compliance_enabled = false
> >> + warning('Disabling lc-compliance on clang due to gtest package incompatibility')
> >> + subdir_done()
> >> +endif
> >> +
> >> lc_compliance_enabled = true
> >>
> >> lc_compliance_sources = files([
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list