Skip to contentSkip to conversation

package/attr: add missing libgen.h header

PATCH In review yegorslists--- via buildroot 2 participants 4 messages Jun 19, 2024 – Aug 20, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/attr: add missing libgen.h header

From: Yegor Yefremov <[email protected]>

Resolves the following error when building against MUSL:

tools/attr.c: In function 'main':
tools/attr.c:69:20: error: implicit declaration of function 'basename' [-Wimplicit-function-declaration]

   69 |         progname = basename(argv[0]);
      |                    ^~~~~~~~

tools/attr.c:69:18: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
69 | progname = basename(argv[0]);
| ^

Upstream: https://lists.nongnu.org/archive/html/acl-devel/2024-03/msg00000.html

---
 ...-missing-libgen.h-include-for-basena.patch | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 package/attr/0003-tools-attr.c-Add-missing-libgen.h-include-for-basena.patch
package/attr/0003-tools-attr.c-Add-missing-libgen.h-include-for-basena.patch new file +31 -0
new file mode 100644
index 0000000000..b4012297e6
@@ -0,0 +1,31 @@
+From fe7fbc2b666f0daad5b7bb0b1e8eb2261cf16530 Mon Sep 17 00:00:00 2001
+From: Yegor Yefremov <[email protected]>
+Date: Wed, 19 Jun 2024 09:21:34 +0200
+Subject: [PATCH] tools/attr.c: Add missing libgen.h include for basename(3)
+
+Fixes compilation issue with musl and modern C99 compilers.
+
+See: https://bugs.gentoo.org/926294
+
+Upstream: https://lists.nongnu.org/archive/html/acl-devel/2024-03/msg00000.html
+
+Signed-off-by: Yegor Yefremov <[email protected]>
+---
+ tools/attr.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tools/attr.c b/tools/attr.c
+index f12e4af..6a3c1e9 100644
+--- a/tools/attr.c
++++ b/tools/attr.c
+@@ -28,6 +28,7 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <locale.h>
++#include <libgen.h>
+ 
+ #include <attr/attributes.h>
+ 
+-- 
+2.34.1
+
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hi All,

Quoted 8 lines · On Wed, Jun 19, 2024 at 9:33 AM <[email protected]> wrote:

From: Yegor Yefremov <[email protected]>

Resolves the following error when building against MUSL:

tools/attr.c: In function 'main':
tools/attr.c:69:20: error: implicit declaration of function 'basename' [-Wimplicit-function-declaration]

Quoted 8 lines
   69 |         progname = basename(argv[0]);
      |                    ^~~~~~~~

tools/attr.c:69:18: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
69 | progname = basename(argv[0]);
| ^

Upstream: https://lists.nongnu.org/archive/html/acl-devel/2024-03/msg00000.html

The patch was merged [1] upstream but there is still no new release.

[1] https://git.savannah.nongnu.org/cgit/attr.git/commit/?id=8a80d895dfd779373363c3a4b62ecce5a549efb2

Yegor

Quoted 46 lines
---
 ...-missing-libgen.h-include-for-basena.patch | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 package/attr/0003-tools-attr.c-Add-missing-libgen.h-include-for-basena.patch
package/attr/0003-tools-attr.c-Add-missing-libgen.h-include-for-basena.patch new file +31 -1
new file mode 100644
index 0000000000..b4012297e6
@@ -0,0 +1,31 @@
+From fe7fbc2b666f0daad5b7bb0b1e8eb2261cf16530 Mon Sep 17 00:00:00 2001
+From: Yegor Yefremov <[email protected]>
+Date: Wed, 19 Jun 2024 09:21:34 +0200
+Subject: [PATCH] tools/attr.c: Add missing libgen.h include for basename(3)
+
+Fixes compilation issue with musl and modern C99 compilers.
+
+See: https://bugs.gentoo.org/926294
+
+Upstream: https://lists.nongnu.org/archive/html/acl-devel/2024-03/msg00000.html
+
+Signed-off-by: Yegor Yefremov <[email protected]>
+---
+ tools/attr.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tools/attr.c b/tools/attr.c
+index f12e4af..6a3c1e9 100644
+--- a/tools/attr.c
++++ b/tools/attr.c
+@@ -28,6 +28,7 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <locale.h>
++#include <libgen.h>
+
+ #include <attr/attributes.h>
+
+--
+2.34.1
+
--
Quoted 2 lines

