All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] minizip: needs __register_atfork
@ 2018-10-02 19:16 Fabrice Fontaine
  2018-10-02 21:08 ` Arnout Vandecappelle
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2018-10-02 19:16 UTC (permalink / raw)
  To: buildroot

The following error is raised:

[100%] Linking C executable minizip
/home/peko/autobuild/instance-0/output/host/m68k-buildroot-uclinux-uclibc/sysroot/usr/lib/libbsd.a(arc4random.o): In function `_rs_init.part.1':
arc4random.c:(.text+0xaa): undefined reference to `__register_atfork'
collect2: error: ld returned 1 exit status

As specified in openssl/Config.in, uClibc on noMMU doesn't provide
__register_atfork() so add this dependency on minizip

It should be noted that technically, this dependency comes from libbsd.
Indeed _ARC4_ATFORK is defined to be __register_atfork if __GLIBC__ is
defined and to pthread_atfork otherwise (see src/arc4random_linux.h)

So perhaps this dependency should be added to libbsd and to hcitop from
bluez-alsa (netcat-openbsd depends on glibc)

Fixes:
 - http://autobuild.buildroot.org/results/df2dcbdceaa01a2ae37bf09140e4dbef0a5b9489

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

diff --git a/package/minizip/Config.in b/package/minizip/Config.in
index 68fa1d7118..ed54e3b651 100644
--- a/package/minizip/Config.in
+++ b/package/minizip/Config.in
@@ -1,6 +1,8 @@
 config BR2_PACKAGE_MINIZIP
 	bool "minizip"
 	depends on BR2_PACKAGE_LIBBSD_ARCH_SUPPORTS
+	# uClibc on noMMU doesn't provide __register_atfork()
+	depends on !(BR2_TOOLCHAIN_USES_UCLIBC && !BR2_USE_MMU)
 	depends on BR2_TOOLCHAIN_HAS_THREADS # libbsd
 	depends on BR2_USE_WCHAR # libbsd
 	select BR2_PACKAGE_LIBBSD
-- 
2.17.1

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

* [Buildroot] [PATCH 1/1] minizip: needs __register_atfork
  2018-10-02 19:16 [Buildroot] [PATCH 1/1] minizip: needs __register_atfork Fabrice Fontaine
@ 2018-10-02 21:08 ` Arnout Vandecappelle
  0 siblings, 0 replies; 2+ messages in thread
From: Arnout Vandecappelle @ 2018-10-02 21:08 UTC (permalink / raw)
  To: buildroot



On 02/10/2018 21:16, Fabrice Fontaine wrote:
> The following error is raised:
> 
> [100%] Linking C executable minizip
> /home/peko/autobuild/instance-0/output/host/m68k-buildroot-uclinux-uclibc/sysroot/usr/lib/libbsd.a(arc4random.o): In function `_rs_init.part.1':
> arc4random.c:(.text+0xaa): undefined reference to `__register_atfork'
> collect2: error: ld returned 1 exit status
> 
> As specified in openssl/Config.in, uClibc on noMMU doesn't provide
> __register_atfork() so add this dependency on minizip
> 
> It should be noted that technically, this dependency comes from libbsd.
> Indeed _ARC4_ATFORK is defined to be __register_atfork if __GLIBC__ is
> defined and to pthread_atfork otherwise (see src/arc4random_linux.h)
> 
> So perhaps this dependency should be added to libbsd and to hcitop from
> bluez-alsa (netcat-openbsd depends on glibc)

 Indeed, this dependency should be added to libbsd (and thus propagated to minizip).

 However, perhaps it's better to just fix libbsd. Calling an internal function
of glibc is never a good idea. Using the standard pthread_atfork unconditionally
is a lot safer, and pthread_atfork *is* supported by uClibc on noMMU targets.

 Note BTW that hcitop depends on MMU, and netcat-openbsd depends on glibc, so
the dependency wouldn't have to be propagated to those two.

 Regards,
 Arnout

> 
> Fixes:
>  - http://autobuild.buildroot.org/results/df2dcbdceaa01a2ae37bf09140e4dbef0a5b9489
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  package/minizip/Config.in | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/package/minizip/Config.in b/package/minizip/Config.in
> index 68fa1d7118..ed54e3b651 100644
> --- a/package/minizip/Config.in
> +++ b/package/minizip/Config.in
> @@ -1,6 +1,8 @@
>  config BR2_PACKAGE_MINIZIP
>  	bool "minizip"
>  	depends on BR2_PACKAGE_LIBBSD_ARCH_SUPPORTS
> +	# uClibc on noMMU doesn't provide __register_atfork()
> +	depends on !(BR2_TOOLCHAIN_USES_UCLIBC && !BR2_USE_MMU)
>  	depends on BR2_TOOLCHAIN_HAS_THREADS # libbsd
>  	depends on BR2_USE_WCHAR # libbsd
>  	select BR2_PACKAGE_LIBBSD
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

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

end of thread, other threads:[~2018-10-02 21:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-02 19:16 [Buildroot] [PATCH 1/1] minizip: needs __register_atfork Fabrice Fontaine
2018-10-02 21:08 ` Arnout Vandecappelle

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.