diff mbox series

[1/1] package/shadow: disable on uclibc

Message ID 20240303181859.1103815-1-fontaine.fabrice@gmail.com
State Accepted
Headers show
Series [1/1] package/shadow: disable on uclibc | expand

Commit Message

Fabrice Fontaine March 3, 2024, 6:18 p.m. UTC
shadow unconditionally uses reallocarray, reallocf and explicit_bzero
since bump to version 4.14.3 in commit
8a01774d9897310c00a0945865f5a6d5167dfca3 and
https://github.com/shadow-maint/shadow/commit/1aa22c14674e14e84efa171614dea2b515d5a223
https://github.com/shadow-maint/shadow/commit/0e0a310acf5111251589116343897a63ebc88e7a
https://github.com/shadow-maint/shadow/commit/0ec157d579931cfec1cc8439288ed17adf19da5d
resulting in the following uclibc build failure:

/home/autobuild/autobuild/instance-9/output-1/host/lib/gcc/arc-buildroot-linux-uclibc/13.1.1/../../../../arc-buildroot-linux-uclibc/bin/ld: groups.o: in function `main':
groups.c:(.text.startup+0x20): undefined reference to `reallocarray'

Fixes:
 - http://autobuild.buildroot.org/results/98be07d299aa383a447a1f1dd2924a00c1a29a34

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 package/shadow/Config.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Raphael Pavlidis March 3, 2024, 7:15 p.m. UTC | #1
Hi Fabrice,
I would add a comment to the "depends on" line, which lists the functions that are missing in the uclibc toolchain, like reallocarray.

I wanted to fix this build issue next week. Thanks for the patch. :) 

Thanks,
Raphael Pavlidis
Peter Korsgaard March 4, 2024, 11:46 a.m. UTC | #2
>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > shadow unconditionally uses reallocarray, reallocf and explicit_bzero
 > since bump to version 4.14.3 in commit
 > 8a01774d9897310c00a0945865f5a6d5167dfca3 and
 > https://github.com/shadow-maint/shadow/commit/1aa22c14674e14e84efa171614dea2b515d5a223
 > https://github.com/shadow-maint/shadow/commit/0e0a310acf5111251589116343897a63ebc88e7a
 > https://github.com/shadow-maint/shadow/commit/0ec157d579931cfec1cc8439288ed17adf19da5d
 > resulting in the following uclibc build failure:

 > /home/autobuild/autobuild/instance-9/output-1/host/lib/gcc/arc-buildroot-linux-uclibc/13.1.1/../../../../arc-buildroot-linux-uclibc/bin/ld:
 > groups.o: in function `main':
 > groups.c:(.text.startup+0x20): undefined reference to `reallocarray'

 > Fixes:
 >  - http://autobuild.buildroot.org/results/98be07d299aa383a447a1f1dd2924a00c1a29a34

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

I got a bit confused about reallocf as musl doesn't provide that, but it
turns out that it is no longer used since:

https://github.com/shadow-maint/shadow/commit/6e58c1275252f3314d1aa5cc4d7e7f9068e3a902

So I dropped the reallocf reference and added a comment about
reallocarray/explicit_bzero as suggested by Raphael and committed,
thanks.


> ---
 >  package/shadow/Config.in | 6 ++++--
 >  1 file changed, 4 insertions(+), 2 deletions(-)

 > diff --git a/package/shadow/Config.in b/package/shadow/Config.in
 > index 230271af7d..bc85d0d135 100644
 > --- a/package/shadow/Config.in
 > +++ b/package/shadow/Config.in
 > @@ -2,6 +2,7 @@ menuconfig BR2_PACKAGE_SHADOW
 >  	bool "shadow"
 >  	depends on !BR2_STATIC_LIBS
 >  	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14
 > +	depends on !BR2_TOOLCHAIN_USES_UCLIBC
 >  	help
 >  	  Utilities to deal with user accounts.
 
 > @@ -55,5 +56,6 @@ config BR2_PACKAGE_SHADOW_YESCRYPT
 
 >  endif # BR2_PACKAGE_SHADOW
 
 > -comment "shadow needs a toolchain w/ headers >= 4.14, dynamic library"
 > -	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14 || BR2_STATIC_LIBS
 > +comment "shadow needs a glibc or musl toolchain w/ headers >= 4.14, dynamic library"
 > +	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14 || \
 > +		BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_UCLIBC
 > -- 

 > 2.43.0

 > _______________________________________________
 > buildroot mailing list
 > buildroot@buildroot.org
 > https://lists.buildroot.org/mailman/listinfo/buildroot
diff mbox series

Patch

diff --git a/package/shadow/Config.in b/package/shadow/Config.in
index 230271af7d..bc85d0d135 100644
--- a/package/shadow/Config.in
+++ b/package/shadow/Config.in
@@ -2,6 +2,7 @@  menuconfig BR2_PACKAGE_SHADOW
 	bool "shadow"
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14
+	depends on !BR2_TOOLCHAIN_USES_UCLIBC
 	help
 	  Utilities to deal with user accounts.
 
@@ -55,5 +56,6 @@  config BR2_PACKAGE_SHADOW_YESCRYPT
 
 endif # BR2_PACKAGE_SHADOW
 
-comment "shadow needs a toolchain w/ headers >= 4.14, dynamic library"
-	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14 || BR2_STATIC_LIBS
+comment "shadow needs a glibc or musl toolchain w/ headers >= 4.14, dynamic library"
+	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_14 || \
+		BR2_STATIC_LIBS || BR2_TOOLCHAIN_USES_UCLIBC