Skip to contentSkip to conversation

musl: add a sys/queue.h implementation

PATCH Superseded Sergio Prado 2 participants 5 messages Dec 2, 2015 – Dec 17, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 musl: add a sys/queue.h implementation

Musl does not provide a 'sys/queue.h' implementation, and this has been a problem for packages that depend on it.

So lets create a package called netbsd-queue that will install a 'sys/queue.h' in the staging directory when enabled, based on the NetBSD implementation.

Musl toolchain and external toolchain packages will depend on this package, so that 'sys/queue.h' will be always installed when compiling with a musl based toolchain.

Tested on ARM and x86 in the following cases:
- Buildroot musl toolchain.
- External musl toolchain without 'sys/queue.h'.
- External musl toolchain with 'sys/queue.h'.

Fixes:
http://autobuild.buildroot.net/results/24bad2d06ab40024dacf136bee722072d587f84e

And possibly many others.

---
Changes v1 -> v2:
- package name changed to netbsd-queue
- queue.h is now downloaded from NetBSD CVS server
- Config.in removed
- license changed to BSD-3c
- instead of checking if queue.h already exists before installing, it will be installed unconditionally.

---
 package/musl/musl.mk                               |  5 +++++
 package/netbsd-queue/netbsd-queue.hash             |  2 ++
 package/netbsd-queue/netbsd-queue.mk               | 23 ++++++++++++++++++++++
 toolchain/toolchain-external/toolchain-external.mk |  7 +++++++
 4 files changed, 37 insertions(+)
 create mode 100644 package/netbsd-queue/netbsd-queue.hash
 create mode 100644 package/netbsd-queue/netbsd-queue.mk
package/musl/musl.mk +5 -0
index 6fdcc7312288..2cc6699a35b2 100644
@@ -13,6 +13,11 @@ MUSL_LICENSE_FILES = COPYRIGHT
 # cross-compiler and the kernel headers
 MUSL_DEPENDENCIES = host-gcc-initial linux-headers
 
+# musl does not provide a sys/queue.h implementation, so add the
+# netbsd-queue package that will install a sys/queue.h file in the
+# staging directory based on the NetBSD implementation.
+MUSL_DEPENDENCIES += netbsd-queue
+
 # musl is part of the toolchain so disable the toolchain dependency
 MUSL_ADD_TOOLCHAIN_DEPENDENCY = NO
 
package/netbsd-queue/netbsd-queue.hash new file +2 -0
new file mode 100644
index 000000000000..f8e2a6c59878
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256 c13407edd0e33be73cae72514cb234f8612e1c0e54401c9448daffd3a240158b  queue.h?rev=1.70
package/netbsd-queue/netbsd-queue.mk new file +23 -0
new file mode 100644
index 000000000000..0f486fa25880
@@ -0,0 +1,23 @@
+################################################################################
+#
+# netbsd-queue
+#
+################################################################################
+
+NETBSD_QUEUE_VERSION = 1.70
+NETBSD_QUEUE_SITE = http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys
+NETBSD_QUEUE_SOURCE = queue.h?rev=$(NETBSD_QUEUE_VERSION)
+NETBSD_QUEUE_LICENSE = BSD-3c
+
+NETBSD_QUEUE_INSTALL_STAGING = YES
+
+define NETBSD_QUEUE_EXTRACT_CMDS
+	cp $(DL_DIR)/$(NETBSD_QUEUE_SOURCE) $(@D)/queue.h
+endef
+
+define NETBSD_QUEUE_INSTALL_STAGING_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/queue.h \
+		$(STAGING_DIR)/usr/include/sys/queue.h
+endef
+
+$(eval $(generic-package))
toolchain/toolchain-external/toolchain-external.mk +7 -0
index 613ce506608b..745b6858a2a7 100644
@@ -237,6 +237,13 @@ TOOLCHAIN_EXTERNAL_CFLAGS += -msoft-float
 TOOLCHAIN_EXTERNAL_TOOLCHAIN_WRAPPER_ARGS += -DBR_SOFTFLOAT=1
 endif
 
+# musl does not provide a sys/queue.h implementation, so add the
+# netbsd-queue package that will install a sys/queue.h file in the
+# staging directory based on the NetBSD implementation.
+ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y)
+TOOLCHAIN_EXTERNAL_DEPENDENCIES += netbsd-queue
+endif
+
 # The Linaro ARMhf toolchain expects the libraries in
 # {/usr,}/lib/arm-linux-gnueabihf, but Buildroot copies them to
 # {/usr,}/lib, so we need to create a symbolic link.
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/1 musl: add a sys/queue.h implementation

Dear Sergio Prado,

Quoted 16 lines · Sergio Prado

Musl does not provide a 'sys/queue.h' implementation, and this has been a problem for packages that depend on it.

So lets create a package called netbsd-queue that will install a 'sys/queue.h' in the staging directory when enabled, based on the NetBSD implementation.

Musl toolchain and external toolchain packages will depend on this package, so that 'sys/queue.h' will be always installed when compiling with a musl based toolchain.

Tested on ARM and x86 in the following cases:
- Buildroot musl toolchain.
- External musl toolchain without 'sys/queue.h'.
- External musl toolchain with 'sys/queue.h'.

Quoted 6 lines

Fixes:
http://autobuild.buildroot.net/results/24bad2d06ab40024dacf136bee722072d587f84e

And possibly many others.

