• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/libressl/0002-Fix-build-with-musl-and-older-Linux-kernel.patch
Baruch SiachBaruch Siach committed 7adc268b58a29 Sep 2017
Raw file
Source viewDiff to previous
 
1
From: Baruch Siach <baruch@tkos.co.il>
2
Date: Fri, 29 Sep 2017 10:06:52 +0300
3
Subject: [PATCH] Fix build with musl and older Linux kernel
4
​
5
The musl libc carries its own copy of Linux system calls. When building
6
with Linux headers older than v3.17, musl provides SYS_getrandom
7
definition, but not GRND_NONBLOCK. This causes build failure for
8
libressl and openntpd:
9
​
10
getentropy_linux.c: In function 'getentropy_getrandom':
11
getentropy_linux.c:205:42: error: 'GRND_NONBLOCK' undeclared (first use in this function)
12
   ret = syscall(SYS_getrandom, buf, len, GRND_NONBLOCK);
13
                                          ^~~~~~~~~~~~~
14
​
15
Define GRND_NONBLOCK locally when its definition is missing to fix the
16
build. There should be no run-time effect. Older kernels return ENOSYS
17
for unsupported syscall().
18
​
19
[ from upstream pull request with file location changed ]
20
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
21
---
22
Upstream status: https://github.com/libressl-portable/openbsd/pull/82
23
​
24
diff -Nuar libressl-2.5.5-orig/crypto/compat/getentropy_linux.c libressl-2.5.5/crypto/compat/getentropy_linux.c
25
--- libressl-2.5.5-orig/crypto/compat/getentropy_linux.c    2017-07-09 13:59:48.000000000 +0300
26
+++ libressl-2.5.5/crypto/compat/getentropy_linux.c 2017-09-29 10:03:32.447958829 +0300
27
@@ -194,6 +194,11 @@
28
 }
29
 
30
 #ifdef SYS_getrandom
31
+
32
+#ifndef GRND_NONBLOCK
33
+#define GRND_NONBLOCK   0x0001
34
+#endif
35
+
36
 static int
37
 getentropy_getrandom(void *buf, size_t len)
38
 {
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.