diff mbox series

[morty,RESEND] gnutls_3.5.3.bb: Fix native build on distro with kernel < 3.4.17

Message ID 1512175057-78-1-git-send-email-Martin.Jansa@gmail.com
State Superseded
Headers show
Series [morty,RESEND] gnutls_3.5.3.bb: Fix native build on distro with kernel < 3.4.17 | expand

Commit Message

Martin Jansa Dec. 2, 2017, 12:37 a.m. UTC
From: Khem Raj <raj.khem@gmail.com>


When using distros which use old kernels gnutls fails to build
due to missing SYS_getrandom, therefore we need to check for this
before using it.
Fixes errorr e.g.

| ../../../gnutls-3.5.3/lib/nettle/rnd-linux.c: In function 'have_getrandom':
| ../../../gnutls-3.5.3/lib/nettle/rnd-linux.c:59:42: error: 'SYS_getrandom' undeclared (first use in this function)
|  #  define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst, (size_t)s, (unsigned int)flags)

Signed-off-by: Khem Raj <raj.khem@gmail.com>

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>

---
 .../gnutls/gnutls/check_SYS_getrandom.patch        | 35 ++++++++++++++++++++++
 meta/recipes-support/gnutls/gnutls_3.5.3.bb        |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 meta/recipes-support/gnutls/gnutls/check_SYS_getrandom.patch

-- 
2.7.4

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Comments

Martin Jansa Jan. 15, 2018, 8:14 a.m. UTC | #1
ping

On Sat, Dec 2, 2017 at 1:37 AM, Martin Jansa <martin.jansa@gmail.com> wrote:

> From: Khem Raj <raj.khem@gmail.com>

>

> When using distros which use old kernels gnutls fails to build

> due to missing SYS_getrandom, therefore we need to check for this

> before using it.

> Fixes errorr e.g.

>

> | ../../../gnutls-3.5.3/lib/nettle/rnd-linux.c: In function

> 'have_getrandom':

> | ../../../gnutls-3.5.3/lib/nettle/rnd-linux.c:59:42: error:

> 'SYS_getrandom' undeclared (first use in this function)

> |  #  define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst,

> (size_t)s, (unsigned int)flags)

>

> Signed-off-by: Khem Raj <raj.khem@gmail.com>

> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>

> ---

>  .../gnutls/gnutls/check_SYS_getrandom.patch        | 35

> ++++++++++++++++++++++

>  meta/recipes-support/gnutls/gnutls_3.5.3.bb        |  1 +

>  2 files changed, 36 insertions(+)

>  create mode 100644 meta/recipes-support/gnutls/

> gnutls/check_SYS_getrandom.patch

>

> diff --git a/meta/recipes-support/gnutls/gnutls/check_SYS_getrandom.patch

> b/meta/recipes-support/gnutls/gnutls/check_SYS_getrandom.patch

> new file mode 100644

> index 0000000..535c22a

> --- /dev/null

> +++ b/meta/recipes-support/gnutls/gnutls/check_SYS_getrandom.patch

> @@ -0,0 +1,35 @@

> +From f26c3979ab0325edb2e410d287bc501cf00e0ac0 Mon Sep 17 00:00:00 2001

> +From: Nikos Mavrogiannopoulos <nmav@redhat.com>

> +Date: Mon, 22 Aug 2016 16:32:34 +0200

> +Subject: [PATCH] rnd-linux: added check for SYS_getrandom being defined

> +

> +This allows to compile the getrandom() code in old Linux systems

> +which do not have the system call defined.

> +---

> +

> +Upstream-Status: Backport

> +Signed-off-by: Khem Raj <raj.khem@gmail.com>

> +

> + lib/nettle/rnd-linux.c | 6 +++++-

> + 1 file changed, 5 insertions(+), 1 deletion(-)

> +

> +diff --git a/lib/nettle/rnd-linux.c b/lib/nettle/rnd-linux.c

> +index d7f07a6..7a24d05 100644

> +--- a/lib/nettle/rnd-linux.c

> ++++ b/lib/nettle/rnd-linux.c

> +@@ -56,7 +56,11 @@ static dev_t _gnutls_urandom_fd_rdev = 0;

> + # else

> + #  include <sys/syscall.h>

> + #  undef getrandom

> +-#  define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst,

> (size_t)s, (unsigned int)flags)

> ++#  if defined(SYS_getrandom)

> ++#   define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst,

> (size_t)s, (unsigned int)flags)

> ++#  else

> ++#   define getrandom(dst,s,flags) -1

> ++#  endif

> + # endif

> +

> + static unsigned have_getrandom(void)

> +--

> +libgit2 0.24.0

> +

> diff --git a/meta/recipes-support/gnutls/gnutls_3.5.3.bb

> b/meta/recipes-support/gnutls/gnutls_3.5.3.bb

> index b2dbb07..0400588 100644

> --- a/meta/recipes-support/gnutls/gnutls_3.5.3.bb

> +++ b/meta/recipes-support/gnutls/gnutls_3.5.3.bb

> @@ -4,6 +4,7 @@ SRC_URI += "file://correct_rpl_gettimeofday_signature.patch

> \

>              file://0001-configure.ac-fix-sed-command.patch \

>              file://use-pkg-config-to-locate-zlib.patch \

>              file://0001-Use-correct-include-dir-with-minitasn.patch \

> +            file://check_SYS_getrandom.patch \

>              file://CVE-2016-7444.patch \

>             "

>  SRC_URI[md5sum] = "6c2c7f40ddf52933ee3ca474cb8cb63c"

> --

> 2.7.4

>

>
<div dir="ltr">ping</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 2, 2017 at 1:37 AM, Martin Jansa <span dir="ltr">&lt;<a href="mailto:martin.jansa@gmail.com" target="_blank">martin.jansa@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Khem Raj &lt;<a href="mailto:raj.khem@gmail.com">raj.khem@gmail.com</a>&gt;<br>
<br>
When using distros which use old kernels gnutls fails to build<br>
due to missing SYS_getrandom, therefore we need to check for this<br>
before using it.<br>
Fixes errorr e.g.<br>
<br>
| ../../../gnutls-3.5.3/lib/<wbr>nettle/rnd-linux.c: In function &#39;have_getrandom&#39;:<br>
| ../../../gnutls-3.5.3/lib/<wbr>nettle/rnd-linux.c:59:42: error: &#39;SYS_getrandom&#39; undeclared (first use in this function)<br>
|  #  define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst, (size_t)s, (unsigned int)flags)<br>
<br>
Signed-off-by: Khem Raj &lt;<a href="mailto:raj.khem@gmail.com">raj.khem@gmail.com</a>&gt;<br>

Signed-off-by: Martin Jansa &lt;<a href="mailto:Martin.Jansa@gmail.com">Martin.Jansa@gmail.com</a>&gt;<br>

---<br>
 .../gnutls/gnutls/check_SYS_<wbr>getrandom.patch        | 35 ++++++++++++++++++++++<br>
 meta/recipes-support/gnutls/<a href="http://gnutls_3.5.3.bb" rel="noreferrer" target="_blank">gn<wbr>utls_3.5.3.bb</a>        |  1 +<br>
 2 files changed, 36 insertions(+)<br>
 create mode 100644 meta/recipes-support/gnutls/<wbr>gnutls/check_SYS_getrandom.<wbr>patch<br>
<br>
diff --git a/meta/recipes-support/gnutls/<wbr>gnutls/check_SYS_getrandom.<wbr>patch b/meta/recipes-support/gnutls/<wbr>gnutls/check_SYS_getrandom.<wbr>patch<br>
new file mode 100644<br>
index 0000000..535c22a<br>
--- /dev/null<br>
+++ b/meta/recipes-support/gnutls/<wbr>gnutls/check_SYS_getrandom.<wbr>patch<br>
@@ -0,0 +1,35 @@<br>
+From f26c3979ab0325edb2e410d287bc50<wbr>1cf00e0ac0 Mon Sep 17 00:00:00 2001<br>
+From: Nikos Mavrogiannopoulos &lt;<a href="mailto:nmav@redhat.com">nmav@redhat.com</a>&gt;<br>
+Date: Mon, 22 Aug 2016 16:32:34 +0200<br>
+Subject: [PATCH] rnd-linux: added check for SYS_getrandom being defined<br>
+<br>
+This allows to compile the getrandom() code in old Linux systems<br>
+which do not have the system call defined.<br>
+---<br>
+<br>
+Upstream-Status: Backport<br>
+Signed-off-by: Khem Raj &lt;<a href="mailto:raj.khem@gmail.com">raj.khem@gmail.com</a>&gt;<br>
+<br>
+ lib/nettle/rnd-linux.c | 6 +++++-<br>
+ 1 file changed, 5 insertions(+), 1 deletion(-)<br>
+<br>
+diff --git a/lib/nettle/rnd-linux.c b/lib/nettle/rnd-linux.c<br>
+index d7f07a6..7a24d05 100644<br>
+--- a/lib/nettle/rnd-linux.c<br>
++++ b/lib/nettle/rnd-linux.c<br>
+@@ -56,7 +56,11 @@ static dev_t _gnutls_urandom_fd_rdev = 0;<br>
+ # else<br>
+ #  include &lt;sys/syscall.h&gt;<br>
+ #  undef getrandom<br>
+-#  define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst, (size_t)s, (unsigned int)flags)<br>
++#  if defined(SYS_getrandom)<br>
++#   define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst, (size_t)s, (unsigned int)flags)<br>
++#  else<br>
++#   define getrandom(dst,s,flags) -1<br>
++#  endif<br>
+ # endif<br>
+<br>
+ static unsigned have_getrandom(void)<br>
+--<br>
+libgit2 0.24.0<br>
+<br>
diff --git a/meta/recipes-support/gnutls/<a href="http://gnutls_3.5.3.bb" rel="noreferrer" target="_blank"><wbr>gnutls_3.5.3.bb</a> b/meta/recipes-support/gnutls/<a href="http://gnutls_3.5.3.bb" rel="noreferrer" target="_blank"><wbr>gnutls_3.5.3.bb</a><br>
index b2dbb07..0400588 100644<br>
--- a/meta/recipes-support/gnutls/<a href="http://gnutls_3.5.3.bb" rel="noreferrer" target="_blank"><wbr>gnutls_3.5.3.bb</a><br>
+++ b/meta/recipes-support/gnutls/<a href="http://gnutls_3.5.3.bb" rel="noreferrer" target="_blank"><wbr>gnutls_3.5.3.bb</a><br>
@@ -4,6 +4,7 @@ SRC_URI += &quot;file://correct_rpl_<wbr>gettimeofday_signature.patch \<br>
             file://0001-configure.ac-fix-<wbr>sed-command.patch \<br>
             file://use-pkg-config-to-<wbr>locate-zlib.patch \<br>
             file://0001-Use-correct-<wbr>include-dir-with-minitasn.<wbr>patch \<br>
+            file://check_SYS_getrandom.<wbr>patch \<br>
             file://CVE-2016-7444.patch \<br>
            &quot;<br>
 SRC_URI[md5sum] = &quot;<wbr>6c2c7f40ddf52933ee3ca474cb8cb6<wbr>3c&quot;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.7.4<br>
<br>
</font></span></blockquote></div><br></div>
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Armin Kuster Jan. 17, 2018, 7:06 p.m. UTC | #2
On 01/15/2018 12:14 AM, Martin Jansa wrote:
> ping

>

> On Sat, Dec 2, 2017 at 1:37 AM, Martin Jansa <martin.jansa@gmail.com

> <mailto:martin.jansa@gmail.com>> wrote:

>

>     From: Khem Raj <raj.khem@gmail.com <mailto:raj.khem@gmail.com>>

>


pick up now for stagging.
armin
>

>

>     When using distros which use old kernels gnutls fails to build

>     due to missing SYS_getrandom, therefore we need to check for this

>     before using it.

>     Fixes errorr e.g.

>

>     | ../../../gnutls-3.5.3/lib/nettle/rnd-linux.c: In function

>     'have_getrandom':

>     | ../../../gnutls-3.5.3/lib/nettle/rnd-linux.c:59:42: error:

>     'SYS_getrandom' undeclared (first use in this function)

>     |  #  define getrandom(dst,s,flags) syscall(SYS_getrandom,

>     (void*)dst, (size_t)s, (unsigned int)flags)

>

>     Signed-off-by: Khem Raj <raj.khem@gmail.com

>     <mailto:raj.khem@gmail.com>>

>     Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com

>     <mailto:Martin.Jansa@gmail.com>>

>     ---

>      .../gnutls/gnutls/check_SYS_getrandom.patch        | 35

>     ++++++++++++++++++++++

>      meta/recipes-support/gnutls/gnutls_3.5.3.bb

>     <http://gnutls_3.5.3.bb>        |  1 +

>      2 files changed, 36 insertions(+)

>      create mode 100644

>     meta/recipes-support/gnutls/gnutls/check_SYS_getrandom.patch

>

>     diff --git

>     a/meta/recipes-support/gnutls/gnutls/check_SYS_getrandom.patch

>     b/meta/recipes-support/gnutls/gnutls/check_SYS_getrandom.patch

>     new file mode 100644

>     index 0000000..535c22a

>     --- /dev/null

>     +++ b/meta/recipes-support/gnutls/gnutls/check_SYS_getrandom.patch

>     @@ -0,0 +1,35 @@

>     +From f26c3979ab0325edb2e410d287bc501cf00e0ac0 Mon Sep 17 00:00:00

>     2001

>     +From: Nikos Mavrogiannopoulos <nmav@redhat.com

>     <mailto:nmav@redhat.com>>

>     +Date: Mon, 22 Aug 2016 16:32:34 +0200

>     +Subject: [PATCH] rnd-linux: added check for SYS_getrandom being

>     defined

>     +

>     +This allows to compile the getrandom() code in old Linux systems

>     +which do not have the system call defined.

>     +---

>     +

>     +Upstream-Status: Backport

>     +Signed-off-by: Khem Raj <raj.khem@gmail.com

>     <mailto:raj.khem@gmail.com>>

>     +

>     + lib/nettle/rnd-linux.c | 6 +++++-

>     + 1 file changed, 5 insertions(+), 1 deletion(-)

>     +

>     +diff --git a/lib/nettle/rnd-linux.c b/lib/nettle/rnd-linux.c

>     +index d7f07a6..7a24d05 100644

>     +--- a/lib/nettle/rnd-linux.c

>     ++++ b/lib/nettle/rnd-linux.c

