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

Message ID 20221024055543.116040-9-nicholas@rothemail.net
State Superseded
Headers show
Series
  • [libcamera-devel,01/11] Fixes Bug 156, which breaks libcamera on Android < 12.
Related show

Commit Message

Nicolas Dufresne via libcamera-devel Oct. 24, 2022, 5:55 a.m. UTC
From: Nicholas Roth <nicholas@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]
---
 meson.build | 8 --------
 1 file changed, 8 deletions(-)

Comments

Laurent Pinchart Oct. 24, 2022, 11:45 p.m. UTC | #1
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@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',
Nicholas Roth Oct. 27, 2022, 5:39 a.m. UTC | #2
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@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@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
>

Patch
diff mbox series

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
-
     cpp_arguments += [
         '-Wextra-semi',
         '-Wthread-safety',