* [Buildroot] [PATCH 1/1] package/zeromq: enable kernel-based feature flags
@ 2015-02-06 9:25 Lionel Orry
2015-03-15 22:28 ` Thomas Petazzoni
0 siblings, 1 reply; 14+ messages in thread
From: Lionel Orry @ 2015-02-06 9:25 UTC (permalink / raw)
To: buildroot
The current configuration system does not check for cached variables for
these flags, and thus they are always disabled when cross-compiling.
This patch fixes the configuration system to use cached variables and
enables them at configuration time.
Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
---
...e.m4-make-kernel-specific-flags-cacheable.patch | 204 +++++++++++++++++++++
package/zeromq/zeromq.mk | 10 +
2 files changed, 214 insertions(+)
create mode 100644 package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
diff --git a/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch b/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
new file mode 100644
index 0000000..9b6e808
--- /dev/null
+++ b/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
@@ -0,0 +1,204 @@
+From 2eee4dd2b1668124f377f6da1d511249086a1449 Mon Sep 17 00:00:00 2001
+From: Lionel Orry <lionel.orry@gmail.com>
+Date: Fri, 6 Feb 2015 09:45:21 +0100
+Subject: [PATCH 1/1] acinclude.m4: make kernel-specific flags cacheable
+
+Specifically when cross-compiling, one can be willing to force these
+variable values using the environment of a config.cache file. This
+commit makes this possible.
+
+The affected variables are:
+
+* libzmq_cv_sock_cloexec
+* libzmq_cv_so_keepalive
+* libzmq_cv_tcp_keepcnt
+* libzmq_cv_tcp_keepidle
+* libzmq_cv_tcp_keepintvl
+* libzmq_cv_tcp_keepalive
+
+Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
+---
+ acinclude.m4 | 84 ++++++++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 48 insertions(+), 36 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index c5c2748..b40f0c1 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -586,8 +586,8 @@ dnl # LIBZMQ_CHECK_SOCK_CLOEXEC([action-if-found], [action-if-not-found])
+ dnl # Check if SOCK_CLOEXEC is supported #
+ dnl ################################################################################
+ AC_DEFUN([LIBZMQ_CHECK_SOCK_CLOEXEC], [{
+- AC_MSG_CHECKING(whether SOCK_CLOEXEC is supported)
+- AC_TRY_RUN([/* SOCK_CLOEXEC test */
++ AC_CACHE_CHECK([whether SOCK_CLOEXEC is supported], [libzmq_cv_sock_cloexec],
++ [AC_TRY_RUN([/* SOCK_CLOEXEC test */
+ #include <sys/types.h>
+ #include <sys/socket.h>
+
+@@ -596,11 +596,13 @@ int main (int argc, char *argv [])
+ int s = socket (PF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
+ return (s == -1);
+ }
+- ],
+- [AC_MSG_RESULT(yes) ; libzmq_cv_sock_cloexec="yes" ; $1],
+- [AC_MSG_RESULT(no) ; libzmq_cv_sock_cloexec="no" ; $2],
+- [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_sock_cloexec="no"]
++ ],
++ [libzmq_cv_sock_cloexec="yes"],
++ [libzmq_cv_sock_cloexec="no"],
++ [libzmq_cv_sock_cloexec="not during cross-compile"]
++ )]
+ )
++ AS_IF([test "x$libzmq_cv_sock_cloexec" = "xyes"], [$1], [$2])
+ }])
+
+ dnl ################################################################################
+@@ -608,8 +610,8 @@ dnl # LIBZMQ_CHECK_SO_KEEPALIVE([action-if-found], [action-if-not-found])
+ dnl # Check if SO_KEEPALIVE is supported #
+ dnl ################################################################################
+ AC_DEFUN([LIBZMQ_CHECK_SO_KEEPALIVE], [{
+- AC_MSG_CHECKING(whether SO_KEEPALIVE is supported)
+- AC_TRY_RUN([/* SO_KEEPALIVE test */
++ AC_CACHE_CHECK([whether SO_KEEPALIVE is supported], [libzmq_cv_so_keepalive],
++ [AC_TRY_RUN([/* SO_KEEPALIVE test */
+ #include <sys/types.h>
+ #include <sys/socket.h>
+
+@@ -621,11 +623,13 @@ int main (int argc, char *argv [])
+ ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1)
+ );
+ }
+- ],
+- [AC_MSG_RESULT(yes) ; libzmq_cv_so_keepalive="yes" ; $1],
+- [AC_MSG_RESULT(no) ; libzmq_cv_so_keepalive="no" ; $2],
+- [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_so_keepalive="no"]
++ ],
++ [libzmq_cv_so_keepalive="yes"],
++ [libzmq_cv_so_keepalive="no"],
++ [libzmq_cv_so_keepalive="not during cross-compile"]
++ )]
+ )
++ AS_IF([test "x$libzmq_cv_so_keepalive" = "xyes"], [$1], [$2])
+ }])
+
+ dnl ################################################################################
+@@ -633,8 +637,8 @@ dnl # LIBZMQ_CHECK_TCP_KEEPCNT([action-if-found], [action-if-not-found])
+ dnl # Check if TCP_KEEPCNT is supported #
+ dnl ################################################################################
+ AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPCNT], [{
+- AC_MSG_CHECKING(whether TCP_KEEPCNT is supported)
+- AC_TRY_RUN([/* TCP_KEEPCNT test */
++ AC_CACHE_CHECK([whether TCP_KEEPCNT is supported], [libzmq_cv_tcp_keepcnt],
++ [AC_TRY_RUN([/* TCP_KEEPCNT test */
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+@@ -649,11 +653,13 @@ int main (int argc, char *argv [])
+ ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPCNT, (char*) &opt, sizeof (int))) == -1)
+ );
+ }
+- ],
+- [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepcnt="yes" ; $1],
+- [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepcnt="no" ; $2],
+- [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepcnt="no"]
++ ],
++ [libzmq_cv_tcp_keepcnt="yes"],
++ [libzmq_cv_tcp_keepcnt="no"],
++ [libzmq_cv_tcp_keepcnt="not during cross-compile"]
++ )]
+ )
++ AS_IF([test "x$libzmq_cv_tcp_keepcnt" = "xyes"], [$1], [$2])
+ }])
+
+ dnl ################################################################################
+@@ -661,8 +667,8 @@ dnl # LIBZMQ_CHECK_TCP_KEEPIDLE([action-if-found], [action-if-not-found])
+ dnl # Check if TCP_KEEPIDLE is supported #
+ dnl ################################################################################
+ AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPIDLE], [{
+- AC_MSG_CHECKING(whether TCP_KEEPIDLE is supported)
+- AC_TRY_RUN([/* TCP_KEEPIDLE test */
++ AC_CACHE_CHECK([whether TCP_KEEPIDLE is supported], [libzmq_cv_tcp_keepidle],
++ [AC_TRY_RUN([/* TCP_KEEPIDLE test */
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+@@ -677,11 +683,13 @@ int main (int argc, char *argv [])
+ ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPIDLE, (char*) &opt, sizeof (int))) == -1)
+ );
+ }
+- ],
+- [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepidle="yes" ; $1],
+- [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepidle="no" ; $2],
+- [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepidle="no"]
++ ],
++ [libzmq_cv_tcp_keepidle="yes"],
++ [libzmq_cv_tcp_keepidle="no"],
++ [libzmq_cv_tcp_keepidle="not during cross-compile"]
++ )]
+ )
++ AS_IF([test "x$libzmq_cv_tcp_keepidle" = "xyes"], [$1], [$2])
+ }])
+
+ dnl ################################################################################
+@@ -689,8 +697,8 @@ dnl # LIBZMQ_CHECK_TCP_KEEPINTVL([action-if-found], [action-if-not-found])
+ dnl # Check if TCP_KEEPINTVL is supported #
+ dnl ################################################################################
+ AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPINTVL], [{
+- AC_MSG_CHECKING(whether TCP_KEEPINTVL is supported)
+- AC_TRY_RUN([/* TCP_KEEPINTVL test */
++ AC_CACHE_CHECK([whether TCP_KEEPINTVL is supported], [libzmq_cv_tcp_keepintvl],
++ [AC_TRY_RUN([/* TCP_KEEPINTVL test */
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+@@ -705,11 +713,13 @@ int main (int argc, char *argv [])
+ ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPINTVL, (char*) &opt, sizeof (int))) == -1)
+ );
+ }
+- ],
+- [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepintvl="yes" ; $1],
+- [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepintvl="no" ; $2],
+- [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepintvl="no"]
++ ],
++ [libzmq_cv_tcp_keepintvl="yes"],
++ [libzmq_cv_tcp_keepintvl="no"],
++ [libzmq_cv_tcp_keepintvl="not during cross-compile"]
++ )]
+ )
++ AS_IF([test "x$libzmq_cv_tcp_keepintvl" = "xyes"], [$1], [$2])
+ }])
+
+ dnl ################################################################################
+@@ -717,8 +727,8 @@ dnl # LIBZMQ_CHECK_TCP_KEEPALIVE([action-if-found], [action-if-not-found])
+ dnl # Check if TCP_KEEPALIVE is supported #
+ dnl ################################################################################
+ AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPALIVE], [{
+- AC_MSG_CHECKING(whether TCP_KEEPALIVE is supported)
+- AC_TRY_RUN([/* TCP_KEEPALIVE test */
++ AC_CACHE_CHECK([whether TCP_KEEPALIVE is supported], [libzmq_cv_tcp_keepalive],
++ [AC_TRY_RUN([/* TCP_KEEPALIVE test */
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+@@ -733,11 +743,13 @@ int main (int argc, char *argv [])
+ ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPALIVE, (char*) &opt, sizeof (int))) == -1)
+ );
+ }
+- ],
+- [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepalive="yes" ; $1],
+- [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepalive="no" ; $2],
+- [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepalive="no"]
++ ],
++ [libzmq_cv_tcp_keepalive="yes"],
++ [libzmq_cv_tcp_keepalive="no"],
++ [libzmq_cv_tcp_keepalive="not during cross-compile"]
++ )]
+ )
++ AS_IF([test "x$libzmq_cv_tcp_keepalive" = "xyes"], [$1], [$2])
+ }])
+
+ dnl ################################################################################
+--
+2.1.0
+
diff --git a/package/zeromq/zeromq.mk b/package/zeromq/zeromq.mk
index e8f7c57..ad41671 100644
--- a/package/zeromq/zeromq.mk
+++ b/package/zeromq/zeromq.mk
@@ -11,8 +11,18 @@ ZEROMQ_DEPENDENCIES = util-linux
ZEROMQ_LICENSE = LGPLv3+ with exceptions
ZEROMQ_LICENSE_FILES = COPYING COPYING.LESSER
# For 0001-tests-disable-test_fork-if-fork-is-not-available.patch
+# and 0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
ZEROMQ_AUTORECONF = YES
+# Assume these flags are always available. It is true, at least for
+# SOCK_CLOEXEC, since linux v2.6.27.
+# Note: the flag TCP_KEEPALIVE is NOT available so we do not include it.
+ZEROMQ_CONF_ENV = libzmq_cv_sock_cloexec=yes \
+ libzmq_cv_so_keepalive=yes \
+ libzmq_cv_tcp_keepcnt=yes \
+ libzmq_cv_tcp_keepidle=yes \
+ libzmq_cv_tcp_keepintvl=yes
+
# Only tools/curve_keygen.c needs this, but it doesn't hurt to pass it
# for the rest of the build as well (which automatically includes stdc++).
ifeq ($(BR2_STATIC_LIBS),y)
--
2.1.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 1/1] package/zeromq: enable kernel-based feature flags
2015-02-06 9:25 Lionel Orry
@ 2015-03-15 22:28 ` Thomas Petazzoni
2015-03-16 6:43 ` Lionel Orry
0 siblings, 1 reply; 14+ messages in thread
From: Thomas Petazzoni @ 2015-03-15 22:28 UTC (permalink / raw)
To: buildroot
Dear Lionel Orry,
On Fri, 6 Feb 2015 10:25:52 +0100, Lionel Orry wrote:
> The current configuration system does not check for cached variables for
> these flags, and thus they are always disabled when cross-compiling.
> This patch fixes the configuration system to use cached variables and
> enables them at configuration time.
>
> Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
> ---
> ...e.m4-make-kernel-specific-flags-cacheable.patch | 204 +++++++++++++++++++++
> package/zeromq/zeromq.mk | 10 +
> 2 files changed, 214 insertions(+)
> create mode 100644 package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
Thanks for this patch, and sorry for the slow response.
However, I believe it would be a lot better to change the acinclude.m4
tests to not use AC_TRY_RUN, but instead to simply test if TCP_KEEPCNT,
TCP_KEEPIDLE, etc. exist at compile time. If they are defined in the
kernel headers, then you know the kernel supports them, since running a
kernel older than the kernel headers used in the toolchain cannot work.
So, replace AC_TRY_RUN with AC_TRY_LINK or something like that. Or
maybe there's even a simpler autoconf macro to test if a definition
exists or not.
Can you try this instead?
Also, did you submit your patch upstream?
Thanks a lot,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 1/1] package/zeromq: enable kernel-based feature flags
2015-03-15 22:28 ` Thomas Petazzoni
@ 2015-03-16 6:43 ` Lionel Orry
2015-03-16 8:05 ` Thomas Petazzoni
2015-03-18 22:27 ` Arnout Vandecappelle
0 siblings, 2 replies; 14+ messages in thread
From: Lionel Orry @ 2015-03-16 6:43 UTC (permalink / raw)
To: buildroot
Hi Thomas,
On Sun, Mar 15, 2015 at 11:28 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Lionel Orry,
>
> On Fri, 6 Feb 2015 10:25:52 +0100, Lionel Orry wrote:
>> The current configuration system does not check for cached variables for
>> these flags, and thus they are always disabled when cross-compiling.
>> This patch fixes the configuration system to use cached variables and
>> enables them at configuration time.
>>
>> Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
>> ---
>> ...e.m4-make-kernel-specific-flags-cacheable.patch | 204 +++++++++++++++++++++
>> package/zeromq/zeromq.mk | 10 +
>> 2 files changed, 214 insertions(+)
>> create mode 100644 package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
>
> Thanks for this patch, and sorry for the slow response.
>
> However, I believe it would be a lot better to change the acinclude.m4
> tests to not use AC_TRY_RUN, but instead to simply test if TCP_KEEPCNT,
> TCP_KEEPIDLE, etc. exist at compile time. If they are defined in the
> kernel headers, then you know the kernel supports them, since running a
> kernel older than the kernel headers used in the toolchain cannot work.
>
> So, replace AC_TRY_RUN with AC_TRY_LINK or something like that. Or
> maybe there's even a simpler autoconf macro to test if a definition
> exists or not.
the fact is, I was asked by Arnout to do it that way, and his opinion
was that it was needed to run the snippet on the target to be sure of
the resut. See:
http://article.gmane.org/gmane.comp.lib.uclibc.buildroot/106055
Is there something I misunderstood ? Who has the final call about this ?
>
> Can you try this instead?
>
> Also, did you submit your patch upstream?
Yes I did, it has been merged into the next branch of zeromq, v4.1.x.
>
> Thanks a lot,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
Best regards,
Lionel
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 1/1] package/zeromq: enable kernel-based feature flags
2015-03-16 6:43 ` Lionel Orry
@ 2015-03-16 8:05 ` Thomas Petazzoni
2015-03-18 22:27 ` Arnout Vandecappelle
1 sibling, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2015-03-16 8:05 UTC (permalink / raw)
To: buildroot
Dear Lionel Orry,
On Mon, 16 Mar 2015 07:43:11 +0100, Lionel Orry wrote:
> > So, replace AC_TRY_RUN with AC_TRY_LINK or something like that. Or
> > maybe there's even a simpler autoconf macro to test if a definition
> > exists or not.
>
> the fact is, I was asked by Arnout to do it that way, and his opinion
> was that it was needed to run the snippet on the target to be sure of
> the resut. See:
> http://article.gmane.org/gmane.comp.lib.uclibc.buildroot/106055
>
> Is there something I misunderstood ? Who has the final call about this ?
I am not sure I agree with Arnout suggestion, but...
> > Also, did you submit your patch upstream?
>
> Yes I did, it has been merged into the next branch of zeromq, v4.1.x.
... since your patch has been merged upstream, I'm just fine with using
it as is.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 1/1] package/zeromq: enable kernel-based feature flags
2015-03-16 6:43 ` Lionel Orry
2015-03-16 8:05 ` Thomas Petazzoni
@ 2015-03-18 22:27 ` Arnout Vandecappelle
2015-04-21 20:47 ` Thomas Petazzoni
1 sibling, 1 reply; 14+ messages in thread
From: Arnout Vandecappelle @ 2015-03-18 22:27 UTC (permalink / raw)
To: buildroot
On 16/03/15 07:43, Lionel Orry wrote:
> Hi Thomas,
>
> On Sun, Mar 15, 2015 at 11:28 PM, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
>> Dear Lionel Orry,
>>
>> On Fri, 6 Feb 2015 10:25:52 +0100, Lionel Orry wrote:
>>> The current configuration system does not check for cached variables for
>>> these flags, and thus they are always disabled when cross-compiling.
>>> This patch fixes the configuration system to use cached variables and
>>> enables them at configuration time.
>>>
>>> Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
>>> ---
>>> ...e.m4-make-kernel-specific-flags-cacheable.patch | 204 +++++++++++++++++++++
>>> package/zeromq/zeromq.mk | 10 +
>>> 2 files changed, 214 insertions(+)
>>> create mode 100644 package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
>>
>> Thanks for this patch, and sorry for the slow response.
>>
>> However, I believe it would be a lot better to change the acinclude.m4
>> tests to not use AC_TRY_RUN, but instead to simply test if TCP_KEEPCNT,
>> TCP_KEEPIDLE, etc. exist at compile time. If they are defined in the
>> kernel headers, then you know the kernel supports them, since running a
>> kernel older than the kernel headers used in the toolchain cannot work.
>>
>> So, replace AC_TRY_RUN with AC_TRY_LINK or something like that. Or
>> maybe there's even a simpler autoconf macro to test if a definition
>> exists or not.
>
> the fact is, I was asked by Arnout to do it that way, and his opinion
> was that it was needed to run the snippet on the target to be sure of
> the resut. See:
> http://article.gmane.org/gmane.comp.lib.uclibc.buildroot/106055
>
> Is there something I misunderstood ? Who has the final call about this ?
It's been a while ago, of course, but I think one problem was that the symbols
are also defined by the toolchain, so they exist even if the kernel doesn't
support them.
Regards,
Arnout
--
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: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 1/1] package/zeromq: enable kernel-based feature flags
@ 2015-04-21 13:30 Lionel Orry
2015-04-21 13:33 ` Thomas Petazzoni
0 siblings, 1 reply; 14+ messages in thread
From: Lionel Orry @ 2015-04-21 13:30 UTC (permalink / raw)
To: buildroot
The current configuration system does not check for cached variables for
these flags, and thus they are always disabled when cross-compiling.
This patch fixes the configuration system to use cached variables and
enables them at configuration time.
Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
---
...e.m4-make-kernel-specific-flags-cacheable.patch | 204 +++++++++++++++++++++
package/zeromq/zeromq.mk | 10 +
2 files changed, 214 insertions(+)
create mode 100644 package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
diff --git a/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch b/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
new file mode 100644
index 0000000..9b6e808
--- /dev/null
+++ b/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
@@ -0,0 +1,204 @@
+From 2eee4dd2b1668124f377f6da1d511249086a1449 Mon Sep 17 00:00:00 2001
+From: Lionel Orry <lionel.orry@gmail.com>
+Date: Fri, 6 Feb 2015 09:45:21 +0100
+Subject: [PATCH 1/1] acinclude.m4: make kernel-specific flags cacheable
+
+Specifically when cross-compiling, one can be willing to force these
+variable values using the environment of a config.cache file. This
+commit makes this possible.
+
+The affected variables are:
+
+* libzmq_cv_sock_cloexec
+* libzmq_cv_so_keepalive
+* libzmq_cv_tcp_keepcnt
+* libzmq_cv_tcp_keepidle
+* libzmq_cv_tcp_keepintvl
+* libzmq_cv_tcp_keepalive
+
+Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
+---
+ acinclude.m4 | 84 ++++++++++++++++++++++++++++++++++--------------------------
+ 1 file changed, 48 insertions(+), 36 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index c5c2748..b40f0c1 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -586,8 +586,8 @@ dnl # LIBZMQ_CHECK_SOCK_CLOEXEC([action-if-found], [action-if-not-found])
+ dnl # Check if SOCK_CLOEXEC is supported #
+ dnl ################################################################################
+ AC_DEFUN([LIBZMQ_CHECK_SOCK_CLOEXEC], [{
+- AC_MSG_CHECKING(whether SOCK_CLOEXEC is supported)
+- AC_TRY_RUN([/* SOCK_CLOEXEC test */
++ AC_CACHE_CHECK([whether SOCK_CLOEXEC is supported], [libzmq_cv_sock_cloexec],
++ [AC_TRY_RUN([/* SOCK_CLOEXEC test */
+ #include <sys/types.h>
+ #include <sys/socket.h>
+
+@@ -596,11 +596,13 @@ int main (int argc, char *argv [])
+ int s = socket (PF_INET, SOCK_STREAM | SOCK_CLOEXEC, 0);
+ return (s == -1);
+ }
+- ],
+- [AC_MSG_RESULT(yes) ; libzmq_cv_sock_cloexec="yes" ; $1],
+- [AC_MSG_RESULT(no) ; libzmq_cv_sock_cloexec="no" ; $2],
+- [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_sock_cloexec="no"]
++ ],
++ [libzmq_cv_sock_cloexec="yes"],
++ [libzmq_cv_sock_cloexec="no"],
++ [libzmq_cv_sock_cloexec="not during cross-compile"]
++ )]
+ )
++ AS_IF([test "x$libzmq_cv_sock_cloexec" = "xyes"], [$1], [$2])
+ }])
+
+ dnl ################################################################################
+@@ -608,8 +610,8 @@ dnl # LIBZMQ_CHECK_SO_KEEPALIVE([action-if-found], [action-if-not-found])
+ dnl # Check if SO_KEEPALIVE is supported #
+ dnl ################################################################################
+ AC_DEFUN([LIBZMQ_CHECK_SO_KEEPALIVE], [{
+- AC_MSG_CHECKING(whether SO_KEEPALIVE is supported)
+- AC_TRY_RUN([/* SO_KEEPALIVE test */
++ AC_CACHE_CHECK([whether SO_KEEPALIVE is supported], [libzmq_cv_so_keepalive],
++ [AC_TRY_RUN([/* SO_KEEPALIVE test */
+ #include <sys/types.h>
+ #include <sys/socket.h>
+
+@@ -621,11 +623,13 @@ int main (int argc, char *argv [])
+ ((rc = setsockopt (s, SOL_SOCKET, SO_KEEPALIVE, (char*) &opt, sizeof (int))) == -1)
+ );
+ }
+- ],
+- [AC_MSG_RESULT(yes) ; libzmq_cv_so_keepalive="yes" ; $1],
+- [AC_MSG_RESULT(no) ; libzmq_cv_so_keepalive="no" ; $2],
+- [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_so_keepalive="no"]
++ ],
++ [libzmq_cv_so_keepalive="yes"],
++ [libzmq_cv_so_keepalive="no"],
++ [libzmq_cv_so_keepalive="not during cross-compile"]
++ )]
+ )
++ AS_IF([test "x$libzmq_cv_so_keepalive" = "xyes"], [$1], [$2])
+ }])
+
+ dnl ################################################################################
+@@ -633,8 +637,8 @@ dnl # LIBZMQ_CHECK_TCP_KEEPCNT([action-if-found], [action-if-not-found])
+ dnl # Check if TCP_KEEPCNT is supported #
+ dnl ################################################################################
+ AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPCNT], [{
+- AC_MSG_CHECKING(whether TCP_KEEPCNT is supported)
+- AC_TRY_RUN([/* TCP_KEEPCNT test */
++ AC_CACHE_CHECK([whether TCP_KEEPCNT is supported], [libzmq_cv_tcp_keepcnt],
++ [AC_TRY_RUN([/* TCP_KEEPCNT test */
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+@@ -649,11 +653,13 @@ int main (int argc, char *argv [])
+ ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPCNT, (char*) &opt, sizeof (int))) == -1)
+ );
+ }
+- ],
+- [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepcnt="yes" ; $1],
+- [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepcnt="no" ; $2],
+- [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepcnt="no"]
++ ],
++ [libzmq_cv_tcp_keepcnt="yes"],
++ [libzmq_cv_tcp_keepcnt="no"],
++ [libzmq_cv_tcp_keepcnt="not during cross-compile"]
++ )]
+ )
++ AS_IF([test "x$libzmq_cv_tcp_keepcnt" = "xyes"], [$1], [$2])
+ }])
+
+ dnl ################################################################################
+@@ -661,8 +667,8 @@ dnl # LIBZMQ_CHECK_TCP_KEEPIDLE([action-if-found], [action-if-not-found])
+ dnl # Check if TCP_KEEPIDLE is supported #
+ dnl ################################################################################
+ AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPIDLE], [{
+- AC_MSG_CHECKING(whether TCP_KEEPIDLE is supported)
+- AC_TRY_RUN([/* TCP_KEEPIDLE test */
++ AC_CACHE_CHECK([whether TCP_KEEPIDLE is supported], [libzmq_cv_tcp_keepidle],
++ [AC_TRY_RUN([/* TCP_KEEPIDLE test */
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+@@ -677,11 +683,13 @@ int main (int argc, char *argv [])
+ ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPIDLE, (char*) &opt, sizeof (int))) == -1)
+ );
+ }
+- ],
+- [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepidle="yes" ; $1],
+- [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepidle="no" ; $2],
+- [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepidle="no"]
++ ],
++ [libzmq_cv_tcp_keepidle="yes"],
++ [libzmq_cv_tcp_keepidle="no"],
++ [libzmq_cv_tcp_keepidle="not during cross-compile"]
++ )]
+ )
++ AS_IF([test "x$libzmq_cv_tcp_keepidle" = "xyes"], [$1], [$2])
+ }])
+
+ dnl ################################################################################
+@@ -689,8 +697,8 @@ dnl # LIBZMQ_CHECK_TCP_KEEPINTVL([action-if-found], [action-if-not-found])
+ dnl # Check if TCP_KEEPINTVL is supported #
+ dnl ################################################################################
+ AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPINTVL], [{
+- AC_MSG_CHECKING(whether TCP_KEEPINTVL is supported)
+- AC_TRY_RUN([/* TCP_KEEPINTVL test */
++ AC_CACHE_CHECK([whether TCP_KEEPINTVL is supported], [libzmq_cv_tcp_keepintvl],
++ [AC_TRY_RUN([/* TCP_KEEPINTVL test */
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+@@ -705,11 +713,13 @@ int main (int argc, char *argv [])
+ ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPINTVL, (char*) &opt, sizeof (int))) == -1)
+ );
+ }
+- ],
+- [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepintvl="yes" ; $1],
+- [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepintvl="no" ; $2],
+- [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepintvl="no"]
++ ],
++ [libzmq_cv_tcp_keepintvl="yes"],
++ [libzmq_cv_tcp_keepintvl="no"],
++ [libzmq_cv_tcp_keepintvl="not during cross-compile"]
++ )]
+ )
++ AS_IF([test "x$libzmq_cv_tcp_keepintvl" = "xyes"], [$1], [$2])
+ }])
+
+ dnl ################################################################################
+@@ -717,8 +727,8 @@ dnl # LIBZMQ_CHECK_TCP_KEEPALIVE([action-if-found], [action-if-not-found])
+ dnl # Check if TCP_KEEPALIVE is supported #
+ dnl ################################################################################
+ AC_DEFUN([LIBZMQ_CHECK_TCP_KEEPALIVE], [{
+- AC_MSG_CHECKING(whether TCP_KEEPALIVE is supported)
+- AC_TRY_RUN([/* TCP_KEEPALIVE test */
++ AC_CACHE_CHECK([whether TCP_KEEPALIVE is supported], [libzmq_cv_tcp_keepalive],
++ [AC_TRY_RUN([/* TCP_KEEPALIVE test */
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+@@ -733,11 +743,13 @@ int main (int argc, char *argv [])
+ ((rc = setsockopt (s, IPPROTO_TCP, TCP_KEEPALIVE, (char*) &opt, sizeof (int))) == -1)
+ );
+ }
+- ],
+- [AC_MSG_RESULT(yes) ; libzmq_cv_tcp_keepalive="yes" ; $1],
+- [AC_MSG_RESULT(no) ; libzmq_cv_tcp_keepalive="no" ; $2],
+- [AC_MSG_RESULT(not during cross-compile) ; libzmq_cv_tcp_keepalive="no"]
++ ],
++ [libzmq_cv_tcp_keepalive="yes"],
++ [libzmq_cv_tcp_keepalive="no"],
++ [libzmq_cv_tcp_keepalive="not during cross-compile"]
++ )]
+ )
++ AS_IF([test "x$libzmq_cv_tcp_keepalive" = "xyes"], [$1], [$2])
+ }])
+
+ dnl ################################################################################
+--
+2.1.0
+
diff --git a/package/zeromq/zeromq.mk b/package/zeromq/zeromq.mk
index dbd6fc7..aa03fc9 100644
--- a/package/zeromq/zeromq.mk
+++ b/package/zeromq/zeromq.mk
@@ -11,8 +11,18 @@ ZEROMQ_DEPENDENCIES = util-linux
ZEROMQ_LICENSE = LGPLv3+ with exceptions
ZEROMQ_LICENSE_FILES = COPYING COPYING.LESSER
# For 0001-tests-disable-test_fork-if-fork-is-not-available.patch
+# and 0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
ZEROMQ_AUTORECONF = YES
+# Assume these flags are always available. It is true, at least for
+# SOCK_CLOEXEC, since linux v2.6.27.
+# Note: the flag TCP_KEEPALIVE is NOT available so we do not include it.
+ZEROMQ_CONF_ENV = libzmq_cv_sock_cloexec=yes \
+ libzmq_cv_so_keepalive=yes \
+ libzmq_cv_tcp_keepcnt=yes \
+ libzmq_cv_tcp_keepidle=yes \
+ libzmq_cv_tcp_keepintvl=yes
+
# Only tools/curve_keygen.c needs this, but it doesn't hurt to pass it
# for the rest of the build as well (which automatically includes stdc++).
ifeq ($(BR2_STATIC_LIBS),y)
--
2.1.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 1/1] package/zeromq: enable kernel-based feature flags
2015-04-21 13:30 [Buildroot] [PATCH 1/1] package/zeromq: enable kernel-based feature flags Lionel Orry
@ 2015-04-21 13:33 ` Thomas Petazzoni
2015-04-21 13:39 ` Lionel Orry
0 siblings, 1 reply; 14+ messages in thread
From: Thomas Petazzoni @ 2015-04-21 13:33 UTC (permalink / raw)
To: buildroot
Dear Lionel Orry,
On Tue, 21 Apr 2015 15:30:19 +0200, Lionel Orry wrote:
> The current configuration system does not check for cached variables for
> these flags, and thus they are always disabled when cross-compiling.
> This patch fixes the configuration system to use cached variables and
> enables them at configuration time.
>
> Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
> ---
> ...e.m4-make-kernel-specific-flags-cacheable.patch | 204 +++++++++++++++++++++
> package/zeromq/zeromq.mk | 10 +
> 2 files changed, 214 insertions(+)
> create mode 100644 package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
>
> diff --git a/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch b/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
> new file mode 100644
> index 0000000..9b6e808
> --- /dev/null
> +++ b/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
> @@ -0,0 +1,204 @@
> +From 2eee4dd2b1668124f377f6da1d511249086a1449 Mon Sep 17 00:00:00 2001
> +From: Lionel Orry <lionel.orry@gmail.com>
> +Date: Fri, 6 Feb 2015 09:45:21 +0100
> +Subject: [PATCH 1/1] acinclude.m4: make kernel-specific flags cacheable
> +
> +Specifically when cross-compiling, one can be willing to force these
> +variable values using the environment of a config.cache file. This
> +commit makes this possible.
> +
> +The affected variables are:
> +
> +* libzmq_cv_sock_cloexec
> +* libzmq_cv_so_keepalive
> +* libzmq_cv_tcp_keepcnt
> +* libzmq_cv_tcp_keepidle
> +* libzmq_cv_tcp_keepintvl
> +* libzmq_cv_tcp_keepalive
> +
> +Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
Could you state whether this patch is upstream or not?
> +# Assume these flags are always available. It is true, at least for
> +# SOCK_CLOEXEC, since linux v2.6.27.
> +# Note: the flag TCP_KEEPALIVE is NOT available so we do not include it.
> +ZEROMQ_CONF_ENV = libzmq_cv_sock_cloexec=yes \
> + libzmq_cv_so_keepalive=yes \
Only one tab for indentation on continuation lines.
Also, I must say I still don't quite understand why an AC_TRY_RUN() is
needed here. Isn't an AC_TRY_LINK() to test if the relevant flags
exists sufficient?
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 1/1] package/zeromq: enable kernel-based feature flags
2015-04-21 13:33 ` Thomas Petazzoni
@ 2015-04-21 13:39 ` Lionel Orry
2015-04-21 20:19 ` Arnout Vandecappelle
2015-04-22 5:54 ` Lionel Orry
0 siblings, 2 replies; 14+ messages in thread
From: Lionel Orry @ 2015-04-21 13:39 UTC (permalink / raw)
To: buildroot
Hello,
On Tue, Apr 21, 2015 at 3:33 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Dear Lionel Orry,
>
> On Tue, 21 Apr 2015 15:30:19 +0200, Lionel Orry wrote:
>> The current configuration system does not check for cached variables for
>> these flags, and thus they are always disabled when cross-compiling.
>> This patch fixes the configuration system to use cached variables and
>> enables them at configuration time.
>>
>> Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
>> ---
>> ...e.m4-make-kernel-specific-flags-cacheable.patch | 204 +++++++++++++++++++++
>> package/zeromq/zeromq.mk | 10 +
>> 2 files changed, 214 insertions(+)
>> create mode 100644 package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
>>
>> diff --git a/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch b/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
>> new file mode 100644
>> index 0000000..9b6e808
>> --- /dev/null
>> +++ b/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
>> @@ -0,0 +1,204 @@
>> +From 2eee4dd2b1668124f377f6da1d511249086a1449 Mon Sep 17 00:00:00 2001
>> +From: Lionel Orry <lionel.orry@gmail.com>
>> +Date: Fri, 6 Feb 2015 09:45:21 +0100
>> +Subject: [PATCH 1/1] acinclude.m4: make kernel-specific flags cacheable
>> +
>> +Specifically when cross-compiling, one can be willing to force these
>> +variable values using the environment of a config.cache file. This
>> +commit makes this possible.
>> +
>> +The affected variables are:
>> +
>> +* libzmq_cv_sock_cloexec
>> +* libzmq_cv_so_keepalive
>> +* libzmq_cv_tcp_keepcnt
>> +* libzmq_cv_tcp_keepidle
>> +* libzmq_cv_tcp_keepintvl
>> +* libzmq_cv_tcp_keepalive
>> +
>> +Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
>
> Could you state whether this patch is upstream or not?
This patch is upstream in v4.1.x branch, so it will be included
upstream as soon as zeromq v4.1.0 is released.
>
>> +# Assume these flags are always available. It is true, at least for
>> +# SOCK_CLOEXEC, since linux v2.6.27.
>> +# Note: the flag TCP_KEEPALIVE is NOT available so we do not include it.
>> +ZEROMQ_CONF_ENV = libzmq_cv_sock_cloexec=yes \
>> + libzmq_cv_so_keepalive=yes \
>
> Only one tab for indentation on continuation lines.
Will correct.
>
> Also, I must say I still don't quite understand why an AC_TRY_RUN() is
> needed here. Isn't an AC_TRY_LINK() to test if the relevant flags
> exists sufficient?
Arnout stated something about it:
http://article.gmane.org/gmane.comp.lib.uclibc.buildroot/110044
What do you think about it ?
>
> Thanks,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
Regards,
Lionel
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 1/1] package/zeromq: enable kernel-based feature flags
2015-04-21 13:39 ` Lionel Orry
@ 2015-04-21 20:19 ` Arnout Vandecappelle
2015-04-22 6:01 ` Lionel Orry
2015-04-22 5:54 ` Lionel Orry
1 sibling, 1 reply; 14+ messages in thread
From: Arnout Vandecappelle @ 2015-04-21 20:19 UTC (permalink / raw)
To: buildroot
On 21/04/15 15:39, Lionel Orry wrote:
> Hello,
>
> On Tue, Apr 21, 2015 at 3:33 PM, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
>> Dear Lionel Orry,
>>
>> On Tue, 21 Apr 2015 15:30:19 +0200, Lionel Orry wrote:
>>> The current configuration system does not check for cached variables for
>>> these flags, and thus they are always disabled when cross-compiling.
>>> This patch fixes the configuration system to use cached variables and
>>> enables them at configuration time.
>>>
>>> Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
>>> ---
>>> ...e.m4-make-kernel-specific-flags-cacheable.patch | 204 +++++++++++++++++++++
>>> package/zeromq/zeromq.mk | 10 +
>>> 2 files changed, 214 insertions(+)
>>> create mode 100644 package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
>>>
>>> diff --git a/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch b/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
>>> new file mode 100644
>>> index 0000000..9b6e808
>>> --- /dev/null
>>> +++ b/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
>>> @@ -0,0 +1,204 @@
>>> +From 2eee4dd2b1668124f377f6da1d511249086a1449 Mon Sep 17 00:00:00 2001
>>> +From: Lionel Orry <lionel.orry@gmail.com>
>>> +Date: Fri, 6 Feb 2015 09:45:21 +0100
>>> +Subject: [PATCH 1/1] acinclude.m4: make kernel-specific flags cacheable
>>> +
>>> +Specifically when cross-compiling, one can be willing to force these
>>> +variable values using the environment of a config.cache file. This
>>> +commit makes this possible.
>>> +
>>> +The affected variables are:
>>> +
>>> +* libzmq_cv_sock_cloexec
>>> +* libzmq_cv_so_keepalive
>>> +* libzmq_cv_tcp_keepcnt
>>> +* libzmq_cv_tcp_keepidle
>>> +* libzmq_cv_tcp_keepintvl
>>> +* libzmq_cv_tcp_keepalive
>>> +
>>> +Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
>>
>> Could you state whether this patch is upstream or not?
>
> This patch is upstream in v4.1.x branch, so it will be included
> upstream as soon as zeromq v4.1.0 is released.
If the patch is already upstream, and the upstream patch applies cleanly,
please use the upstream patch instead (adding you Sob if necessary and adding a
reference to the upstream commit sha). If the upstream patch does not apply
cleanly you can keep using this custom patch, but please still add a reference
to the upstream sha.
Regards,
Arnout
[snip]
--
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: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 1/1] package/zeromq: enable kernel-based feature flags
2015-03-18 22:27 ` Arnout Vandecappelle
@ 2015-04-21 20:47 ` Thomas Petazzoni
2015-04-21 21:48 ` Arnout Vandecappelle
0 siblings, 1 reply; 14+ messages in thread
From: Thomas Petazzoni @ 2015-04-21 20:47 UTC (permalink / raw)
To: buildroot
Dear Arnout Vandecappelle,
On Wed, 18 Mar 2015 23:27:55 +0100, Arnout Vandecappelle wrote:
> It's been a while ago, of course, but I think one problem was that the symbols
> are also defined by the toolchain, so they exist even if the kernel doesn't
> support them.
If the flags exist in the toolchain, then it means that the toolchain
is using a certain version of the kernel headers. Running with a kernel
older than that will anyway not work.
I mean, there are zillions of configure script that tests if the
toolchain has syscall foo() or bar() by simply doing a compile time
test. They don't actually check if the user is stupid enough to run on
a system that has a kernel older than the kernel headers + C library
combination used in the toolchain.
Or am I missing something specific to those flags?
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 1/1] package/zeromq: enable kernel-based feature flags
2015-04-21 20:47 ` Thomas Petazzoni
@ 2015-04-21 21:48 ` Arnout Vandecappelle
0 siblings, 0 replies; 14+ messages in thread
From: Arnout Vandecappelle @ 2015-04-21 21:48 UTC (permalink / raw)
To: buildroot
On 21/04/15 22:47, Thomas Petazzoni wrote:
> Dear Arnout Vandecappelle,
>
> On Wed, 18 Mar 2015 23:27:55 +0100, Arnout Vandecappelle wrote:
>
>> It's been a while ago, of course, but I think one problem was that the symbols
>> are also defined by the toolchain, so they exist even if the kernel doesn't
>> support them.
>
> If the flags exist in the toolchain, then it means that the toolchain
> is using a certain version of the kernel headers. Running with a kernel
> older than that will anyway not work.
>
> I mean, there are zillions of configure script that tests if the
> toolchain has syscall foo() or bar() by simply doing a compile time
> test. They don't actually check if the user is stupid enough to run on
> a system that has a kernel older than the kernel headers + C library
> combination used in the toolchain.
>
> Or am I missing something specific to those flags?
They are not syscalls but flags which are defined in <netinet/tcp.h>, which (at
least for uClibc) is copied verbatim from libc to the sysroot. So AFAICS the
libc doesn't actually check if it is really available in the kernel. Possibly
the kernels that didn't support these flags already defined (and ignored) them.
Regards,
Arnout
--
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: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 1/1] package/zeromq: enable kernel-based feature flags
2015-04-21 13:39 ` Lionel Orry
2015-04-21 20:19 ` Arnout Vandecappelle
@ 2015-04-22 5:54 ` Lionel Orry
1 sibling, 0 replies; 14+ messages in thread
From: Lionel Orry @ 2015-04-22 5:54 UTC (permalink / raw)
To: buildroot
Hi all,
On Tue, Apr 21, 2015 at 3:39 PM, Lionel Orry <lionel.orry@gmail.com> wrote:
> Hello,
>
> On Tue, Apr 21, 2015 at 3:33 PM, Thomas Petazzoni
> <thomas.petazzoni@free-electrons.com> wrote:
>> Dear Lionel Orry,
>>
>> On Tue, 21 Apr 2015 15:30:19 +0200, Lionel Orry wrote:
>>> The current configuration system does not check for cached variables for
>>> these flags, and thus they are always disabled when cross-compiling.
>>> This patch fixes the configuration system to use cached variables and
>>> enables them at configuration time.
>>>
>>> Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
>>> ---
>>> ...e.m4-make-kernel-specific-flags-cacheable.patch | 204 +++++++++++++++++++++
>>> package/zeromq/zeromq.mk | 10 +
>>> 2 files changed, 214 insertions(+)
>>> create mode 100644 package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
>>>
>>> diff --git a/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch b/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
>>> new file mode 100644
>>> index 0000000..9b6e808
>>> --- /dev/null
>>> +++ b/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
>>> @@ -0,0 +1,204 @@
>>> +From 2eee4dd2b1668124f377f6da1d511249086a1449 Mon Sep 17 00:00:00 2001
>>> +From: Lionel Orry <lionel.orry@gmail.com>
>>> +Date: Fri, 6 Feb 2015 09:45:21 +0100
>>> +Subject: [PATCH 1/1] acinclude.m4: make kernel-specific flags cacheable
>>> +
>>> +Specifically when cross-compiling, one can be willing to force these
>>> +variable values using the environment of a config.cache file. This
>>> +commit makes this possible.
>>> +
>>> +The affected variables are:
>>> +
>>> +* libzmq_cv_sock_cloexec
>>> +* libzmq_cv_so_keepalive
>>> +* libzmq_cv_tcp_keepcnt
>>> +* libzmq_cv_tcp_keepidle
>>> +* libzmq_cv_tcp_keepintvl
>>> +* libzmq_cv_tcp_keepalive
>>> +
>>> +Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
>>
>> Could you state whether this patch is upstream or not?
>
> This patch is upstream in v4.1.x branch, so it will be included
> upstream as soon as zeromq v4.1.0 is released.
>
My bad, I made a mistake here : not v4.1.x branch, but master branch
of libzmq which will become v4.2.x branch.
So it will not be included before v4.2.0 is released.
Sorry for the typo...
>>
>>> +# Assume these flags are always available. It is true, at least for
>>> +# SOCK_CLOEXEC, since linux v2.6.27.
>>> +# Note: the flag TCP_KEEPALIVE is NOT available so we do not include it.
>>> +ZEROMQ_CONF_ENV = libzmq_cv_sock_cloexec=yes \
>>> + libzmq_cv_so_keepalive=yes \
>>
>> Only one tab for indentation on continuation lines.
>
> Will correct.
>
>>
>> Also, I must say I still don't quite understand why an AC_TRY_RUN() is
>> needed here. Isn't an AC_TRY_LINK() to test if the relevant flags
>> exists sufficient?
>
> Arnout stated something about it:
> http://article.gmane.org/gmane.comp.lib.uclibc.buildroot/110044
>
> What do you think about it ?
>
>>
>> Thanks,
>>
>> Thomas
>> --
>> Thomas Petazzoni, CTO, Free Electrons
>> Embedded Linux, Kernel and Android engineering
>> http://free-electrons.com
>
> Regards,
> Lionel
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 1/1] package/zeromq: enable kernel-based feature flags
2015-04-21 20:19 ` Arnout Vandecappelle
@ 2015-04-22 6:01 ` Lionel Orry
2015-04-22 7:38 ` Thomas Petazzoni
0 siblings, 1 reply; 14+ messages in thread
From: Lionel Orry @ 2015-04-22 6:01 UTC (permalink / raw)
To: buildroot
Hi Arnout,
On Tue, Apr 21, 2015 at 10:19 PM, Arnout Vandecappelle <arnout@mind.be> wrote:
> On 21/04/15 15:39, Lionel Orry wrote:
>> Hello,
>>
>> On Tue, Apr 21, 2015 at 3:33 PM, Thomas Petazzoni
>> <thomas.petazzoni@free-electrons.com> wrote:
>>> Dear Lionel Orry,
>>>
>>> On Tue, 21 Apr 2015 15:30:19 +0200, Lionel Orry wrote:
>>>> The current configuration system does not check for cached variables for
>>>> these flags, and thus they are always disabled when cross-compiling.
>>>> This patch fixes the configuration system to use cached variables and
>>>> enables them at configuration time.
>>>>
>>>> Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
>>>> ---
>>>> ...e.m4-make-kernel-specific-flags-cacheable.patch | 204 +++++++++++++++++++++
>>>> package/zeromq/zeromq.mk | 10 +
>>>> 2 files changed, 214 insertions(+)
>>>> create mode 100644 package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
>>>>
>>>> diff --git a/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch b/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
>>>> new file mode 100644
>>>> index 0000000..9b6e808
>>>> --- /dev/null
>>>> +++ b/package/zeromq/0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
>>>> @@ -0,0 +1,204 @@
>>>> +From 2eee4dd2b1668124f377f6da1d511249086a1449 Mon Sep 17 00:00:00 2001
>>>> +From: Lionel Orry <lionel.orry@gmail.com>
>>>> +Date: Fri, 6 Feb 2015 09:45:21 +0100
>>>> +Subject: [PATCH 1/1] acinclude.m4: make kernel-specific flags cacheable
>>>> +
>>>> +Specifically when cross-compiling, one can be willing to force these
>>>> +variable values using the environment of a config.cache file. This
>>>> +commit makes this possible.
>>>> +
>>>> +The affected variables are:
>>>> +
>>>> +* libzmq_cv_sock_cloexec
>>>> +* libzmq_cv_so_keepalive
>>>> +* libzmq_cv_tcp_keepcnt
>>>> +* libzmq_cv_tcp_keepidle
>>>> +* libzmq_cv_tcp_keepintvl
>>>> +* libzmq_cv_tcp_keepalive
>>>> +
>>>> +Signed-off-by: Lionel Orry <lionel.orry@gmail.com>
>>>
>>> Could you state whether this patch is upstream or not?
>>
>> This patch is upstream in v4.1.x branch, so it will be included
>> upstream as soon as zeromq v4.1.0 is released.
>
> If the patch is already upstream, and the upstream patch applies cleanly,
> please use the upstream patch instead (adding you Sob if necessary and adding a
> reference to the upstream commit sha). If the upstream patch does not apply
> cleanly you can keep using this custom patch, but please still add a reference
> to the upstream sha.
It applies successfully, with a 20 lines offset. Should I use the
upstream patch in these conditions ?
Another question, how do I make a proper buildroot patch file from a
cmmit ? Is there a recommended way ?
I did, on libzmq repository:
git show 9daf6 > 0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
And tested this patch. Is this correct ?
>
>
> Regards,
> Arnout
>
> [snip]
>
> --
> 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: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Buildroot] [PATCH 1/1] package/zeromq: enable kernel-based feature flags
2015-04-22 6:01 ` Lionel Orry
@ 2015-04-22 7:38 ` Thomas Petazzoni
0 siblings, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2015-04-22 7:38 UTC (permalink / raw)
To: buildroot
Dear Lionel Orry,
On Wed, 22 Apr 2015 08:01:50 +0200, Lionel Orry wrote:
> I did, on libzmq repository:
>
> git show 9daf6 > 0002-acinclude.m4-make-kernel-specific-flags-cacheable.patch
>
> And tested this patch. Is this correct ?
Yes, this is OK. You could also do something like:
git checkout -b buildroot 4.0.5
git cherry-pick 9daf6
git format-patch HEAD^
This will "rebase" the patch on top of 4.0.5, which will allow to avoid
the 20 lines offset. You can also edit the patch to add the upstream
commit ID.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2015-04-22 7:38 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-21 13:30 [Buildroot] [PATCH 1/1] package/zeromq: enable kernel-based feature flags Lionel Orry
2015-04-21 13:33 ` Thomas Petazzoni
2015-04-21 13:39 ` Lionel Orry
2015-04-21 20:19 ` Arnout Vandecappelle
2015-04-22 6:01 ` Lionel Orry
2015-04-22 7:38 ` Thomas Petazzoni
2015-04-22 5:54 ` Lionel Orry
-- strict thread matches above, loose matches on Subject: below --
2015-02-06 9:25 Lionel Orry
2015-03-15 22:28 ` Thomas Petazzoni
2015-03-16 6:43 ` Lionel Orry
2015-03-16 8:05 ` Thomas Petazzoni
2015-03-18 22:27 ` Arnout Vandecappelle
2015-04-21 20:47 ` Thomas Petazzoni
2015-04-21 21:48 ` Arnout Vandecappelle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox