Skip to contentSkip to conversation

libbsd: bump to version 0.9.1

PATCH New Baruch Siach 4 participants 6 messages Jun 5, 2018 – Jun 7, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libbsd: bump to version 0.9.1

Drop upstream patches.

Add a patch fixing build with musl libc.

Update the list of licenses based on the content of COPYING. The BSD-5-Clause license is not listed by SPDX, but that is its name in the COPYING file.

Update the license file hash: new licenses, dates update, reformat.

---
 ...laration-protection-for-glibc-alread.patch |  80 ------
 ...0001-flopen-fix-build-with-musl-libc.patch |  40 +++
 ...2-Fix-build-for-openrisc-with-uClibc.patch |  48 ----
 ...3-Handle-systems-missing-sys-cdefs.h.patch | 230 ------------------
 package/libbsd/libbsd.hash                    |   6 +-
 package/libbsd/libbsd.mk                      |   5 +-
 6 files changed, 46 insertions(+), 363 deletions(-)
 delete mode 100644 package/libbsd/0001-Fix-function-declaration-protection-for-glibc-alread.patch
 create mode 100644 package/libbsd/0001-flopen-fix-build-with-musl-libc.patch
 delete mode 100644 package/libbsd/0002-Fix-build-for-openrisc-with-uClibc.patch
 delete mode 100644 package/libbsd/0003-Handle-systems-missing-sys-cdefs.h.patch