>     +@@ -56,7 +56,11 @@ static dev_t _gnutls_urandom_fd_rdev = 0;

>     + # else

>     + #  include <sys/syscall.h>

>     + #  undef getrandom

>     +-#  define getrandom(dst,s,flags) syscall(SYS_getrandom,

>     (void*)dst, (size_t)s, (unsigned int)flags)

>     ++#  if defined(SYS_getrandom)

>     ++#   define getrandom(dst,s,flags) syscall(SYS_getrandom,

>     (void*)dst, (size_t)s, (unsigned int)flags)

>     ++#  else

>     ++#   define getrandom(dst,s,flags) -1

>     ++#  endif

>     + # endif

>     +

>     + static unsigned have_getrandom(void)

>     +--

>     +libgit2 0.24.0

>     +

>     diff --git a/meta/recipes-support/gnutls/gnutls_3.5.3.bb

>     <http://gnutls_3.5.3.bb>

>     b/meta/recipes-support/gnutls/gnutls_3.5.3.bb <http://gnutls_3.5.3.bb>

>     index b2dbb07..0400588 100644

>     --- a/meta/recipes-support/gnutls/gnutls_3.5.3.bb

>     <http://gnutls_3.5.3.bb>

>     +++ b/meta/recipes-support/gnutls/gnutls_3.5.3.bb

>     <http://gnutls_3.5.3.bb>

>     @@ -4,6 +4,7 @@ SRC_URI +=

>     "file://correct_rpl_gettimeofday_signature.patch \

>                  file://0001-configure.ac-fix-sed-command.patch \

>                  file://use-pkg-config-to-locate-zlib.patch \

>                  file://0001-Use-correct-include-dir-with-minitasn.patch \

>     +            file://check_SYS_getrandom.patch \

>                  file://CVE-2016-7444.patch \

>                 "

>      SRC_URI[md5sum] = "6c2c7f40ddf52933ee3ca474cb8cb63c"

>     --

>     2.7.4

>

>

>

>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 01/15/2018 12:14 AM, Martin Jansa
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CA+chaQcbgVU+=f5Yg6QrJ0fQyY4LZU3hFAs4L+gw+HVq4sk35w@mail.gmail.com">
      <div dir="ltr">ping</div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Sat, Dec 2, 2017 at 1:37 AM, Martin
          Jansa <span dir="ltr">&lt;<a
              href="mailto:martin.jansa@gmail.com" target="_blank"
              moz-do-not-send="true">martin.jansa@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Khem
            Raj &lt;<a href="mailto:raj.khem@gmail.com"
              moz-do-not-send="true">raj.khem@gmail.com</a>&gt;<br>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br>
    pick up now for stagging.<br>
    armin<br>
    <blockquote type="cite"
