All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v1 1/2] package/gtest: fix gtest.pc/gmock.pc library names for the debug build
@ 2021-10-22 19:07 Peter Seiderer
  2021-10-22 19:07 ` [Buildroot] [PATCH v1 2/2] package/libcamera: add lc-compliance test application option Peter Seiderer
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Peter Seiderer @ 2021-10-22 19:07 UTC (permalink / raw)
  To: buildroot; +Cc: Stephan Hoffmann, Kieran Bingham, Fabrice Fontaine

Fixes:

   - http://autobuild.buildroot.org/results/e1bb8aa1de310f3d27b74ec7d8748d170ad444e2

  >>> libcamera 40f5fddca7f774944a53f58eeaebc4db79c373d8 Building
  [...]
  [114/123] Linking target src/lc-compliance/lc-compliance
  FAILED: src/lc-compliance/lc-compliance
  [...]
  .../host/lib/gcc/arm-buildroot-linux-uclibcgnueabi/10.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: cannot find -lgtest

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 ...test.pc-gmock.pc-library-names-for-t.patch | 62 +++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100644 package/gtest/0001-pkg-config-fix-gtest.pc-gmock.pc-library-names-for-t.patch

diff --git a/package/gtest/0001-pkg-config-fix-gtest.pc-gmock.pc-library-names-for-t.patch b/package/gtest/0001-pkg-config-fix-gtest.pc-gmock.pc-library-names-for-t.patch
new file mode 100644
index 0000000000..c47e8fc8f8
--- /dev/null
+++ b/package/gtest/0001-pkg-config-fix-gtest.pc-gmock.pc-library-names-for-t.patch
@@ -0,0 +1,62 @@
+From cf5a3177159ca832470e7f876cab0a1923fa666f Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Fri, 22 Oct 2021 20:17:36 +0200
+Subject: [PATCH] pkg-config: fix gtest.pc/gmock.pc library names for the debug
+ build
+
+In case CMAKE_BUILD_TYPE is set to Debug the gtest library is
+name libgtestd.a but the link command returned from gtest.pc is
+'-lgtest' (without the debug d) and so the linking of dependent
+packages fails (see [1] for a buildroot failure example).
+
+Enhance the gtest.pc ang gmock.pc generation to honour the debug 'd'.
+
+[1] http://lists.busybox.net/pipermail/buildroot/2021-October/626382.html
+
+[Upstream: https://github.com/google/googletest/pull/3625]
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ googlemock/cmake/gmock.pc.in          | 2 +-
+ googletest/cmake/gtest.pc.in          | 2 +-
+ googletest/cmake/internal_utils.cmake | 3 +++
+ 3 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/googlemock/cmake/gmock.pc.in b/googlemock/cmake/gmock.pc.in
+index 23c67b5c..0f469857 100644
+--- a/googlemock/cmake/gmock.pc.in
++++ b/googlemock/cmake/gmock.pc.in
+@@ -6,5 +6,5 @@ Description: GoogleMock (without main() function)
+ Version: @PROJECT_VERSION@
+ URL: https://github.com/google/googletest
+ Requires: gtest = @PROJECT_VERSION@
+-Libs: -L${libdir} -lgmock @CMAKE_THREAD_LIBS_INIT@
++Libs: -L${libdir} -lgmock@DEBUG_POSTFIX@ @CMAKE_THREAD_LIBS_INIT@
+ Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@
+diff --git a/googletest/cmake/gtest.pc.in b/googletest/cmake/gtest.pc.in
+index b4148fae..225bba81 100644
+--- a/googletest/cmake/gtest.pc.in
++++ b/googletest/cmake/gtest.pc.in
+@@ -5,5 +5,5 @@ Name: gtest
+ Description: GoogleTest (without main() function)
+ Version: @PROJECT_VERSION@
+ URL: https://github.com/google/googletest
+-Libs: -L${libdir} -lgtest @CMAKE_THREAD_LIBS_INIT@
++Libs: -L${libdir} -lgtest@DEBUG_POSTFIX@ @CMAKE_THREAD_LIBS_INIT@
+ Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@
+diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake
+index 58fc9bfb..fd81b825 100644
+--- a/googletest/cmake/internal_utils.cmake
++++ b/googletest/cmake/internal_utils.cmake
+@@ -335,6 +335,9 @@ function(install_project)
+     # Configure and install pkgconfig files.
+     foreach(t ${ARGN})
+       set(configured_pc "${generated_dir}/${t}.pc")
++      if(CMAKE_BUILD_TYPE MATCHES Debug)
++        set(DEBUG_POSTFIX "d")
++      endif()
+       configure_file("${PROJECT_SOURCE_DIR}/cmake/${t}.pc.in"
+         "${configured_pc}" @ONLY)
+       install(FILES "${configured_pc}"
+-- 
+2.33.1
+
-- 
2.33.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Buildroot] [PATCH v1 2/2] package/libcamera: add lc-compliance test application option
  2021-10-22 19:07 [Buildroot] [PATCH v1 1/2] package/gtest: fix gtest.pc/gmock.pc library names for the debug build Peter Seiderer
@ 2021-10-22 19:07 ` Peter Seiderer
  2021-10-23 20:30   ` Kieran Bingham
  2021-10-24 14:02 ` [Buildroot] [PATCH v1 1/2] package/gtest: fix gtest.pc/gmock.pc library names for the debug build Thomas Petazzoni
  2021-10-26 12:11 ` Peter Korsgaard
  2 siblings, 1 reply; 5+ messages in thread
From: Peter Seiderer @ 2021-10-22 19:07 UTC (permalink / raw)
  To: buildroot; +Cc: Stephan Hoffmann, Kieran Bingham, Fabrice Fontaine

- add lc-compliance test application option (and add proper dependencies
  on gtest and libevent)

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 package/libcamera/Config.in    | 18 ++++++++++++++++++
 package/libcamera/libcamera.mk |  7 +++++++
 2 files changed, 25 insertions(+)

diff --git a/package/libcamera/Config.in b/package/libcamera/Config.in
index b7f0e5b05d..23a0040abf 100644
--- a/package/libcamera/Config.in
+++ b/package/libcamera/Config.in
@@ -72,6 +72,24 @@ config BR2_PACKAGE_LIBCAMERA_PIPELINE_VIMC
 	help
 	  Pipeline for the vimc device.
 
+config BR2_PACKAGE_LIBCAMERA_COMPLIANCE
+	bool "lc-compliance test application"
+	depends on BR2_USE_WCHAR # gtest
+	depends on BR2_TOOLCHAIN_HAS_THREADS # gtest
+	depends on BR2_INSTALL_LIBSTDCPP # gtest
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # gtest
+	depends on BR2_USE_MMU # gtest
+	select BR2_PACKAGE_GTEST
+	select BR2_PACKAGE_LIBEVENT
+	help
+	  lc-compliance test application
+
+comment "lc-compliance test application needs a toolchain w/ C++, wchar, threads, gcc >= 4.9"
+	depends on BR2_USE_MMU
+	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \
+		!BR2_INSTALL_LIBSTDCPP || \
+		!BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
+
 endif # BR2_PACKAGE_LIBCAMERA
 
 comment "libcamera needs a toolchain w/ C++, threads, wchar, dynamic library, gcc >= 7"
diff --git a/package/libcamera/libcamera.mk b/package/libcamera/libcamera.mk
index 8ab95fb42a..5a5f2800b9 100644
--- a/package/libcamera/libcamera.mk
+++ b/package/libcamera/libcamera.mk
@@ -61,6 +61,13 @@ LIBCAMERA_PIPELINES-$(BR2_PACKAGE_LIBCAMERA_PIPELINE_VIMC) += vimc
 
 LIBCAMERA_CONF_OPTS += -Dpipelines=$(subst $(space),$(comma),$(LIBCAMERA_PIPELINES-y))
 
+ifeq ($(BR2_PACKAGE_LIBCAMERA_COMPLIANCE),y)
+LIBCAMERA_DEPENDENCIES += gtest libevent
+LIBCAMERA_CONF_OPTS += -Dlc-compliance=enabled
+else
+LIBCAMERA_CONF_OPTS += -Dlc-compliance=disabled
+endif
+
 # gstreamer-video-1.0, gstreamer-allocators-1.0
 ifeq ($(BR2_PACKAGE_GSTREAMER1)$(BR2_PACKAGE_GST1_PLUGINS_BASE),yy)
 LIBCAMERA_CONF_OPTS += -Dgstreamer=enabled
-- 
2.33.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH v1 2/2] package/libcamera: add lc-compliance test application option
  2021-10-22 19:07 ` [Buildroot] [PATCH v1 2/2] package/libcamera: add lc-compliance test application option Peter Seiderer
