All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/mraa: fix build with musl >= 1.2.5
@ 2024-03-17 14:47 Fabrice Fontaine
  2024-03-18  5:24 ` Pieterjan Camerlynck
  2024-03-20 20:32 ` Arnout Vandecappelle via buildroot
  0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2024-03-17 14:47 UTC (permalink / raw)
  To: buildroot; +Cc: Pieterjan Camerlynck, Fabrice Fontaine

Fix the following build failure with musl >= 1.2.5 (raised since commit
f7f03445cf320adbbc41270a806b38c911d3454a):

/home/autobuild/autobuild/instance-9/output-1/build/mraa-2.2.0/src/mraa.c: In function 'mraa_count_iio_devices':
/home/autobuild/autobuild/instance-9/output-1/build/mraa-2.2.0/src/mraa.c:341:38: error: implicit declaration of function 'basename'; did you mean 'rename'? [-Werror=implicit-function-declaration]
  341 |     if (fnmatch(IIO_DEVICE_WILDCARD, basename(path), 0) == 0) {
      |                                      ^~~~~~~~
      |                                      rename

Fixes: f7f03445cf320adbbc41270a806b38c911d3454a
 - http://autobuild.buildroot.org/results/1f16df70e49a9f8823a791c0fcc677de07136835

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 .../mraa/0002-mraa-Use-posix-basename.patch   | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 package/mraa/0002-mraa-Use-posix-basename.patch

diff --git a/package/mraa/0002-mraa-Use-posix-basename.patch b/package/mraa/0002-mraa-Use-posix-basename.patch
new file mode 100644
index 0000000000..3c5c99f031
--- /dev/null
+++ b/package/mraa/0002-mraa-Use-posix-basename.patch
@@ -0,0 +1,45 @@
+From 47c3850cddd63cebd9dc48e411963314449118f1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sun, 31 Dec 2023 19:16:35 -0800
+Subject: [PATCH] mraa: Use posix basename
+
+Musl has removed the declaration from string.h [1] which exposes the
+problem especially with clang-17+ compiler where implicit function
+declaration is flagged as error. Use posix basename and make a copy of
+string to operate on to emulate GNU basename behaviour.
+
+[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream: https://github.com/eclipse/mraa/commit/47c3850cddd63cebd9dc48e411963314449118f1
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ src/mraa.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/mraa.c b/src/mraa.c
+index 653ea1fa7..b556d0455 100644
+--- a/src/mraa.c
++++ b/src/mraa.c
+@@ -12,6 +12,7 @@
+ #endif
+ 
+ #include <dlfcn.h>
++#include <libgen.h>
+ #include <pwd.h>
+ #include <sched.h>
+ #include <stddef.h>
+@@ -341,9 +342,11 @@ static int
+ mraa_count_iio_devices(const char* path, const struct stat* sb, int flag, struct FTW* ftwb)
+ {
+     // we are only interested in files with specific names
+-    if (fnmatch(IIO_DEVICE_WILDCARD, basename(path), 0) == 0) {
++    char* tmp = strdup(path);
++    if (fnmatch(IIO_DEVICE_WILDCARD, basename(tmp), 0) == 0) {
+         num_iio_devices++;
+     }
++    free(tmp);
+     return 0;
+ }
+ 
-- 
2.43.0

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

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

* Re: [Buildroot] [PATCH 1/1] package/mraa: fix build with musl >= 1.2.5
  2024-03-17 14:47 [Buildroot] [PATCH 1/1] package/mraa: fix build with musl >= 1.2.5 Fabrice Fontaine
@ 2024-03-18  5:24 ` Pieterjan Camerlynck
  2024-03-20 20:32 ` Arnout Vandecappelle via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Pieterjan Camerlynck @ 2024-03-18  5:24 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: buildroot

On Sun, Mar 17, 2024 at 03:47:01PM +0100, Fabrice Fontaine wrote:
> Fix the following build failure with musl >= 1.2.5 (raised since commit
> f7f03445cf320adbbc41270a806b38c911d3454a):
> 
> /home/autobuild/autobuild/instance-9/output-1/build/mraa-2.2.0/src/mraa.c: In function 'mraa_count_iio_devices':
> /home/autobuild/autobuild/instance-9/output-1/build/mraa-2.2.0/src/mraa.c:341:38: error: implicit declaration of function 'basename'; did you mean 'rename'? [-Werror=implicit-function-declaration]
>   341 |     if (fnmatch(IIO_DEVICE_WILDCARD, basename(path), 0) == 0) {
>       |                                      ^~~~~~~~
>       |                                      rename
> 
> Fixes: f7f03445cf320adbbc41270a806b38c911d3454a
>  - http://autobuild.buildroot.org/results/1f16df70e49a9f8823a791c0fcc677de07136835
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Reviewed-by: Pieterjan Camerlynck <pieterjanca@gmail.com>

> ---
>  .../mraa/0002-mraa-Use-posix-basename.patch   | 45 +++++++++++++++++++
>  1 file changed, 45 insertions(+)
>  create mode 100644 package/mraa/0002-mraa-Use-posix-basename.patch
> 
> diff --git a/package/mraa/0002-mraa-Use-posix-basename.patch b/package/mraa/0002-mraa-Use-posix-basename.patch
> new file mode 100644
> index 0000000000..3c5c99f031
> --- /dev/null
> +++ b/package/mraa/0002-mraa-Use-posix-basename.patch
> @@ -0,0 +1,45 @@
> +From 47c3850cddd63cebd9dc48e411963314449118f1 Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +Date: Sun, 31 Dec 2023 19:16:35 -0800
> +Subject: [PATCH] mraa: Use posix basename
> +
> +Musl has removed the declaration from string.h [1] which exposes the
> +problem especially with clang-17+ compiler where implicit function
> +declaration is flagged as error. Use posix basename and make a copy of
> +string to operate on to emulate GNU basename behaviour.
> +
> +[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +
> +Upstream: https://github.com/eclipse/mraa/commit/47c3850cddd63cebd9dc48e411963314449118f1
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +---
> + src/mraa.c | 5 ++++-
> + 1 file changed, 4 insertions(+), 1 deletion(-)
> +
> +diff --git a/src/mraa.c b/src/mraa.c
> +index 653ea1fa7..b556d0455 100644
> +--- a/src/mraa.c
> ++++ b/src/mraa.c
> +@@ -12,6 +12,7 @@
> + #endif
> + 
> + #include <dlfcn.h>
> ++#include <libgen.h>
> + #include <pwd.h>
> + #include <sched.h>
> + #include <stddef.h>
> +@@ -341,9 +342,11 @@ static int
> + mraa_count_iio_devices(const char* path, const struct stat* sb, int flag, struct FTW* ftwb)
> + {
> +     // we are only interested in files with specific names
> +-    if (fnmatch(IIO_DEVICE_WILDCARD, basename(path), 0) == 0) {
> ++    char* tmp = strdup(path);
> ++    if (fnmatch(IIO_DEVICE_WILDCARD, basename(tmp), 0) == 0) {
> +         num_iio_devices++;
> +     }
> ++    free(tmp);
> +     return 0;
> + }
> + 
> -- 
> 2.43.0
> 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/mraa: fix build with musl >= 1.2.5
  2024-03-17 14:47 [Buildroot] [PATCH 1/1] package/mraa: fix build with musl >= 1.2.5 Fabrice Fontaine
  2024-03-18  5:24 ` Pieterjan Camerlynck
@ 2024-03-20 20:32 ` Arnout Vandecappelle via buildroot
  1 sibling, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle via buildroot @ 2024-03-20 20:32 UTC (permalink / raw)
  To: Fabrice Fontaine, buildroot; +Cc: Pieterjan Camerlynck



On 17/03/2024 15:47, Fabrice Fontaine wrote:
> Fix the following build failure with musl >= 1.2.5 (raised since commit
> f7f03445cf320adbbc41270a806b38c911d3454a):
> 
> /home/autobuild/autobuild/instance-9/output-1/build/mraa-2.2.0/src/mraa.c: In function 'mraa_count_iio_devices':
> /home/autobuild/autobuild/instance-9/output-1/build/mraa-2.2.0/src/mraa.c:341:38: error: implicit declaration of function 'basename'; did you mean 'rename'? [-Werror=implicit-function-declaration]
>    341 |     if (fnmatch(IIO_DEVICE_WILDCARD, basename(path), 0) == 0) {
>        |                                      ^~~~~~~~
>        |                                      rename
> 
> Fixes: f7f03445cf320adbbc41270a806b38c911d3454a
>   - http://autobuild.buildroot.org/results/1f16df70e49a9f8823a791c0fcc677de07136835
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

  Applied to master, thanks.

  Regards,
  Arnout

> ---
>   .../mraa/0002-mraa-Use-posix-basename.patch   | 45 +++++++++++++++++++
>   1 file changed, 45 insertions(+)
>   create mode 100644 package/mraa/0002-mraa-Use-posix-basename.patch
> 
> diff --git a/package/mraa/0002-mraa-Use-posix-basename.patch b/package/mraa/0002-mraa-Use-posix-basename.patch
> new file mode 100644
> index 0000000000..3c5c99f031
> --- /dev/null
> +++ b/package/mraa/0002-mraa-Use-posix-basename.patch
> @@ -0,0 +1,45 @@
> +From 47c3850cddd63cebd9dc48e411963314449118f1 Mon Sep 17 00:00:00 2001
> +From: Khem Raj <raj.khem@gmail.com>
> +Date: Sun, 31 Dec 2023 19:16:35 -0800
> +Subject: [PATCH] mraa: Use posix basename
> +
> +Musl has removed the declaration from string.h [1] which exposes the
> +problem especially with clang-17+ compiler where implicit function
> +declaration is flagged as error. Use posix basename and make a copy of
> +string to operate on to emulate GNU basename behaviour.
> +
> +[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
> +
> +Signed-off-by: Khem Raj <raj.khem@gmail.com>
> +
> +Upstream: https://github.com/eclipse/mraa/commit/47c3850cddd63cebd9dc48e411963314449118f1
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +---
> + src/mraa.c | 5 ++++-
> + 1 file changed, 4 insertions(+), 1 deletion(-)
> +
> +diff --git a/src/mraa.c b/src/mraa.c
> +index 653ea1fa7..b556d0455 100644
> +--- a/src/mraa.c
> ++++ b/src/mraa.c
> +@@ -12,6 +12,7 @@
> + #endif
> +
> + #include <dlfcn.h>
> ++#include <libgen.h>
> + #include <pwd.h>
> + #include <sched.h>
> + #include <stddef.h>
> +@@ -341,9 +342,11 @@ static int
> + mraa_count_iio_devices(const char* path, const struct stat* sb, int flag, struct FTW* ftwb)
> + {
> +     // we are only interested in files with specific names
> +-    if (fnmatch(IIO_DEVICE_WILDCARD, basename(path), 0) == 0) {
> ++    char* tmp = strdup(path);
> ++    if (fnmatch(IIO_DEVICE_WILDCARD, basename(tmp), 0) == 0) {
> +         num_iio_devices++;
> +     }
> ++    free(tmp);
> +     return 0;
> + }
> +
_______________________________________________
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:[~2024-03-20 20:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-17 14:47 [Buildroot] [PATCH 1/1] package/mraa: fix build with musl >= 1.2.5 Fabrice Fontaine
2024-03-18  5:24 ` Pieterjan Camerlynck
2024-03-20 20:32 ` Arnout Vandecappelle via buildroot

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.