cite="mid:CA+chaQcbgVU+=f5Yg6QrJ0fQyY4LZU3hFAs4L+gw+HVq4sk35w@mail.gmail.com">
      <div class="gmail_extra">
        <div class="gmail_quote">
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <br>
            When using distros which use old kernels gnutls fails to
            build<br>
            due to missing SYS_getrandom, therefore we need to check for
            this<br>
            before using it.<br>
            Fixes errorr e.g.<br>
            <br>
            | ../../../gnutls-3.5.3/lib/<wbr>nettle/rnd-linux.c: In
            function 'have_getrandom':<br>
            | ../../../gnutls-3.5.3/lib/<wbr>nettle/rnd-linux.c:59:42:
            error: 'SYS_getrandom' undeclared (first use in this
            function)<br>
            |  #  define getrandom(dst,s,flags) syscall(SYS_getrandom,
            (void*)dst, (size_t)s, (unsigned int)flags)<br>
            <br>
            Signed-off-by: Khem Raj &lt;<a

              href="mailto:raj.khem@gmail.com" moz-do-not-send="true">raj.khem@gmail.com</a>&gt;<br>
            Signed-off-by: Martin Jansa &lt;<a

              href="mailto:Martin.Jansa@gmail.com"
              moz-do-not-send="true">Martin.Jansa@gmail.com</a>&gt;<br>
            ---<br>
             .../gnutls/gnutls/check_SYS_<wbr>getrandom.patch        |
            35 ++++++++++++++++++++++<br>
             meta/recipes-support/gnutls/<a
              href="http://gnutls_3.5.3.bb" rel="noreferrer"
              target="_blank" moz-do-not-send="true">gn<wbr>utls_3.5.3.bb</a> 
                  |  1 +<br>
             2 files changed, 36 insertions(+)<br>
             create mode 100644 meta/recipes-support/gnutls/<wbr>gnutls/check_SYS_getrandom.<wbr>patch<br>
            <br>
            diff --git a/meta/recipes-support/gnutls/<wbr>gnutls/check_SYS_getrandom.<wbr>patch
            b/meta/recipes-support/gnutls/<wbr>gnutls/check_SYS_getrandom.<wbr>patch<br>
            new file mode 100644<br>
            index 0000000..535c22a<br>
            --- /dev/null<br>
            +++ b/meta/recipes-support/gnutls/<wbr>gnutls/check_SYS_getrandom.<wbr>patch<br>
            @@ -0,0 +1,35 @@<br>
            +From f26c3979ab0325edb2e410d287bc50<wbr>1cf00e0ac0 Mon Sep
            17 00:00:00 2001<br>
            +From: Nikos Mavrogiannopoulos &lt;<a
              href="mailto:nmav@redhat.com" moz-do-not-send="true">nmav@redhat.com</a>&gt;<br>
            +Date: Mon, 22 Aug 2016 16:32:34 +0200<br>
            +Subject: [PATCH] rnd-linux: added check for SYS_getrandom
            being defined<br>
            +<br>
            +This allows to compile the getrandom() code in old Linux
            systems<br>
            +which do not have the system call defined.<br>
            +---<br>
            +<br>
            +Upstream-Status: Backport<br>
            +Signed-off-by: Khem Raj &lt;<a
              href="mailto:raj.khem@gmail.com" moz-do-not-send="true">raj.khem@gmail.com</a>&gt;<br>
            +<br>
            + lib/nettle/rnd-linux.c | 6 +++++-<br>
            + 1 file changed, 5 insertions(+), 1 deletion(-)<br>
            +<br>
            +diff --git a/lib/nettle/rnd-linux.c
            b/lib/nettle/rnd-linux.c<br>
            +index d7f07a6..7a24d05 100644<br>
            +--- a/lib/nettle/rnd-linux.c<br>
            ++++ b/lib/nettle/rnd-linux.c<br>
            +@@ -56,7 +56,11 @@ static dev_t _gnutls_urandom_fd_rdev =
            0;<br>
            + # else<br>
            + #  include &lt;sys/syscall.h&gt;<br>
            + #  undef getrandom<br>
            +-#  define getrandom(dst,s,flags) syscall(SYS_getrandom,
            (void*)dst, (size_t)s, (unsigned int)flags)<br>
            ++#  if defined(SYS_getrandom)<br>
            ++#   define getrandom(dst,s,flags) syscall(SYS_getrandom,
            (void*)dst, (size_t)s, (unsigned int)flags)<br>
            ++#  else<br>
            ++#   define getrandom(dst,s,flags) -1<br>
            ++#  endif<br>
            + # endif<br>
            +<br>
            + static unsigned have_getrandom(void)<br>
            +--<br>
            +libgit2 0.24.0<br>
            +<br>
            diff --git a/meta/recipes-support/gnutls/<a
              href="http://gnutls_3.5.3.bb" rel="noreferrer"
              target="_blank" moz-do-not-send="true"><wbr>gnutls_3.5.3.bb</a>
            b/meta/recipes-support/gnutls/<a
              href="http://gnutls_3.5.3.bb" rel="noreferrer"
              target="_blank" moz-do-not-send="true"><wbr>gnutls_3.5.3.bb</a><br>
            index b2dbb07..0400588 100644<br>
            --- a/meta/recipes-support/gnutls/<a
              href="http://gnutls_3.5.3.bb" rel="noreferrer"
              target="_blank" moz-do-not-send="true"><wbr>gnutls_3.5.3.bb</a><br>
            +++ b/meta/recipes-support/gnutls/<a
              href="http://gnutls_3.5.3.bb" rel="noreferrer"
              target="_blank" moz-do-not-send="true"><wbr>gnutls_3.5.3.bb</a><br>
            @@ -4,6 +4,7 @@ SRC_URI += "<a class="moz-txt-link-freetext" href="file://correct_rpl_">file://correct_rpl_</a><wbr>gettimeofday_signature.patch
            \<br>
                         <a class="moz-txt-link-freetext" href="file://0001-configure.ac-fix">file://0001-configure.ac-fix</a>-<wbr>sed-command.patch
            \<br>
                         <a class="moz-txt-link-freetext" href="file://use-pkg-config-to">file://use-pkg-config-to</a>-<wbr>locate-zlib.patch
            \<br>
                         <a class="moz-txt-link-freetext" href="file://0001-Use-correct">file://0001-Use-correct</a>-<wbr>include-dir-with-minitasn.<wbr>patch
            \<br>
            +            <a class="moz-txt-link-freetext" href="file://check_SYS_getrandom">file://check_SYS_getrandom</a>.<wbr>patch \<br>
                         <a class="moz-txt-link-freetext" href="file://CVE-2016-7444.patch">file://CVE-2016-7444.patch</a> \<br>
                        "<br>
             SRC_URI[md5sum] = "<wbr>6c2c7f40ddf52933ee3ca474cb8cb6<wbr>3c"<br>
            <span class="HOEnZb"><font color="#888888">--<br>
                2.7.4<br>
                <br>
              </font></span></blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <br>
  </body>
</html>
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Martin Jansa March 4, 2018, 11:43 a.m. UTC | #3
Seems like what was now merged to morty didn't include this.

