All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v1] package/qt5location: fix musl compile (pthread_getname_np)
@ 2021-09-15 21:13 Peter Seiderer
  2021-09-18  7:59 ` Yann E. MORIN
  2021-09-28 15:23 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Seiderer @ 2021-09-15 21:13 UTC (permalink / raw)
  To: buildroot; +Cc: Julien Corjon

- pthread_getname_np not available with musl libc, add patch to disable
  usage for musl (patch inspired/ported from [1])

Fixes:

  - http://autobuild.buildroot.net/results/ed372a4a8e50d9e20be589eeda40c92888d709bc

  platform/default/thread.cpp: In function ‘std::string mbgl::platform::getCurrentThreadName()’:
  platform/default/thread.cpp:14:5: error: ‘pthread_getname_np’ was not declared in this scope; did you mean ‘pthread_setname_np’?
     14 |     pthread_getname_np(pthread_self(), name, sizeof(name));
        |     ^~~~~~~~~~~~~~~~~~
        |     pthread_setname_np

    [1] https://github.com/void-linux/void-packages/blob/e64dd67f43c409d2b2db08214084e842d92ad620/srcpkgs/qt5/patches/0014-musl-set_thread_name_np.patch

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
---
 ...gl-native-fix-musl-compile-pthread_g.patch | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 package/qt5/qt5location/0001-3rdparty-mapbox-gl-native-fix-musl-compile-pthread_g.patch

diff --git a/package/qt5/qt5location/0001-3rdparty-mapbox-gl-native-fix-musl-compile-pthread_g.patch b/package/qt5/qt5location/0001-3rdparty-mapbox-gl-native-fix-musl-compile-pthread_g.patch
new file mode 100644
index 0000000000..f83aa1b3a6
--- /dev/null
+++ b/package/qt5/qt5location/0001-3rdparty-mapbox-gl-native-fix-musl-compile-pthread_g.patch
@@ -0,0 +1,45 @@
+From acf752757ee4bf2913289ee1142f4968fdb22a4a Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <ps.report@gmx.net>
+Date: Wed, 15 Sep 2021 23:05:52 +0200
+Subject: [PATCH] 3rdparty: mapbox-gl-native: fix musl compile
+ (pthread_getname_np)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+- pthread_getname_np not available with musl libc (patch inspired/ported
+  from [1])
+
+Fixes:
+
+  platform/default/thread.cpp: In function ‘std::string mbgl::platform::getCurrentThreadName()’:
+  platform/default/thread.cpp:14:5: error: ‘pthread_getname_np’ was not declared in this scope; did you mean ‘pthread_setname_np’?
+     14 |     pthread_getname_np(pthread_self(), name, sizeof(name));
+        |     ^~~~~~~~~~~~~~~~~~
+        |     pthread_setname_np
+
+[1] https://github.com/void-linux/void-packages/blob/e64dd67f43c409d2b2db08214084e842d92ad620/srcpkgs/qt5/patches/0014-musl-set_thread_name_np.patch
+
+Signed-off-by: Peter Seiderer <ps.report@gmx.net>
+---
+ src/3rdparty/mapbox-gl-native/platform/default/thread.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/3rdparty/mapbox-gl-native/platform/default/thread.cpp b/src/3rdparty/mapbox-gl-native/platform/default/thread.cpp
+index c7c79b4..3f135eb 100644
+--- a/src/3rdparty/mapbox-gl-native/platform/default/thread.cpp
++++ b/src/3rdparty/mapbox-gl-native/platform/default/thread.cpp
+@@ -11,8 +11,9 @@ namespace platform {
+ 
+ std::string getCurrentThreadName() {
+     char name[32] = "unknown";
++#if defined(__GLIBC__)
+     pthread_getname_np(pthread_self(), name, sizeof(name));
+-
++#endif
+     return name;
+ }
+ 
+-- 
+2.33.0
+
-- 
2.33.0

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

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

* Re: [Buildroot] [PATCH v1] package/qt5location: fix musl compile (pthread_getname_np)
  2021-09-15 21:13 [Buildroot] [PATCH v1] package/qt5location: fix musl compile (pthread_getname_np) Peter Seiderer
@ 2021-09-18  7:59 ` Yann E. MORIN
  2021-09-28 15:23 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2021-09-18  7:59 UTC (permalink / raw)
  To: Peter Seiderer; +Cc: Julien Corjon, buildroot

Peter, All,