From a quick look, it looks good. Can you chase down the packages that had their own workaround for the lack of queue.h ?

At the moment, I see only libtirpc, but I might have missed others. If you could prepare a patch for those packages to make them use the now globally available queue.h, it would be good.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH v2 1/1 musl: add a sys/queue.h implementation

Hi Thomas,

2015-12-02 7:45 GMT-02:00 Thomas Petazzoni <
[email protected]>:

Quoted 21 lines

Dear Sergio Prado,

Quoted 11 lines · Sergio Prado

Musl does not provide a 'sys/queue.h' implementation, and this has been a problem for packages that depend on it.

So lets create a package called netbsd-queue that will install a 'sys/queue.h' in the staging directory when enabled, based on the NetBSD implementation.

Musl toolchain and external toolchain packages will depend on this package, so that 'sys/queue.h' will be always installed when compiling with a musl based toolchain.

Quoted 7 lines

Tested on ARM and x86 in the following cases:
- Buildroot musl toolchain.
- External musl toolchain without 'sys/queue.h'.
- External musl toolchain with 'sys/queue.h'.

Fixes:

Quoted 9 lines

http://autobuild.buildroot.net/results/24bad2d06ab40024dacf136bee722072d587f84e

Quoted 4 lines

And possibly many others.

From a quick look, it looks good. Can you chase down the packages that had their own workaround for the lack of queue.h ?

OK. I will do it.

Quoted 8 lines

At the moment, I see only libtirpc, but I might have missed others. If you could prepare a patch for those packages to make them use the now globally available queue.h, it would be good.

Thanks!

Thanks,

Quoted 7 lines

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20151202/898bf979/attachment.html>

#3 lore raw

PATCH v2 1/1 musl: add a sys/queue.h implementation

Hi Thomas,

Via "git log" and "git grep" I identified two packages that have changes because of queue.h: fastd and libtirpc.

Fastd is using a patch that removes the need of queue.h, and that patch is already upstream. So I think we do not need to change that.

Libtirpc is using a patch to add a local sys/queue.h implementation. I will prepare a patch for this one.

Best regards,

Sergio Prado
Embedded Labworks
Office: +55 11 2628-3461
Mobile: +55 11 97123-3420

2015-12-02 11:00 GMT-02:00 Sergio Prado <[email protected]>:

Quoted 45 lines

Hi Thomas,

2015-12-02 7:45 GMT-02:00 Thomas Petazzoni <
thomas.petazzoni at free-electrons.com>:

Quoted 21 lines

Dear Sergio Prado,

Quoted 11 lines · Sergio Prado

Musl does not provide a 'sys/queue.h' implementation, and this has been a problem for packages that depend on it.

So lets create a package called netbsd-queue that will install a 'sys/queue.h' in the staging directory when enabled, based on the NetBSD implementation.

Musl toolchain and external toolchain packages will depend on this package, so that 'sys/queue.h' will be always installed when compiling with a musl based toolchain.

Quoted 7 lines

Tested on ARM and x86 in the following cases:
- Buildroot musl toolchain.
- External musl toolchain without 'sys/queue.h'.
- External musl toolchain with 'sys/queue.h'.

Fixes:

Quoted 9 lines

http://autobuild.buildroot.net/results/24bad2d06ab40024dacf136bee722072d587f84e

Quoted 4 lines

And possibly many others.

From a quick look, it looks good. Can you chase down the packages that had their own workaround for the lack of queue.h ?

OK. I will do it.

Quoted 4 lines

At the moment, I see only libtirpc, but I might have missed others. If you could prepare a patch for those packages to make them use the now globally available queue.h, it would be good.

Quoted 15 lines
Quoted 2 lines

Thanks!

Thanks,

Quoted 7 lines

Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20151202/5b0fca77/attachment.html>

#4 lore raw

PATCH v2 1/1 musl: add a sys/queue.h implementation

In reply to Sergio Prado

Dear Sergio Prado,

Quoted 31 lines · Sergio Prado

Musl does not provide a 'sys/queue.h' implementation, and this has been a problem for packages that depend on it.

So lets create a package called netbsd-queue that will install a 'sys/queue.h' in the staging directory when enabled, based on the NetBSD implementation.

Musl toolchain and external toolchain packages will depend on this package, so that 'sys/queue.h' will be always installed when compiling with a musl based toolchain.

Tested on ARM and x86 in the following cases:
- Buildroot musl toolchain.
- External musl toolchain without 'sys/queue.h'.
- External musl toolchain with 'sys/queue.h'.

Fixes:
http://autobuild.buildroot.net/results/24bad2d06ab40024dacf136bee722072d587f84e

And possibly many others.

---
Changes v1 -> v2:
- package name changed to netbsd-queue
- queue.h is now downloaded from NetBSD CVS server
- Config.in removed
- license changed to BSD-3c
- instead of checking if queue.h already exists before installing, it will be installed unconditionally.

Quoted 8 lines
---
 package/musl/musl.mk                               |  5 +++++
 package/netbsd-queue/netbsd-queue.hash             |  2 ++
 package/netbsd-queue/netbsd-queue.mk               | 23 ++++++++++++++++++++++
 toolchain/toolchain-external/toolchain-external.mk |  7 +++++++
 4 files changed, 37 insertions(+)
 create mode 100644 package/netbsd-queue/netbsd-queue.hash
 create mode 100644 package/netbsd-queue/netbsd-queue.mk

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com