On Wed, Jan 17, 2018 at 8:06 PM, akuster808 <akuster808@gmail.com> wrote:

>

>

> On 01/15/2018 12:14 AM, Martin Jansa wrote:

>

> ping

>

> On Sat, Dec 2, 2017 at 1:37 AM, Martin Jansa <martin.jansa@gmail.com>

> wrote:

>

>> From: Khem Raj <raj.khem@gmail.com>

>>

>

> pick up now for stagging.

> armin

>

>

>> When using distros which use old kernels gnutls fails to build

>> due to missing SYS_getrandom, therefore we need to check for this

>> before using it.

>> Fixes errorr e.g.

>>

>> | ../../../gnutls-3.5.3/lib/nettle/rnd-linux.c: In function

>> 'have_getrandom':

>> | ../../../gnutls-3.5.3/lib/nettle/rnd-linux.c:59:42: error:

>> 'SYS_getrandom' undeclared (first use in this function)

>> |  #  define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst,

>> (size_t)s, (unsigned int)flags)

>>

>> Signed-off-by: Khem Raj <raj.khem@gmail.com>

>> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>

>> ---

>>  .../gnutls/gnutls/check_SYS_getrandom.patch        | 35

>> ++++++++++++++++++++++

>>  meta/recipes-support/gnutls/gnutls_3.5.3.bb        |  1 +

>>  2 files changed, 36 insertions(+)

>>  create mode 100644 meta/recipes-support/gnutls/gn

>> utls/check_SYS_getrandom.patch

>>

>> diff --git a/meta/recipes-support/gnutls/gnutls/check_SYS_getrandom.patch

>> b/meta/recipes-support/gnutls/gnutls/check_SYS_getrandom.patch

>> new file mode 100644

>> index 0000000..535c22a

>> --- /dev/null

>> +++ b/meta/recipes-support/gnutls/gnutls/check_SYS_getrandom.patch

>> @@ -0,0 +1,35 @@

>> +From f26c3979ab0325edb2e410d287bc501cf00e0ac0 Mon Sep 17 00:00:00 2001

>> +From: Nikos Mavrogiannopoulos <nmav@redhat.com>

>> +Date: Mon, 22 Aug 2016 16:32:34 +0200

>> +Subject: [PATCH] rnd-linux: added check for SYS_getrandom being defined

>> +

>> +This allows to compile the getrandom() code in old Linux systems

>> +which do not have the system call defined.

>> +---

>> +

>> +Upstream-Status: Backport

>> +Signed-off-by: Khem Raj <raj.khem@gmail.com>

>> +

>> + lib/nettle/rnd-linux.c | 6 +++++-

>> + 1 file changed, 5 insertions(+), 1 deletion(-)

>> +

>> +diff --git a/lib/nettle/rnd-linux.c b/lib/nettle/rnd-linux.c

>> +index d7f07a6..7a24d05 100644

>> +--- a/lib/nettle/rnd-linux.c

>> ++++ b/lib/nettle/rnd-linux.c

>> +@@ -56,7 +56,11 @@ static dev_t _gnutls_urandom_fd_rdev = 0;

>> + # else

>> + #  include <sys/syscall.h>

>> + #  undef getrandom

>> +-#  define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst,

>> (size_t)s, (unsigned int)flags)

>> ++#  if defined(SYS_getrandom)

>> ++#   define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst,

>> (size_t)s, (unsigned int)flags)

>> ++#  else

>> ++#   define getrandom(dst,s,flags) -1

>> ++#  endif

>> + # endif

>> +

>> + static unsigned have_getrandom(void)

>> +--

>> +libgit2 0.24.0

>> +

>> diff --git a/meta/recipes-support/gnutls/gnutls_3.5.3.bb

>> b/meta/recipes-support/gnutls/gnutls_3.5.3.bb

>> index b2dbb07..0400588 100644

>> --- a/meta/recipes-support/gnutls/gnutls_3.5.3.bb

>> +++ b/meta/recipes-support/gnutls/gnutls_3.5.3.bb

>> @@ -4,6 +4,7 @@ SRC_URI += "file://correct_rpl_gettimeofday_signature.patch

>> \

>>              file://0001-configure.ac-fix-sed-command.patch \

>>              file://use-pkg-config-to-locate-zlib.patch \

>>              file://0001-Use-correct-include-dir-with-minitasn.patch \

>> +            file://check_SYS_getrandom.patch \

>>              file://CVE-2016-7444.patch \

>>             "

>>  SRC_URI[md5sum] = "6c2c7f40ddf52933ee3ca474cb8cb63c"

>> --

>> 2.7.4

>>

>>

>

>

>