@ 2021-10-23 20:30   ` Kieran Bingham
  0 siblings, 0 replies; 5+ messages in thread
From: Kieran Bingham @ 2021-10-23 20:30 UTC (permalink / raw)
  To: Peter Seiderer, buildroot; +Cc: Stephan Hoffmann, Fabrice Fontaine

Quoting Peter Seiderer (2021-10-22 20:07:02)
> - add lc-compliance test application option (and add proper dependencies
>   on gtest and libevent)
> 
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
>  package/libcamera/Config.in    | 18 ++++++++++++++++++
>  package/libcamera/libcamera.mk |  7 +++++++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/package/libcamera/Config.in b/package/libcamera/Config.in
> index b7f0e5b05d..23a0040abf 100644
> --- a/package/libcamera/Config.in
> +++ b/package/libcamera/Config.in
> @@ -72,6 +72,24 @@ config BR2_PACKAGE_LIBCAMERA_PIPELINE_VIMC
>         help
>           Pipeline for the vimc device.
>  
> +config BR2_PACKAGE_LIBCAMERA_COMPLIANCE
> +       bool "lc-compliance test application"
> +       depends on BR2_USE_WCHAR # gtest
> +       depends on BR2_TOOLCHAIN_HAS_THREADS # gtest
> +       depends on BR2_INSTALL_LIBSTDCPP # gtest
> +       depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 # gtest

I think we stipulate a minimum gcc 7 on libcamera support, but this is
for gtest ...

Other than that, this is better than simply disabling.


Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>


> +       depends on BR2_USE_MMU # gtest
> +       select BR2_PACKAGE_GTEST
> +       select BR2_PACKAGE_LIBEVENT
> +       help
> +         lc-compliance test application
> +
> +comment "lc-compliance test application needs a toolchain w/ C++, wchar, threads, gcc >= 4.9"
> +       depends on BR2_USE_MMU
> +       depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS || \
> +               !BR2_INSTALL_LIBSTDCPP || \
> +               !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
> +
>  endif # BR2_PACKAGE_LIBCAMERA
>  
>  comment "libcamera needs a toolchain w/ C++, threads, wchar, dynamic library, gcc >= 7"
> diff --git a/package/libcamera/libcamera.mk b/package/libcamera/libcamera.mk
> index 8ab95fb42a..5a5f2800b9 100644
> --- a/package/libcamera/libcamera.mk
> +++ b/package/libcamera/libcamera.mk
> @@ -61,6 +61,13 @@ LIBCAMERA_PIPELINES-$(BR2_PACKAGE_LIBCAMERA_PIPELINE_VIMC) += vimc
>  
>  LIBCAMERA_CONF_OPTS += -Dpipelines=$(subst $(space),$(comma),$(LIBCAMERA_PIPELINES-y))
>  
> +ifeq ($(BR2_PACKAGE_LIBCAMERA_COMPLIANCE),y)
> +LIBCAMERA_DEPENDENCIES += gtest libevent
> +LIBCAMERA_CONF_OPTS += -Dlc-compliance=enabled
> +else
> +LIBCAMERA_CONF_OPTS += -Dlc-compliance=disabled
> +endif
> +
>  # gstreamer-video-1.0, gstreamer-allocators-1.0
>  ifeq ($(BR2_PACKAGE_GSTREAMER1)$(BR2_PACKAGE_GST1_PLUGINS_BASE),yy)
>  LIBCAMERA_CONF_OPTS += -Dgstreamer=enabled
> -- 
> 2.33.1
>
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH v1 1/2] package/gtest: fix gtest.pc/gmock.pc library names for the debug build
  2021-10-22 19:07 [Buildroot] [PATCH v1 1/2] package/gtest: fix gtest.pc/gmock.pc library names for the debug build Peter Seiderer
  2021-10-22 19:07 ` [Buildroot] [PATCH v1 2/2] package/libcamera: add lc-compliance test application option Peter Seiderer
