From patchwork Wed Dec 2 00:58:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Prado X-Patchwork-Id: 551100 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 2DC4914029E for ; Wed, 2 Dec 2015 11:59:45 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=e-labworks-com.20150623.gappssmtp.com header.i=@e-labworks-com.20150623.gappssmtp.com header.b=And7kla6; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 474173220C; Wed, 2 Dec 2015 00:59:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rYpIpw5DYjzT; Wed, 2 Dec 2015 00:59:42 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 24B693222B; Wed, 2 Dec 2015 00:59:42 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 0BE961C163D for ; Wed, 2 Dec 2015 00:59:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 05E8B3222B for ; Wed, 2 Dec 2015 00:59:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qkO0DbZWEpPS for ; Wed, 2 Dec 2015 00:59:39 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qg0-f44.google.com (mail-qg0-f44.google.com [209.85.192.44]) by silver.osuosl.org (Postfix) with ESMTPS id 9E6DC3220C for ; Wed, 2 Dec 2015 00:59:39 +0000 (UTC) Received: by qgec40 with SMTP id c40so21197968qge.2 for ; Tue, 01 Dec 2015 16:59:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=e-labworks-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=P0y5n2q3jNsrASu7fFLwv/sb9s7aUcMxwbzkdFbZm1I=; b=And7kla6/xmTZFQDj4OqCLx9CK0YTLf+ETn4Z2h/XHVvmqtRxvsOWhJhDtDMRZ1BUa keY/YqUIAcP1KoBynzJv/hGtLZImRLAQ93FNycZPUx1gCAAR9pqscCEmQ6+Q9feyoolG jHM24DKj9yUSv3GeaS/JOoI2Dl1r04U4tXvlqCUEIMKrjRFQGkSJQJRyHPhFN/RFWhEs akCmkAi/xxussuNpcfxlO6+zdEpWYKk+Xpeh0poc+/F94V4OFDpBEhqv7hOyGCaL77cg KP7hvdkZQ6hqNVjOXSte4ZdIhbfj1MtDqAOx11TbSfNGNjIksm3HnFGkRJ87utj+dcOw f2AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=P0y5n2q3jNsrASu7fFLwv/sb9s7aUcMxwbzkdFbZm1I=; b=OU07MAOHOKYMdVKgDeT3KnSofA0WbdJoGzfK+o0a3J2+iNC7EgBcBEnzB4SyyG5cGr LryuwcqYfi3E+1OT2dXmynPxA7pTRsDXuidY1V4wngH08ctyUjN/w1p9EdDkqXU6uHeg e6ViKjOZxhuLo1N49QTRoxucyPMRfN/oQ6+1Q7X2kH3fMkmMKOOAZuS5I8oCI6L7wo+B 6BDvdEd9ssS23ekmQE3bU8pDrPGvJW4fyoHo5yaLorQLkpchOxWsIx2m5z2h1l+VfWwf BMEYjYV/soqrzRkbA2Hci13d46Zaw7YYxvuhUNlVkhv/15V93dbjAYyZ8GTx1Fux5vCh Ej6g== X-Gm-Message-State: ALoCoQk337sEO+c7gnLiEdY11Oaz9104nqLtESTbQ7uymMo0TFVgHAmJE6VRayPjxyCKl0Vy3KCD X-Received: by 10.141.3.212 with SMTP id f203mr615480qhd.98.1449017978720; Tue, 01 Dec 2015 16:59:38 -0800 (PST) Received: from localhost.localdomain ([177.141.170.120]) by smtp.gmail.com with ESMTPSA id p17sm204720qhb.34.2015.12.01.16.59.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Dec 2015 16:59:38 -0800 (PST) From: Sergio Prado To: buildroot@buildroot.org Date: Tue, 1 Dec 2015 22:58:28 -0200 Message-Id: <1449017908-7935-1-git-send-email-sergio.prado@e-labworks.com> X-Mailer: git-send-email 1.9.1 Subject: [Buildroot] [PATCH v2] musl: add a sys/queue.h implementation X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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. Signed-off-by: Sergio Prado --- 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 diff --git a/package/musl/musl.mk b/package/musl/musl.mk index 6fdcc7312288..2cc6699a35b2 100644 --- a/package/musl/musl.mk +++ b/package/musl/musl.mk @@ -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 diff --git a/package/netbsd-queue/netbsd-queue.hash b/package/netbsd-queue/netbsd-queue.hash new file mode 100644 index 000000000000..f8e2a6c59878 --- /dev/null +++ b/package/netbsd-queue/netbsd-queue.hash @@ -0,0 +1,2 @@ +# Locally calculated +sha256 c13407edd0e33be73cae72514cb234f8612e1c0e54401c9448daffd3a240158b queue.h?rev=1.70 diff --git a/package/netbsd-queue/netbsd-queue.mk b/package/netbsd-queue/netbsd-queue.mk new file mode 100644 index 000000000000..0f486fa25880 --- /dev/null +++ b/package/netbsd-queue/netbsd-queue.mk @@ -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)) diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk index 613ce506608b..745b6858a2a7 100644 --- a/toolchain/toolchain-external/toolchain-external.mk +++ b/toolchain/toolchain-external/toolchain-external.mk @@ -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.