From patchwork Wed Sep 7 17:26:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 667109 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sTr840rkZz9s4x for ; Thu, 8 Sep 2016 03:30:12 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=xeReuoEV; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bhgcp-0000sC-0l; Wed, 07 Sep 2016 17:27:03 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bhgcl-0000mn-FD for lede-dev@lists.infradead.org; Wed, 07 Sep 2016 17:27:00 +0000 Received: by mail-pf0-x242.google.com with SMTP id x24so1228818pfa.3 for ; Wed, 07 Sep 2016 10:26:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=5gHWZ83nfyewOUnxeELmqkU0ydbnKS03qYaSnRF8rAc=; b=xeReuoEVuhPBMbIMSen0A62dMNC0ZWO/Qk4B+oCIO7/VIGvoraG35kfNN4DRaFOSHy uu4qnqYPcyEgbgOJHuOnuO19tbBoMWJblM6jR5arPqm64zT1TfW8vCYql4XBeeUu6r/G PjpT/mHlJnt6vvQ3wnaPAJFreRaGEWvNce/L2qbNhh+RDin3uQdJyk+94mOxqtN/p0yF U6cjZS1aEILoMZ+/Z3W8DHnv4sNqAQ0FbuHPvTWXjLcMJQVeEN8nmXZbqxEEVbOIKiHB roP3wgY4cxXnxrLrd6YSdkP6O6M2kOpox5V7iUSZ+i3m5P0cyFosBeMFgW1k0x48Dj4a uSzQ== 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=5gHWZ83nfyewOUnxeELmqkU0ydbnKS03qYaSnRF8rAc=; b=VdCp6/+q0/eDcAkFAOfVS2jk/leuUqW+vif6jD1WeVmIJI/pOpmu7J8lCJo8l1y5WF Jd7wtohU8xKm4PyIBclTARTKWw+hH5FCGEQEMycua+HPbdbgHWupfCN1kt2wlA4Vn1FF NIhqu5xM1H5Ukya+Is7h7gigNW/pxMbC04Zuqyg12NSTQLB2pVTDuEMHkkNwPVO9159e VgWF1x/ohymyiYiGUV7pKE7WWaEES1Kr465dvTHv7otVUAKh/Ki4ziqe+yLTfGGKVayf QfnLpz4ww0of6BNQuVZSs/0XUPA0YCXWkS6fmfmwlo2qEzd4/CTuzs5148HiapnXVLf2 YKEw== X-Gm-Message-State: AE9vXwNyTdr9XMAbvKSuBG8LpwQKYplcVeaI42qtAqR3Ger9EmfbJ0XmmO3TWNdnbZzxyw== X-Received: by 10.98.57.14 with SMTP id g14mr34664707pfa.23.1473269198514; Wed, 07 Sep 2016 10:26:38 -0700 (PDT) Received: from stb-bld-03.irv.broadcom.com (5520-maca-inet1-outside.broadcom.com. [216.31.211.11]) by smtp.gmail.com with ESMTPSA id n3sm50498517paf.13.2016.09.07.10.26.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Sep 2016 10:26:38 -0700 (PDT) From: Florian Fainelli To: lede-dev@lists.infradead.org Date: Wed, 7 Sep 2016 10:26:34 -0700 Message-Id: <20160907172634.32710-1-f.fainelli@gmail.com> X-Mailer: git-send-email 2.9.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160907_102659_603370_F09C226E X-CRM114-Status: GOOD ( 12.67 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c00:0:0:0:242 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f.fainelli[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid Subject: [LEDE-DEV] [PATCH v2] toolchain: Rework external toolchain libc selection X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Fainelli , nbd@nbd.name MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Make it a choice menu which offers the 3 C libraries we know about: glibc, uClibc and musl. While at it, make it possible for the external toolchain libc to select USE_GLIBC, USE_UCLIBC or USE_MUSL which is used by several packages to conditionally include specific CFLAGS (e.g: iproute2). Because USE_GLIBC et al. can now be selected by external toolchains, we need to restrict the per-libc menus to check on !EXTERNAL_TOOLCHAIN. While at it, make musl the default C library for external toolchain to match the internal toolchain. Signed-off-by: Florian Fainelli --- Changes in v2: - do not make musl broken - make musl the default toolchain/Config.in | 21 ++++++++++++++++++--- toolchain/glibc/Config.in | 2 +- toolchain/uClibc/Config.in | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/toolchain/Config.in b/toolchain/Config.in index 75dc5361a682..7ec1875862d4 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -96,17 +96,32 @@ menuconfig EXTERNAL_TOOLCHAIN default "/opt/cross/powerpc-unknown-linux-gnu" if powerpc default "/opt/cross/x86_64-unknown-linux-gnu" if x86_64 - config TOOLCHAIN_LIBC - string + choice TOOLCHAIN_LIBC prompt "Toolchain libc" if DEVEL depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN - default "uclibc" + default EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL help Specify the libc type used by the external toolchain. The given value is passed as -m flag to all gcc and g++ invocations. This is mainly intended for multilib toolchains which support glibc and uclibc at the same time. If no value is specified, no -m flag is passed. + config EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC + bool "glibc" + select USE_GLIBC + + config EXTERNAL_TOOLCHAIN_LIBC_USE_UCLIBC + bool "uClibc" + select USE_UCLIBC + depends on !(aarch64 || aarch64_be) + + config EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL + bool "musl" + select USE_MUSL + depends on !(mips64 || mips64el) + + endchoice + config TOOLCHAIN_BIN_PATH string prompt "Toolchain program path" if DEVEL diff --git a/toolchain/glibc/Config.in b/toolchain/glibc/Config.in index 036604f4a7c0..5adbeb6f8245 100644 --- a/toolchain/glibc/Config.in +++ b/toolchain/glibc/Config.in @@ -1,6 +1,6 @@ choice prompt "glibc version" - depends on TOOLCHAINOPTS && USE_GLIBC + depends on TOOLCHAINOPTS && USE_GLIBC && !EXTERNAL_TOOLCHAIN default GLIBC_USE_VERSION_2_24 help Select the version of glibc you wish to use. diff --git a/toolchain/uClibc/Config.in b/toolchain/uClibc/Config.in index 5793bb779f5c..3bcb0037e9f6 100644 --- a/toolchain/uClibc/Config.in +++ b/toolchain/uClibc/Config.in @@ -2,5 +2,5 @@ config UCLIBC_ENABLE_DEBUG bool "Build with debug information" - depends on TOOLCHAINOPTS && USE_UCLIBC + depends on TOOLCHAINOPTS && USE_UCLIBC && !EXTERNAL_TOOLCHAIN default n