@ 2021-10-24 14:02 ` Thomas Petazzoni
  2021-10-26 12:11 ` Peter Korsgaard
  2 siblings, 0 replies; 5+ messages in thread
From: Thomas Petazzoni @ 2021-10-24 14:02 UTC (permalink / raw)
  To: Peter Seiderer
  Cc: Fabrice Fontaine, Stephan Hoffmann, Kieran Bingham, buildroot

On Fri, 22 Oct 2021 21:07:01 +0200
Peter Seiderer <ps.report@gmx.net> wrote:

> Fixes:
> 
>    - http://autobuild.buildroot.org/results/e1bb8aa1de310f3d27b74ec7d8748d170ad444e2
> 
>   >>> libcamera 40f5fddca7f774944a53f58eeaebc4db79c373d8 Building  
>   [...]
>   [114/123] Linking target src/lc-compliance/lc-compliance
>   FAILED: src/lc-compliance/lc-compliance
>   [...]
>   .../host/lib/gcc/arm-buildroot-linux-uclibcgnueabi/10.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: cannot find -lgtest
> 
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
>  ...test.pc-gmock.pc-library-names-for-t.patch | 62 +++++++++++++++++++
>  1 file changed, 62 insertions(+)
>  create mode 100644 package/gtest/0001-pkg-config-fix-gtest.pc-gmock.pc-library-names-for-t.patch