On 2021-09-15 23:13 +0200, Peter Seiderer spake thusly:
> - pthread_getname_np not available with musl libc, add patch to disable
>   usage for musl (patch inspired/ported from [1])
> 
> Fixes:
> 
>   - http://autobuild.buildroot.net/results/ed372a4a8e50d9e20be589eeda40c92888d709bc
> 
>   platform/default/thread.cpp: In function ‘std::string mbgl::platform::getCurrentThreadName()’:
>   platform/default/thread.cpp:14:5: error: ‘pthread_getname_np’ was not declared in this scope; did you mean ‘pthread_setname_np’?
>      14 |     pthread_getname_np(pthread_self(), name, sizeof(name));
>         |     ^~~~~~~~~~~~~~~~~~
>         |     pthread_setname_np
> 
>     [1] https://github.com/void-linux/void-packages/blob/e64dd67f43c409d2b2db08214084e842d92ad620/srcpkgs/qt5/patches/0014-musl-set_thread_name_np.patch
> 
> Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> ---
>  ...gl-native-fix-musl-compile-pthread_g.patch | 45 +++++++++++++++++++
>  1 file changed, 45 insertions(+)
>  create mode 100644 package/qt5/qt5location/0001-3rdparty-mapbox-gl-native-fix-musl-compile-pthread_g.patch
> 
> diff --git a/package/qt5/qt5location/0001-3rdparty-mapbox-gl-native-fix-musl-compile-pthread_g.patch b/package/qt5/qt5location/0001-3rdparty-mapbox-gl-native-fix-musl-compile-pthread_g.patch
> new file mode 100644
> index 0000000000..f83aa1b3a6
> --- /dev/null
> +++ b/package/qt5/qt5location/0001-3rdparty-mapbox-gl-native-fix-musl-compile-pthread_g.patch
> @@ -0,0 +1,45 @@
> +From acf752757ee4bf2913289ee1142f4968fdb22a4a Mon Sep 17 00:00:00 2001
> +From: Peter Seiderer <ps.report@gmx.net>
> +Date: Wed, 15 Sep 2021 23:05:52 +0200
> +Subject: [PATCH] 3rdparty: mapbox-gl-native: fix musl compile
> + (pthread_getname_np)
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +- pthread_getname_np not available with musl libc (patch inspired/ported
> +  from [1])
> +
> +Fixes:
> +
> +  platform/default/thread.cpp: In function ‘std::string mbgl::platform::getCurrentThreadName()’:
> +  platform/default/thread.cpp:14:5: error: ‘pthread_getname_np’ was not declared in this scope; did you mean ‘pthread_setname_np’?
> +     14 |     pthread_getname_np(pthread_self(), name, sizeof(name));
> +        |     ^~~~~~~~~~~~~~~~~~
> +        |     pthread_setname_np
> +
> +[1] https://github.com/void-linux/void-packages/blob/e64dd67f43c409d2b2db08214084e842d92ad620/srcpkgs/qt5/patches/0014-musl-set_thread_name_np.patch
> +
> +Signed-off-by: Peter Seiderer <ps.report@gmx.net>
> +---
> + src/3rdparty/mapbox-gl-native/platform/default/thread.cpp | 3 ++-
> + 1 file changed, 2 insertions(+), 1 deletion(-)
> +
> +diff --git a/src/3rdparty/mapbox-gl-native/platform/default/thread.cpp b/src/3rdparty/mapbox-gl-native/platform/default/thread.cpp
> +index c7c79b4..3f135eb 100644
> +--- a/src/3rdparty/mapbox-gl-native/platform/default/thread.cpp
> ++++ b/src/3rdparty/mapbox-gl-native/platform/default/thread.cpp
> +@@ -11,8 +11,9 @@ namespace platform {
> + 
> + std::string getCurrentThreadName() {
> +     char name[32] = "unknown";
> ++#if defined(__GLIBC__)

What about uClibc? Hmmm, as usual, it impersonates glibc and defines
__GLIBC__, so this works by chance...

I've changed to:

    #if defined(__GLIBC__) || defined(__UCLIBC__)

and applied to master, thanks.

Regards,
Yann E. MORIN.

> +     pthread_getname_np(pthread_self(), name, sizeof(name));
> +-
> ++#endif
> +     return name;
> + }
> + 
> +-- 
> +2.33.0
> +
> -- 
> 2.33.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@lists.buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@lists.buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v1] package/qt5location: fix musl compile (pthread_getname_np)
  2021-09-15 21:13 [Buildroot] [PATCH v1] package/qt5location: fix musl compile (pthread_getname_np) Peter Seiderer
  2021-09-18  7:59 ` Yann E. MORIN
@ 2021-09-28 15:23 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2021-09-28 15:23 UTC (permalink / raw)
  To: Peter Seiderer; +Cc: Julien Corjon, buildroot

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

 > - pthread_getname_np not available with musl libc, add patch to disable
 >   usage for musl (patch inspired/ported from [1])

 > Fixes:

 >   - http://autobuild.buildroot.net/results/ed372a4a8e50d9e20be589eeda40c92888d709bc

 >   platform/default/thread.cpp: In function ‘std::string mbgl::platform::getCurrentThreadName()’:
 >   platform/default/thread.cpp:14:5: error: ‘pthread_getname_np’ was not declared in this scope; did you mean ‘pthread_setname_np’?
 >      14 |     pthread_getname_np(pthread_self(), name, sizeof(name));
 >         |     ^~~~~~~~~~~~~~~~~~
 >         |     pthread_setname_np

 >     [1] https://github.com/void-linux/void-packages/blob/e64dd67f43c409d2b2db08214084e842d92ad620/srcpkgs/qt5/patches/0014-musl-set_thread_name_np.patch

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

Committed to 2021.02.x, 2021.05.x and 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] 3+ messages in thread

end of thread, other threads:[~2021-09-28 15:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15 21:13 [Buildroot] [PATCH v1] package/qt5location: fix musl compile (pthread_getname_np) Peter Seiderer
2021-09-18  7:59 ` Yann E. MORIN
2021-09-28 15:23 ` 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.