package/libbsd/0001-Fix-function-declaration-protection-for-glibc-alread.patch deleted +0 -80
deleted file mode 100644
index fdf45bdef6a7..000000000000
@@ -1,80 +0,0 @@
-From 1f8a3f7bccfc84b195218ad0086ebd57049c3490 Mon Sep 17 00:00:00 2001
-From: Guillem Jover <[email protected]>
-Date: Tue, 6 Mar 2018 01:39:45 +0100
-Subject: [PATCH] Fix function declaration protection for glibc already
- providing them
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-On non-glibc based systems we cannot unconditionally use the
-__GLIBC_PREREQ macro as it gets expanded before evaluation. Instead,
-if it is undefined, define it to 0.
-
-We should also always declare these functions on non-glibc based
-systems. And on systems with a new enough glibc, which provides these
-functions, we should still provide the declarations if _GNU_SOURCE
-is *not* defined.
-
-Backported from:
-https://cgit.freedesktop.org/libbsd/patch/?id=1f8a3f7bccfc84b195218ad0086ebd57049c3490
-
-Reported-by: J?rg Krause <[email protected]>
-Signed-off-by: Guillem Jover <[email protected]>
-Signed-off-by: J?rg Krause <[email protected]>
----
- include/bsd/stdlib.h    | 3 ++-
- include/bsd/string.h    | 3 ++-
- include/bsd/sys/cdefs.h | 8 ++++++++
- 3 files changed, 12 insertions(+), 2 deletions(-)
-
-diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h
-index 8d33d1f..a5b063c 100644
---- a/include/bsd/stdlib.h
-+++ b/include/bsd/stdlib.h
-@@ -71,7 +71,8 @@ int sradixsort(const unsigned char **base, int nmemb,
-                const unsigned char *table, unsigned endbyte);
- 
- void *reallocf(void *ptr, size_t size);
--#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 26)
-+#if !defined(__GLIBC__) || \
-+    (defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 26) || !defined(_GNU_SOURCE)))
- void *reallocarray(void *ptr, size_t nmemb, size_t size);
- #endif
- 
-diff --git a/include/bsd/string.h b/include/bsd/string.h
-index 29097f6..f987fee 100644
---- a/include/bsd/string.h
-+++ b/include/bsd/string.h
-@@ -46,7 +46,8 @@ size_t strlcat(char *dst, const char *src, size_t siz);
- char *strnstr(const char *str, const char *find, size_t str_len);
- void strmode(mode_t mode, char *str);
- 
--#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 25)
-+#if !defined(__GLIBC__) || \
-+    (defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 25) || !defined(_GNU_SOURCE)))
- void explicit_bzero(void *buf, size_t len);
- #endif
- __END_DECLS
-diff --git a/include/bsd/sys/cdefs.h b/include/bsd/sys/cdefs.h
-index b4c8f30..d1cc419 100644
---- a/include/bsd/sys/cdefs.h
-+++ b/include/bsd/sys/cdefs.h
-@@ -58,6 +58,14 @@
- #endif
- #endif
- 
-+/*
-+ * On non-glibc based systems, we cannot unconditionally use the
-+ * __GLIBC_PREREQ macro as it gets expanded before evaluation.
-+ */
-+#ifndef __GLIBC_PREREQ
-+#define __GLIBC_PREREQ(maj, min) 0
-+#endif
-+
- /*
-  * Some kFreeBSD headers expect those macros to be set for sanity checks.
-  */
--- 
-2.16.2
-
package/libbsd/0001-flopen-fix-build-with-musl-libc.patch new file +40 -0
new file mode 100644
index 000000000000..6f0aeffed7cc
@@ -0,0 +1,40 @@
+From 8575450b9c1226fc38196b29e33c67f2b58cacf5 Mon Sep 17 00:00:00 2001
+From: Baruch Siach <[email protected]>
+Date: Tue, 5 Jun 2018 19:18:47 +0300
+Subject: [PATCH] flopen: fix build with musl libc
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Commit 993828d84ee (Add flopenat() function from FreeBSD) dropped the
+fcntl.h header. This breaks the build with musl libc:
+
+flopen.c: In function ?vflopenat?:
+flopen.c:60:14: error: ?O_CREAT? undeclared (first use in this function)
+  if (flags & O_CREAT) {
+              ^~~~~~~
+
+Restore the fcntl.h header include to fix the build.
+
+Signed-off-by: Baruch Siach <[email protected]>
+---
+Upstream status: sent to libbsd at lists.freedesktop.org
+
+ src/flopen.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/flopen.c b/src/flopen.c
+index b9972c94ec90..ff20d074445b 100644
+--- a/src/flopen.c
++++ b/src/flopen.c
+@@ -32,6 +32,7 @@
+ #include <sys/stat.h>
+ 
+ #include <errno.h>
++#include <fcntl.h>
+ #include <stdarg.h>
+ #include <unistd.h>
+ 
+-- 
+2.17.1
+
package/libbsd/0002-Fix-build-for-openrisc-with-uClibc.patch deleted +0 -48

48 lines not on this page · raw message

package/libbsd/0003-Handle-systems-missing-sys-cdefs.h.patch deleted +0 -230

230 lines not on this page · raw message

package/libbsd/libbsd.hash +3 -3
index 133df90cb9a9..93af3944ae51 100644
@@ -1,3 +1,3 @@
-# From https://lists.freedesktop.org/archives/libbsd/2018-January/000166.html
-sha256	f548f10e5af5a08b1e22889ce84315b1ebe41505b015c9596bad03fd13a12b31	libbsd-0.8.7.tar.xz
-sha256	0b6cedd686394f9c811a6a9fd314d68ab4738475ad3d9df61154259fa649a2a7	COPYING
+# From https://lists.freedesktop.org/archives/libbsd/2018-May/000190.html
+sha256	56d835742327d69faccd16955a60b6dcf30684a8da518c4eca0ac713b9e0a7a4	libbsd-0.9.1.tar.xz
+sha256	df6d8e1b5b3a5b06376c658c8ad3afc82687f1c0e0404cec4738ad14b2675708	COPYING
package/libbsd/libbsd.mk +3 -2
index e211389ec7de..2d78b8c5f33e 100644
@@ -4,10 +4,11 @@
 #
 ################################################################################
 
-LIBBSD_VERSION = 0.8.7
+LIBBSD_VERSION = 0.9.1
 LIBBSD_SOURCE = libbsd-$(LIBBSD_VERSION).tar.xz
 LIBBSD_SITE = https://archive.hadrons.org/software/libbsd
-LIBBSD_LICENSE = BSD-3-Clause, MIT
+LIBBSD_LICENSE = BSD-2-Clause, BSD-3-Clause, BSD-4-Clause, BSD-5-Clause, \
+		MIT, ISC, Beerware
 LIBBSD_LICENSE_FILES = COPYING
 LIBBSD_INSTALL_STAGING = YES
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 libbsd: bump to version 0.9.1

Hello,

Quoted 7 lines · Baruch Siach

Drop upstream patches.

Add a patch fixing build with musl libc.

Update the list of licenses based on the content of COPYING. The BSD-5-Clause license is not listed by SPDX, but that is its name in the COPYING file.

The license seems to really be

BSD-5-clause-Peter-Wemm

because the license text itself refers to Peter Wemm.

Yocto is really using a longer list of licenses:
https://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-support/libbsd/libbsd_0.8.7.bb

For now I've applied your patch, because it's definitely not worse than what we have, but perhaps we want to make it even better.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 libbsd: bump to version 0.9.1

Hi Thomas,

Quoted 9 lines · Thomas Petazzoni
Quoted 7 lines · Baruch Siach

Drop upstream patches.

Add a patch fixing build with musl libc.

Update the list of licenses based on the content of COPYING. The BSD-5-Clause license is not listed by SPDX, but that is its name in the COPYING file.

Quoted 5 lines

The license seems to really be

BSD-5-clause-Peter-Wemm

because the license text itself refers to Peter Wemm.

The libbsd COPYING fine appends the copyright holder to a number of common licenses like BSD-3-clause-John-Birrell and BSD-4-clause-Niels-Provos. That's probably because each COPYING entry lists specific files with their copyright holders. We usually only use the SPDX identifier string. So I don't think there is a reason to do that for this license.

Quoted 2 lines

Yocto is really using a longer list of licenses:
https://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-support/libbsd/libbsd_0.8.7.bb

The full list is only in a comment, AFAICS. The actual effective line is rather shorter than what we have following this patch:

LICENSE = "BSD-4-Clause & ISC & PD"

Quoted 2 lines

For now I've applied your patch, because it's definitely not worse than what we have, but perhaps we want to make it even better.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#3 lore raw

PATCH 1/1 libbsd: bump to version 0.9.1

Hello,

Quoted 6 lines · Baruch Siach
Quoted 1 line

because the license text itself refers to Peter Wemm.

The libbsd COPYING fine appends the copyright holder to a number of common licenses like BSD-3-clause-John-Birrell and BSD-4-clause-Niels-Provos. That's probably because each COPYING entry lists specific files with their copyright holders.

Correct.

Quoted 2 lines

We usually only use the SPDX identifier string. So I don't think there is a reason to do that for this license.

Well, normally an SPDX identifier string refers to a specific version of the license. If the license text is different (even for subtle reasons), the SPDX identifier string should probably be different.

Quoted 4 lines
Quoted 2 lines

Yocto is really using a longer list of licenses:
https://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-support/libbsd/libbsd_0.8.7.bb

The full list is only in a comment, AFAICS.

True, indeed, I had missed that.

Quoted 4 lines

The actual effective line is
rather shorter than what we have following this patch:

LICENSE = "BSD-4-Clause & ISC & PD"

I also think it is good enough. But I wanted to point out that the licensing is in fact a bit more complicated. I personally don't see the need of having a more detailed LIBBSD_LICENSE description, but I wanted to point this out so that others can comment on this (Arnout, Yann, Peter).

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

PATCH 1/1 libbsd: bump to version 0.9.1

Thomas, Baruch, All,

On 2018-06-06 07:58 +0200, Thomas Petazzoni spake thusly:

Quoted 1 line · Baruch Siach

[--SNIP--]

Quoted 9 lines
Quoted 3 lines

The actual effective line is
rather shorter than what we have following this patch:
LICENSE = "BSD-4-Clause & ISC & PD"

I also think it is good enough. But I wanted to point out that the licensing is in fact a bit more complicated. I personally don't see the need of having a more detailed LIBBSD_LICENSE description, but I wanted to point this out so that others can comment on this (Arnout, Yann, Peter).

From https://libbsd.freedesktop.org/wiki/ :

"Most of the licenses are either ISC, MIT, Beerware, BSD-2-clause, BSD-3-clause, and BSD-4-clause [...]"

So, we should probably at least list just those:

LIBBSD_LICENSE = ISC, MIT, Beerware, BSD-2-clause, BSD-3-clause, BSD-4-clause

My $0.02...

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#5 lore raw

PATCH 1/1 libbsd: bump to version 0.9.1

In reply to Thomas Petazzoni
Quoted 11 lines · Thomas Petazzoni

Hello,

Quoted 6 lines · Baruch Siach
Quoted 1 line

because the license text itself refers to Peter Wemm.

The libbsd COPYING fine appends the copyright holder to a number of common licenses like BSD-3-clause-John-Birrell and BSD-4-clause-Niels-Provos. That's probably because each COPYING entry lists specific files with their copyright holders.

Quoted 8 lines

Correct.

Quoted 2 lines

We usually only use the SPDX identifier string. So I don't think there is a reason to do that for this license.

Well, normally an SPDX identifier string refers to a specific version of the license. If the license text is different (even for subtle reasons), the SPDX identifier string should probably be different.

Indeed, but at the moment we don't follow that rule at all. Our license tags
are really just a hint, they're still a long way off from a full SPDX spec.

Regards,
Arnout

[snip]

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