>
<div dir="ltr">Seems like what was now merged to morty didn&#39;t include this.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 17, 2018 at 8:06 PM, akuster808 <span dir="ltr">&lt;<a href="mailto:akuster808@gmail.com" target="_blank">akuster808@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF"><span class="">
    <p><br>
    </p>
    <br>
    <div class="m_-6088208376238100494moz-cite-prefix">On 01/15/2018 12:14 AM, Martin Jansa
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">ping</div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Sat, Dec 2, 2017 at 1:37 AM, Martin
          Jansa <span dir="ltr">&lt;<a href="mailto:martin.jansa@gmail.com" target="_blank">martin.jansa@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Khem
            Raj &lt;<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>&gt;<br>
          </blockquote>
        </div>
      </div>
    </blockquote>
    <br></span>
    pick up now for stagging.<br>
    armin<div><div class="h5"><br>
    <blockquote type="cite">
      <div class="gmail_extra">
        <div class="gmail_quote">
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <br>
            When using distros which use old kernels gnutls fails to
            build<br>
            due to missing SYS_getrandom, therefore we need to check for
            this<br>
            before using it.<br>
            Fixes errorr e.g.<br>
            <br>
            | ../../../gnutls-3.5.3/lib/nett<wbr>le/rnd-linux.c: In
            function &#39;have_getrandom&#39;:<br>
            | ../../../gnutls-3.5.3/lib/nett<wbr>le/rnd-linux.c:59:42:
            error: &#39;SYS_getrandom&#39; undeclared (first use in this
            function)<br>
            |  #  define getrandom(dst,s,flags) syscall(SYS_getrandom,
            (void*)dst, (size_t)s, (unsigned int)flags)<br>
            <br>
            Signed-off-by: Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>&gt;<br>

            Signed-off-by: Martin Jansa &lt;<a href="mailto:Martin.Jansa@gmail.com" target="_blank">Martin.Jansa@gmail.com</a>&gt;<br>

            ---<br>
             .../gnutls/gnutls/check_SYS_g<wbr>etrandom.patch        |
            35 ++++++++++++++++++++++<br>
             meta/recipes-support/gnutls/<a href="http://gnutls_3.5.3.bb" rel="noreferrer" target="_blank">g<wbr>nutls_3.5.3.bb</a> 
                  |  1 +<br>
             2 files changed, 36 insertions(+)<br>
             create mode 100644 meta/recipes-support/gnutls/gn<wbr>utls/check_SYS_getrandom.patch<br>
            <br>
            diff --git a/meta/recipes-support/gnutls/<wbr>gnutls/check_SYS_getrandom.pat<wbr>ch
            b/meta/recipes-support/gnutls/<wbr>gnutls/check_SYS_getrandom.pat<wbr>ch<br>
            new file mode 100644<br>
            index 0000000..535c22a<br>
            --- /dev/null<br>
            +++ b/meta/recipes-support/gnutls/<wbr>gnutls/check_SYS_getrandom.pat<wbr>ch<br>
            @@ -0,0 +1,35 @@<br>
            +From f26c3979ab0325edb2e410d287bc50<wbr>1cf00e0ac0 Mon Sep
            17 00:00:00 2001<br>
            +From: Nikos Mavrogiannopoulos &lt;<a href="mailto:nmav@redhat.com" target="_blank">nmav@redhat.com</a>&gt;<br>
            +Date: Mon, 22 Aug 2016 16:32:34 +0200<br>
            +Subject: [PATCH] rnd-linux: added check for SYS_getrandom
            being defined<br>
            +<br>
            +This allows to compile the getrandom() code in old Linux
            systems<br>
            +which do not have the system call defined.<br>
            +---<br>
            +<br>
            +Upstream-Status: Backport<br>
            +Signed-off-by: Khem Raj &lt;<a href="mailto:raj.khem@gmail.com" target="_blank">raj.khem@gmail.com</a>&gt;<br>
            +<br>
            + lib/nettle/rnd-linux.c | 6 +++++-<br>
            + 1 file changed, 5 insertions(+), 1 deletion(-)<br>
            +<br>
            +diff --git a/lib/nettle/rnd-linux.c
            b/lib/nettle/rnd-linux.c<br>
            +index d7f07a6..7a24d05 100644<br>
            +--- a/lib/nettle/rnd-linux.c<br>
            ++++ b/lib/nettle/rnd-linux.c<br>
            +@@ -56,7 +56,11 @@ static dev_t _gnutls_urandom_fd_rdev =
            0;<br>
            + # else<br>
            + #  include &lt;sys/syscall.h&gt;<br>
            + #  undef getrandom<br>
            +-#  define getrandom(dst,s,flags) syscall(SYS_getrandom,
            (void*)dst, (size_t)s, (unsigned int)flags)<br>
            ++#  if defined(SYS_getrandom)<br>
            ++#   define getrandom(dst,s,flags) syscall(SYS_getrandom,
            (void*)dst, (size_t)s, (unsigned int)flags)<br>
            ++#  else<br>
            ++#   define getrandom(dst,s,flags) -1<br>
            ++#  endif<br>
            + # endif<br>
            +<br>
            + static unsigned have_getrandom(void)<br>
            +--<br>
            +libgit2 0.24.0<br>
            +<br>
            diff --git a/meta/recipes-support/gnutls/<a href="http://gnutls_3.5.3.bb" rel="noreferrer" target="_blank"><wbr>gnutls_3.5.3.bb</a>
            b/meta/recipes-support/gnutls/<a href="http://gnutls_3.5.3.bb" rel="noreferrer" target="_blank"><wbr>gnutls_3.5.3.bb</a><br>
            index b2dbb07..0400588 100644<br>
            --- a/meta/recipes-support/gnutls/<a href="http://gnutls_3.5.3.bb" rel="noreferrer" target="_blank"><wbr>gnutls_3.5.3.bb</a><br>
            +++ b/meta/recipes-support/gnutls/<a href="http://gnutls_3.5.3.bb" rel="noreferrer" target="_blank"><wbr>gnutls_3.5.3.bb</a><br>
            @@ -4,6 +4,7 @@ SRC_URI += &quot;<a class="m_-6088208376238100494moz-txt-link-freetext">file://correct_rpl_</a>gettimeofd<wbr>ay_signature.patch
            \<br>
                         <a class="m_-6088208376238100494moz-txt-link-freetext">file://0001-configure.ac-fix</a>-<wbr>sed-command.patch
            \<br>
                         <a class="m_-6088208376238100494moz-txt-link-freetext">file://use-pkg-config-to</a>-loca<wbr>te-zlib.patch
            \<br>
                         <a class="m_-6088208376238100494moz-txt-link-freetext">file://0001-Use-correct</a>-inclu<wbr>de-dir-with-minitasn.patch
            \<br>
            +            <a class="m_-6088208376238100494moz-txt-link-freetext">file://check_SYS_getrandom</a>.pat<wbr>ch \<br>
                         <a class="m_-6088208376238100494moz-txt-link-freetext">file://CVE-2016-7444.patch</a> \<br>
                        &quot;<br>
             SRC_URI[md5sum] = &quot;6c2c7f40ddf52933ee3ca474cb8cb<wbr>63c&quot;<br>
            <span class="m_-6088208376238100494HOEnZb"><font color="#888888">--<br>
                2.7.4<br>
                <br>
              </font></span></blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="m_-6088208376238100494mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <br>
  </div></div></div>

