From patchwork Fri May 19 04:20:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 764423 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wTZcG34mGz9s7y for ; Fri, 19 May 2017 14:21:01 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id ED88F86124; Fri, 19 May 2017 04:20:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id leAJqnimfT3b; Fri, 19 May 2017 04:20:55 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id AFF1382870; Fri, 19 May 2017 04:20:55 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id BE93E1C3E8F for ; Fri, 19 May 2017 04:20:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id BADDD88FF0 for ; Fri, 19 May 2017 04:20:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mZmorxswylPl for ; Fri, 19 May 2017 04:20:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx.tkos.co.il (guitar.tcltek.co.il [192.115.133.116]) by whitealder.osuosl.org (Postfix) with ESMTPS id C79568255A for ; Fri, 19 May 2017 04:20:52 +0000 (UTC) Received: from tarshish.tkos.co.il (unknown [10.0.8.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx.tkos.co.il (Postfix) with ESMTPSA id 23737440364; Fri, 19 May 2017 07:20:49 +0300 (IDT) From: Baruch Siach To: buildroot@busybox.net Date: Fri, 19 May 2017 07:20:37 +0300 Message-Id: <9f5573bb9c8401ad32d34c22c69e062e14b834de.1495167637.git.baruch@tkos.co.il> X-Mailer: git-send-email 2.11.0 Subject: [Buildroot] [PATCH] toolchain: limit musl workaround to kernel headers 3.12+ 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" The libc-compat.h first appeared in kernel version 3.12. Trying to build a musl toolchain using earlier headers leads to the following failure: /bin/sed: can't read .../output/host/usr/arm-buildroot-linux-musleabi/sysroot/usr/include/linux/libc-compat.h: No such file or directory package/pkg-generic.mk:266: recipe for target '.../output/build/toolchain/.stamp_staging_installed' failed Don't apply the sed patch to older headers. Reported-by: Florent Jacquet Signed-off-by: Baruch Siach --- toolchain/toolchain/toolchain.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toolchain/toolchain/toolchain.mk b/toolchain/toolchain/toolchain.mk index e29837357a27..e15ceeb426fa 100644 --- a/toolchain/toolchain/toolchain.mk +++ b/toolchain/toolchain/toolchain.mk @@ -21,8 +21,10 @@ TOOLCHAIN_ADD_TOOLCHAIN_DEPENDENCY = NO # IFF_DORMANT and IFF_ECHO, add another macro to suppress them in the # kernel header, and avoid macro/enum conflict. # +# Kernel version 3.12 introduced the libc-compat.h header. +# # [1] http://www.openwall.com/lists/musl/2015/10/08/2 -ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y) +ifeq ($(BR2_TOOLCHAIN_USES_MUSL)$(BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_12),yy) define TOOLCHAIN_MUSL_KERNEL_HEADERS_COMPATIBILITY_HACK $(SED) 's/^#if defined(__GLIBC__)$$/#if 1/' \ $(STAGING_DIR)/usr/include/linux/libc-compat.h