[libcamera-devel] [PATCH 08/11] Removes code to force using libc++ instead of libstdc++ if available.

Nicholas Roth nicholas at rothemail.net
Thu Oct 27 07:39:49 CEST 2022


Looks like this pops up every so often, and the solution is to remove
"-stdlib=libc++":

https://github.com/conan-io/conan/issues/7339
https://marc.info/?l=llvm-bugs&m=140601983212810&w=4
https://bugs.llvm.org/show_bug.cgi?id=20395

However, I've addressed this error here by explicitly specifying
"-werror=false" in the Android build and will be dropping this commit, in
line with the preferences I've seen expressed here.

On Mon, Oct 24, 2022 at 6:46 PM Laurent Pinchart <
laurent.pinchart at ideasonboard.com> wrote:

> Hi Nicholas,
>
> Thank you for the patch.
>
> On Mon, Oct 24, 2022 at 12:55:40AM -0500, Nicholas Roth via
> libcamera-devel wrote:
> > From: Nicholas Roth <nicholas at rothemail.net>
> >
> > This breaks during cross-compilation when this is not true for the
> > meson-cross cross-compiler target.
> >
> > Error:
> > clang++: error: argument unused during compilation: '-stdlib=libc++'
> [-Werror,-Wunused-command-line-argument]
>
> I'm surprised, does the Android version of clang not support that
> argument ?
>
> > ---
> >  meson.build | 8 --------
> >  1 file changed, 8 deletions(-)
> >
> > diff --git a/meson.build b/meson.build
> > index 56910698..7d0588d2 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -95,14 +95,6 @@ if cc.get_id() == 'clang'
> >          ]
> >      endif
> >
> > -    # Use libc++ by default if available instead of libstdc++ when
> compiling
> > -    # with clang.
> > -    if cc.find_library('libc++', required: false).found()
> > -        cpp_arguments += [
> > -            '-stdlib=libc++',
> > -        ]
> > -    endif
> > -
>
> This changes the behaviour for everybody else, which is not nice. I'd
> like to find a better way.
>
> >      cpp_arguments += [
> >          '-Wextra-semi',
> >          '-Wthread-safety',
>
> --
> Regards,
>
> Laurent Pinchart
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20221027/e2fb31a7/attachment.htm>


More information about the libcamera-devel mailing list