</blockquote></div><br></div>
-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

diff --git a/meta/recipes-support/gnutls/gnutls/check_SYS_getrandom.patch b/meta/recipes-support/gnutls/gnutls/check_SYS_getrandom.patch
new file mode 100644
index 0000000..535c22a
--- /dev/null
+++ b/meta/recipes-support/gnutls/gnutls/check_SYS_getrandom.patch
@@ -0,0 +1,35 @@ 
+From f26c3979ab0325edb2e410d287bc501cf00e0ac0 Mon Sep 17 00:00:00 2001
+From: Nikos Mavrogiannopoulos <nmav@redhat.com>
+Date: Mon, 22 Aug 2016 16:32:34 +0200
+Subject: [PATCH] rnd-linux: added check for SYS_getrandom being defined
+
+This allows to compile the getrandom() code in old Linux systems
+which do not have the system call defined.
+---
+
+Upstream-Status: Backport
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+ lib/nettle/rnd-linux.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/lib/nettle/rnd-linux.c b/lib/nettle/rnd-linux.c
+index d7f07a6..7a24d05 100644
+--- a/lib/nettle/rnd-linux.c
++++ b/lib/nettle/rnd-linux.c
+@@ -56,7 +56,11 @@ static dev_t _gnutls_urandom_fd_rdev = 0;
+ # else
+ #  include <sys/syscall.h>
+ #  undef getrandom
+-#  define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst, (size_t)s, (unsigned int)flags)
++#  if defined(SYS_getrandom)
++#   define getrandom(dst,s,flags) syscall(SYS_getrandom, (void*)dst, (size_t)s, (unsigned int)flags)
++#  else
++#   define getrandom(dst,s,flags) -1
++#  endif
+ # endif
+ 
+ static unsigned have_getrandom(void)
+--
+libgit2 0.24.0
+
diff --git a/meta/recipes-support/gnutls/gnutls_3.5.3.bb b/meta/recipes-support/gnutls/gnutls_3.5.3.bb
index b2dbb07..0400588 100644
--- a/meta/recipes-support/gnutls/gnutls_3.5.3.bb
+++ b/meta/recipes-support/gnutls/gnutls_3.5.3.bb
@@ -4,6 +4,7 @@  SRC_URI += "file://correct_rpl_gettimeofday_signature.patch \
             file://0001-configure.ac-fix-sed-command.patch \
             file://use-pkg-config-to-locate-zlib.patch \
             file://0001-Use-correct-include-dir-with-minitasn.patch \
+            file://check_SYS_getrandom.patch \
             file://CVE-2016-7444.patch \
            "
 SRC_URI[md5sum] = "6c2c7f40ddf52933ee3ca474cb8cb63c"