2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

Hello Yegor, All,

Le 10/07/2024 à 12:27, Yegor Yefremov via buildroot a écrit :

Quoted 18 lines

Hi All,

Quoted 15 lines · On Wed, Jun 19, 2024 at 9:33 AM <[email protected]> wrote:

From: Yegor Yefremov <[email protected]>

Resolves the following error when building against MUSL:

tools/attr.c: In function 'main':
tools/attr.c:69:20: error: implicit declaration of function 'basename' [-Wimplicit-function-declaration]

   69 |         progname = basename(argv[0]);
      |                    ^~~~~~~~

tools/attr.c:69:18: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
69 | progname = basename(argv[0]);
| ^

Quoted 5 lines
Quoted 1 line

Upstream: https://lists.nongnu.org/archive/html/acl-devel/2024-03/msg00000.html

The patch was merged [1] upstream but there is still no new release.

[1] https://git.savannah.nongnu.org/cgit/attr.git/commit/?id=8a80d895dfd779373363c3a4b62ecce5a549efb2

I replaced the patch by the upstream one with the correct authorship.

Applied to master, thanks.

Best regards,
Romain

Quoted 47 lines

Yegor

Quoted 44 lines
---
 ...-missing-libgen.h-include-for-basena.patch | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 package/attr/0003-tools-attr.c-Add-missing-libgen.h-include-for-basena.patch
package/attr/0003-tools-attr.c-Add-missing-libgen.h-include-for-basena.patch new file +30 -0
new file mode 100644
index 0000000000..b4012297e6
@@ -0,0 +1,31 @@
+From fe7fbc2b666f0daad5b7bb0b1e8eb2261cf16530 Mon Sep 17 00:00:00 2001
+From: Yegor Yefremov <[email protected]>
+Date: Wed, 19 Jun 2024 09:21:34 +0200
+Subject: [PATCH] tools/attr.c: Add missing libgen.h include for basename(3)
+
+Fixes compilation issue with musl and modern C99 compilers.
+
+See: https://bugs.gentoo.org/926294
+
+Upstream: https://lists.nongnu.org/archive/html/acl-devel/2024-03/msg00000.html
+
+Signed-off-by: Yegor Yefremov <[email protected]>
+---
+ tools/attr.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tools/attr.c b/tools/attr.c
+index f12e4af..6a3c1e9 100644
+--- a/tools/attr.c
++++ b/tools/attr.c
+@@ -28,6 +28,7 @@
+ #include <errno.h>
+ #include <string.h>
+ #include <locale.h>
++#include <libgen.h>
+
+ #include <attr/attributes.h>
+
+--
+2.34.1
Quoted 8 lines
Quoted 4 lines
package/attr/0003-tools-attr.c-Add-missing-libgen.h-include-for-basena.patch new file +1 -1
+
--

2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
Quoted 24 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Romain" == Romain Naour via buildroot <[email protected]> writes:

Hello Yegor, All,
Le 10/07/2024 à 12:27, Yegor Yefremov via buildroot a écrit :

Quoted 20 lines

Hi All,

Quoted 16 lines · On Wed, Jun 19, 2024 at 9:33 AM <[email protected]> wrote:

From: Yegor Yefremov <[email protected]>

Resolves the following error when building against MUSL:

tools/attr.c: In function 'main':
tools/attr.c:69:20: error: implicit declaration of function 'basename' [-Wimplicit-function-declaration]
69 | progname = basename(argv[0]);
| ^~~~~~~~
tools/attr.c:69:18: error: assignment to 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
69 | progname = basename(argv[0]);
| ^

Upstream: https://lists.nongnu.org/archive/html/acl-devel/2024-03/msg00000.html

Quoted 7 lines
Quoted 3 lines

The patch was merged [1] upstream but there is still no new release.

[1] https://git.savannah.nongnu.org/cgit/attr.git/commit/?id=8a80d895dfd779373363c3a4b62ecce5a549efb2

I replaced the patch by the upstream one with the correct authorship.

Applied to master, thanks.

Committed to 2024.02.x and 2024.05.x, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot