All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] zeromq: patch configure.ac to check for ldaddr on when checking libunwind
@ 2018-04-13 11:57 Asaf Kahlon
  2018-04-14 18:48 ` Baruch Siach
  0 siblings, 1 reply; 4+ messages in thread
From: Asaf Kahlon @ 2018-04-13 11:57 UTC (permalink / raw)
  To: buildroot

Fixes:
http://autobuild.buildroot.net/results/2b1aaf7e35651f04a9e9d0269e49c1b0bd87ae29/

configure.ac can fail the build when there's no dynamic library support,
since it cannot find dladdr which is needed only when we have libunwind.
Therefore, configure.ac was patched to check for dladdr only in the libunwind
check section. As a consequence of the patch, libunwind was added as an optional
dependency, and ZEROMQ_AUTORECONF was set.

Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
---
 DEVELOPERS                                    |  1 +
 ...-serach-for-dladdr-only-on-libunwind.patch | 44 +++++++++++++++++++
 package/zeromq/zeromq.mk                      | 10 +++++
 3 files changed, 55 insertions(+)
 create mode 100644 package/zeromq/0001-configure.ac-serach-for-dladdr-only-on-libunwind.patch

diff --git a/DEVELOPERS b/DEVELOPERS
index 05693d3024..f269b79dd4 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -191,6 +191,7 @@ F:	package/stress/
 N:	Asaf Kahlon <asafka7@gmail.com>
 F:	package/python-jsonmodels/
 F:	package/python-yieldfrom/
+F:	package/zeromq
 
 N:	Ash Charles <ash.charles@savoirfairelinux.com>
 F:	package/pru-software-support/
diff --git a/package/zeromq/0001-configure.ac-serach-for-dladdr-only-on-libunwind.patch b/package/zeromq/0001-configure.ac-serach-for-dladdr-only-on-libunwind.patch
new file mode 100644
index 0000000000..36092447ca
--- /dev/null
+++ b/package/zeromq/0001-configure.ac-serach-for-dladdr-only-on-libunwind.patch
@@ -0,0 +1,44 @@
+From 194b3836c87f77aca34581656ff99da49813d8c3 Mon Sep 17 00:00:00 2001
+From: Asaf Kahlon <asafka7@gmail.com>
+Date: Fri, 13 Apr 2018 11:56:46 +0300
+Subject: [PATCH 1/1] configure.ac: serach for dladdr only on libunwind
+
+The original configure.ac tries to check for dladdr, but it actually needs
+it only in case we have libunwind (which has a another section and checks for it
+too).
+This can fail the build on systems without dynamic linking support.
+Therefore, the dladdr check has to be preformed only when checking libunwind.
+
+Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
+---
+ configure.ac | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 216b2bc4..0858a6c1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -174,11 +174,6 @@ case "${host_os}" in
+         AC_DEFINE(ZMQ_HAVE_LINUX, 1, [Have Linux OS])
+         libzmq_on_linux="yes"
+ 
+-        # dladdr/dlopen is in libdl on glibc
+-        AC_SEARCH_LIBS([dladdr], [dl dld], [], [
+-          AC_MSG_ERROR([unable to find the dladdr() function])
+-        ])
+-
+         if test "x$libzmq_tipc_support" = "xyes"; then
+             AC_DEFINE(ZMQ_HAVE_TIPC, 1, [Have TIPC support])
+         fi
+@@ -783,7 +778,7 @@ if test "x$enable_libunwind" != "xno"; then
+             AC_DEFINE(HAVE_LIBUNWIND, 1, [The libunwind library is to be used])
+             AC_SUBST([LIBUNWIND_CFLAGS])
+             AC_SUBST([LIBUNWIND_LIBS])
+-            AC_CHECK_LIB([dl], [dladdr])
++            AC_SEARCH_LIBS([dladdr], [dl dld])
+         ],
+         [
+             if test "x$enable_libunwind" = "xyes"; then
+-- 
+2.17.0
+
diff --git a/package/zeromq/zeromq.mk b/package/zeromq/zeromq.mk
index debaf413b4..ac9cc4aa80 100644
--- a/package/zeromq/zeromq.mk
+++ b/package/zeromq/zeromq.mk
@@ -11,6 +11,8 @@ ZEROMQ_DEPENDENCIES = util-linux
 ZEROMQ_CONF_OPTS = --without-documentation
 ZEROMQ_LICENSE = LGPL-3.0+ with exceptions
 ZEROMQ_LICENSE_FILES = COPYING COPYING.LESSER
+# 0001-configure.ac-serach-for-dladdr-only-on-libunwind.patch touches configure.ac
+ZEROMQ_AUTORECONF = YES
 
 # Assume these flags are always available. It is true, at least for
 # SOCK_CLOEXEC, since linux v2.6.27.
@@ -49,4 +51,12 @@ else
 ZEROMQ_CONF_OPTS += --without-libsodium
 endif
 
+# ZeroMQ uses libunwind if it's available
+ifeq ($(BR2_PACKAGE_LIBUNWIND), y)
+ZEROMQ_DEPENDENCIES += libunwind
+ZEROMQ_CONF_OPTS += --enable-libunwind
+else
+ZEROMQ_CONF_OPTS += --disable-libunwind
+endif
+
 $(eval $(autotools-package))
-- 
2.17.0

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

* [Buildroot] [PATCH 1/1] zeromq: patch configure.ac to check for ldaddr on when checking libunwind
  2018-04-13 11:57 [Buildroot] [PATCH 1/1] zeromq: patch configure.ac to check for ldaddr on when checking libunwind Asaf Kahlon
@ 2018-04-14 18:48 ` Baruch Siach
  0 siblings, 0 replies; 4+ messages in thread
From: Baruch Siach @ 2018-04-14 18:48 UTC (permalink / raw)
  To: buildroot

Hi Asaf,

On Fri, Apr 13, 2018 at 02:57:40PM +0300, Asaf Kahlon wrote:
> Fixes:
> http://autobuild.buildroot.net/results/2b1aaf7e35651f04a9e9d0269e49c1b0bd87ae29/
> 
> configure.ac can fail the build when there's no dynamic library support,
> since it cannot find dladdr which is needed only when we have libunwind.
> Therefore, configure.ac was patched to check for dladdr only in the libunwind
> check section. As a consequence of the patch, libunwind was added as an optional
> dependency, and ZEROMQ_AUTORECONF was set.
> 
> Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
> ---
>  DEVELOPERS                                    |  1 +
>  ...-serach-for-dladdr-only-on-libunwind.patch | 44 +++++++++++++++++++
>  package/zeromq/zeromq.mk                      | 10 +++++
>  3 files changed, 55 insertions(+)
>  create mode 100644 package/zeromq/0001-configure.ac-serach-for-dladdr-only-on-libunwind.patch
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 05693d3024..f269b79dd4 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -191,6 +191,7 @@ F:	package/stress/
>  N:	Asaf Kahlon <asafka7@gmail.com>
>  F:	package/python-jsonmodels/
>  F:	package/python-yieldfrom/
> +F:	package/zeromq
>  
>  N:	Ash Charles <ash.charles@savoirfairelinux.com>
>  F:	package/pru-software-support/
> diff --git a/package/zeromq/0001-configure.ac-serach-for-dladdr-only-on-libunwind.patch b/package/zeromq/0001-configure.ac-serach-for-dladdr-only-on-libunwind.patch
> new file mode 100644
> index 0000000000..36092447ca
> --- /dev/null
> +++ b/package/zeromq/0001-configure.ac-serach-for-dladdr-only-on-libunwind.patch
> @@ -0,0 +1,44 @@
> +From 194b3836c87f77aca34581656ff99da49813d8c3 Mon Sep 17 00:00:00 2001
> +From: Asaf Kahlon <asafka7@gmail.com>
> +Date: Fri, 13 Apr 2018 11:56:46 +0300
> +Subject: [PATCH 1/1] configure.ac: serach for dladdr only on libunwind
> +
> +The original configure.ac tries to check for dladdr, but it actually needs
> +it only in case we have libunwind (which has a another section and checks for it
> +too).
> +This can fail the build on systems without dynamic linking support.
> +Therefore, the dladdr check has to be preformed only when checking libunwind.
> +
> +Signed-off-by: Asaf Kahlon <asafka7@gmail.com>

Have you sent this patch upstream? If so, please add a link to your 
submission.

> +---
> + configure.ac | 7 +------
> + 1 file changed, 1 insertion(+), 6 deletions(-)
> +
> +diff --git a/configure.ac b/configure.ac
> +index 216b2bc4..0858a6c1 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -174,11 +174,6 @@ case "${host_os}" in
> +         AC_DEFINE(ZMQ_HAVE_LINUX, 1, [Have Linux OS])
> +         libzmq_on_linux="yes"
> + 
> +-        # dladdr/dlopen is in libdl on glibc
> +-        AC_SEARCH_LIBS([dladdr], [dl dld], [], [
> +-          AC_MSG_ERROR([unable to find the dladdr() function])
> +-        ])
> +-
> +         if test "x$libzmq_tipc_support" = "xyes"; then
> +             AC_DEFINE(ZMQ_HAVE_TIPC, 1, [Have TIPC support])
> +         fi
> +@@ -783,7 +778,7 @@ if test "x$enable_libunwind" != "xno"; then
> +             AC_DEFINE(HAVE_LIBUNWIND, 1, [The libunwind library is to be used])
> +             AC_SUBST([LIBUNWIND_CFLAGS])
> +             AC_SUBST([LIBUNWIND_LIBS])
> +-            AC_CHECK_LIB([dl], [dladdr])
> ++            AC_SEARCH_LIBS([dladdr], [dl dld])
> +         ],
> +         [
> +             if test "x$enable_libunwind" = "xyes"; then
> +-- 
> +2.17.0
> +
> diff --git a/package/zeromq/zeromq.mk b/package/zeromq/zeromq.mk
> index debaf413b4..ac9cc4aa80 100644
> --- a/package/zeromq/zeromq.mk
> +++ b/package/zeromq/zeromq.mk
> @@ -11,6 +11,8 @@ ZEROMQ_DEPENDENCIES = util-linux
>  ZEROMQ_CONF_OPTS = --without-documentation
>  ZEROMQ_LICENSE = LGPL-3.0+ with exceptions
>  ZEROMQ_LICENSE_FILES = COPYING COPYING.LESSER
> +# 0001-configure.ac-serach-for-dladdr-only-on-libunwind.patch touches configure.ac
> +ZEROMQ_AUTORECONF = YES
>  
>  # Assume these flags are always available. It is true, at least for
>  # SOCK_CLOEXEC, since linux v2.6.27.
> @@ -49,4 +51,12 @@ else
>  ZEROMQ_CONF_OPTS += --without-libsodium
>  endif
>  
> +# ZeroMQ uses libunwind if it's available

This comment is not needed.

> +ifeq ($(BR2_PACKAGE_LIBUNWIND), y)

Please remove the space before 'y'.

> +ZEROMQ_DEPENDENCIES += libunwind
> +ZEROMQ_CONF_OPTS += --enable-libunwind
> +else
> +ZEROMQ_CONF_OPTS += --disable-libunwind
> +endif

This hunk belongs in a separate patch since it is unrelated to the build fix.

> +
>  $(eval $(autotools-package))

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

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

* [Buildroot] [PATCH 1/1] zeromq: patch configure.ac to check for ldaddr on when checking libunwind
  2018-04-15 18:15 Asaf Kahlon
@ 2018-04-15 18:39 ` Thomas Petazzoni
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2018-04-15 18:39 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun, 15 Apr 2018 21:15:55 +0300, Asaf Kahlon wrote:
> Fixes:
> http://autobuild.buildroot.net/results/2b1aaf7e35651f04a9e9d0269e49c1b0bd87ae29/
> 
> configure.ac can fail the build when there's no dynamic library support,
> since it cannot find dladdr which is needed only when we have libunwind.
> Therefore, configure.ac was patched to check for dladdr only in the libunwind
> check section. As a consequence of the patch, ZEROMQ_AUTORECONF was set.
> 
> The patch was applied to the zeromq master branch, see:
> https://github.com/zeromq/libzmq/commit/c971445025535b9f989ab0b78f5ddd1c026f1878
> 
> Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
> ---
>  DEVELOPERS                                    |  1 +
>  ...-serach-for-dladdr-only-on-libunwind.patch | 44 +++++++++++++++++++
>  package/zeromq/zeromq.mk                      |  2 +
>  3 files changed, 47 insertions(+)
>  create mode 100644 package/zeromq/0001-configure.ac-serach-for-dladdr-only-on-libunwind.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH 1/1] zeromq: patch configure.ac to check for ldaddr on when checking libunwind
@ 2018-04-15 18:15 Asaf Kahlon
  2018-04-15 18:39 ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: Asaf Kahlon @ 2018-04-15 18:15 UTC (permalink / raw)
  To: buildroot

Fixes:
http://autobuild.buildroot.net/results/2b1aaf7e35651f04a9e9d0269e49c1b0bd87ae29/

configure.ac can fail the build when there's no dynamic library support,
since it cannot find dladdr which is needed only when we have libunwind.
Therefore, configure.ac was patched to check for dladdr only in the libunwind
check section. As a consequence of the patch, ZEROMQ_AUTORECONF was set.

The patch was applied to the zeromq master branch, see:
https://github.com/zeromq/libzmq/commit/c971445025535b9f989ab0b78f5ddd1c026f1878

Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
---
 DEVELOPERS                                    |  1 +
 ...-serach-for-dladdr-only-on-libunwind.patch | 44 +++++++++++++++++++
 package/zeromq/zeromq.mk                      |  2 +
 3 files changed, 47 insertions(+)
 create mode 100644 package/zeromq/0001-configure.ac-serach-for-dladdr-only-on-libunwind.patch

diff --git a/DEVELOPERS b/DEVELOPERS
index 05693d3024..aa70ba5264 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -191,6 +191,7 @@ F:	package/stress/
 N:	Asaf Kahlon <asafka7@gmail.com>
 F:	package/python-jsonmodels/
 F:	package/python-yieldfrom/
+F:	package/zeromq/
 
 N:	Ash Charles <ash.charles@savoirfairelinux.com>
 F:	package/pru-software-support/
diff --git a/package/zeromq/0001-configure.ac-serach-for-dladdr-only-on-libunwind.patch b/package/zeromq/0001-configure.ac-serach-for-dladdr-only-on-libunwind.patch
new file mode 100644
index 0000000000..36092447ca
--- /dev/null
+++ b/package/zeromq/0001-configure.ac-serach-for-dladdr-only-on-libunwind.patch
@@ -0,0 +1,44 @@
+From 194b3836c87f77aca34581656ff99da49813d8c3 Mon Sep 17 00:00:00 2001
+From: Asaf Kahlon <asafka7@gmail.com>
+Date: Fri, 13 Apr 2018 11:56:46 +0300
+Subject: [PATCH 1/1] configure.ac: serach for dladdr only on libunwind
+
+The original configure.ac tries to check for dladdr, but it actually needs
+it only in case we have libunwind (which has a another section and checks for it
+too).
+This can fail the build on systems without dynamic linking support.
+Therefore, the dladdr check has to be preformed only when checking libunwind.
+
+Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
+---
+ configure.ac | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 216b2bc4..0858a6c1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -174,11 +174,6 @@ case "${host_os}" in
+         AC_DEFINE(ZMQ_HAVE_LINUX, 1, [Have Linux OS])
+         libzmq_on_linux="yes"
+ 
+-        # dladdr/dlopen is in libdl on glibc
+-        AC_SEARCH_LIBS([dladdr], [dl dld], [], [
+-          AC_MSG_ERROR([unable to find the dladdr() function])
+-        ])
+-
+         if test "x$libzmq_tipc_support" = "xyes"; then
+             AC_DEFINE(ZMQ_HAVE_TIPC, 1, [Have TIPC support])
+         fi
+@@ -783,7 +778,7 @@ if test "x$enable_libunwind" != "xno"; then
+             AC_DEFINE(HAVE_LIBUNWIND, 1, [The libunwind library is to be used])
+             AC_SUBST([LIBUNWIND_CFLAGS])
+             AC_SUBST([LIBUNWIND_LIBS])
+-            AC_CHECK_LIB([dl], [dladdr])
++            AC_SEARCH_LIBS([dladdr], [dl dld])
+         ],
+         [
+             if test "x$enable_libunwind" = "xyes"; then
+-- 
+2.17.0
+
diff --git a/package/zeromq/zeromq.mk b/package/zeromq/zeromq.mk
index debaf413b4..2682a567de 100644
--- a/package/zeromq/zeromq.mk
+++ b/package/zeromq/zeromq.mk
@@ -11,6 +11,8 @@ ZEROMQ_DEPENDENCIES = util-linux
 ZEROMQ_CONF_OPTS = --without-documentation
 ZEROMQ_LICENSE = LGPL-3.0+ with exceptions
 ZEROMQ_LICENSE_FILES = COPYING COPYING.LESSER
+# 0001-configure.ac-serach-for-dladdr-only-on-libunwind.patch touches configure.ac
+ZEROMQ_AUTORECONF = YES
 
 # Assume these flags are always available. It is true, at least for
 # SOCK_CLOEXEC, since linux v2.6.27.
-- 
2.17.0

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

end of thread, other threads:[~2018-04-15 18:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-13 11:57 [Buildroot] [PATCH 1/1] zeromq: patch configure.ac to check for ldaddr on when checking libunwind Asaf Kahlon
2018-04-14 18:48 ` Baruch Siach
2018-04-15 18:15 Asaf Kahlon
2018-04-15 18:39 ` Thomas Petazzoni

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.