Series applied, thanks! To be honest, I always found it very weird this
choice of some upstream project to have a different library name
depending on whether it is built with/without debug. But oh well, if
that's how gtest wants it...

Note that you have to sign the Google CLA if you want them to consider
your patch on gtest.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Buildroot] [PATCH v1 1/2] package/gtest: fix gtest.pc/gmock.pc library names for the debug build
  2021-10-22 19:07 [Buildroot] [PATCH v1 1/2] package/gtest: fix gtest.pc/gmock.pc library names for the debug build Peter Seiderer
  2021-10-22 19:07 ` [Buildroot] [PATCH v1 2/2] package/libcamera: add lc-compliance test application option Peter Seiderer
  2021-10-24 14:02 ` [Buildroot] [PATCH v1 1/2] package/gtest: fix gtest.pc/gmock.pc library names for the debug build Thomas Petazzoni
@ 2021-10-26 12:11 ` Peter Korsgaard
  2 siblings, 0 replies; 5+ messages in thread
From: Peter Korsgaard @ 2021-10-26 12:11 UTC (permalink / raw)
  To: Peter Seiderer
  Cc: Fabrice Fontaine, Stephan Hoffmann, Kieran Bingham, buildroot

>>>>> "Peter" == Peter Seiderer <ps.report@gmx.net> writes:

 > Fixes:
 >    - http://autobuild.buildroot.org/results/e1bb8aa1de310f3d27b74ec7d8748d170ad444e2

 >>>> libcamera 40f5fddca7f774944a53f58eeaebc4db79c373d8 Building
 >   [...]
 >   [114/123] Linking target src/lc-compliance/lc-compliance
 >   FAILED: src/lc-compliance/lc-compliance
 >   [...]
 >   .../host/lib/gcc/arm-buildroot-linux-uclibcgnueabi/10.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: cannot find -lgtest

 > Signed-off-by: Peter Seiderer <ps.report@gmx.net>

Committed to 2021.08.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-10-26 12:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-22 19:07 [Buildroot] [PATCH v1 1/2] package/gtest: fix gtest.pc/gmock.pc library names for the debug build Peter Seiderer
2021-10-22 19:07 ` [Buildroot] [PATCH v1 2/2] package/libcamera: add lc-compliance test application option Peter Seiderer
2021-10-23 20:30   ` Kieran Bingham
2021-10-24 14:02 ` [Buildroot] [PATCH v1 1/2] package/gtest: fix gtest.pc/gmock.pc library names for the debug build Thomas Petazzoni
2021-10-26 12:11 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.