From patchwork Mon Feb 11 19:30:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 158028 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp2983803jaa; Mon, 11 Feb 2019 11:30:37 -0800 (PST) X-Google-Smtp-Source: AHgI3Iaw+Y13tL9stiAkIfIzmbiWQ7NX2rWssCPALRdTYOnL/lS0lla1lHehPJ7jvGa5kMf//55s X-Received: by 2002:a17:902:bd0a:: with SMTP id p10mr38005533pls.322.1549913437618; Mon, 11 Feb 2019 11:30:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549913437; cv=none; d=google.com; s=arc-20160816; b=LassWBcbCzAeXPqWy4Ne0ogLpOPbSvMLm19eVFw/inbZm/XTmSNTaWPPUK56WmUFiN 2N0cHL+Jvck/xaa5FFchaLnE7WV2j5/pFe3fOqtMJjvtvNNotYBlcvXELM20YST8MZz4 Kf/KxGMexU7P4DCaAa7RoPGER73eDe8NLCmlJy6cUwNpj6RXoJMnnW7C8JkTDa9mDElz 9OwCrGVS2yhOPSJFrtLhbyt4A6yqmVjZtO3CPOUxaG5n9p0gUjddTeKoKPQE19N6GDKr Rs2UIX0dHJu2BIeetonIYw9/Fqa/bckHqi1lZ9B3SI1ZD+884tQNJ/8QZ9a5h0xI/yuL On/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=yTmTM4lUWy38wNpJAAj82b5/JRtPQPUWiVhvkLc+GmU=; b=nBimBkuxuN4JCd38z8GsYMbDbury9+XfapT3PbZithsZBjjFVrdjof+q5+3XoPO8QN jNqRwbuYTBm0MuKHTGENQBYiHikxQeScfj9T/PTo4llRE3X7elKhVdA7eADZ2AhXgZAy rA7wOacJfpK3NfCKMtFeULFVazEqPH7vL6LdiBwKMIUiupNHrgsdLHsxknQ3X6wRx8xj 1PC5XxsSl5Ok9jyvumx7xJ5iYEsrO/2UIcbdeWMajeymECR3lbl4jcSNBBFWsj9fgfvo SZ+CAi2j0lmCkQ6RKsn2nITFE9j2n/TF0oBWd99n6Diu1rCByVEmXw84fsT2wTAqPmdk l2hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=IgD0EQVv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10si9483622pgv.14.2019.02.11.11.30.37; Mon, 11 Feb 2019 11:30:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=IgD0EQVv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388235AbfBKTaf (ORCPT + 31 others); Mon, 11 Feb 2019 14:30:35 -0500 Received: from mail-vs1-f73.google.com ([209.85.217.73]:44277 "EHLO mail-vs1-f73.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731469AbfBKTae (ORCPT ); Mon, 11 Feb 2019 14:30:34 -0500 Received: by mail-vs1-f73.google.com with SMTP id o132so24536vsd.11 for ; Mon, 11 Feb 2019 11:30:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=yTmTM4lUWy38wNpJAAj82b5/JRtPQPUWiVhvkLc+GmU=; b=IgD0EQVvZuRTW8V34xCcsd5j+kuukE2iC4AfflnsyCWMauneJH9QQAwi3n3dFkIVl1 yQswrFqCX01hxOU9LOZO0jzflZSDdobLsqRH5CHZZS9fyZhRZN6ud1RvJO39OL8fdmbt yLJy++glVR3+LvhqrpbOMBvg79T3MIgcnDdm7OK9ePSvhksVKeSMnZwAsu1RJPhY8pVF UAUdVqmig6Bg1NRh1FsbaVldgBDaN9hsdr5ZXzn4pVerj9lk7g8t8xyKGo6LarW5hRMs Q3HUQFQaraxBEnLMlaCLxHCQs0YFbjOCOpL7Jt8ePKT/VScKQENAsWNu/THSYgipbRiR /zDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=yTmTM4lUWy38wNpJAAj82b5/JRtPQPUWiVhvkLc+GmU=; b=Hij+j741/9dG4TJXNJ+M5xl/pORQm7UTUanNurKoqGLyE/5e7hAEsLVPaRvPql9OnW R2z8tkDgNdHfRG2FdJiAi003yiGjp5jtGQgMj1N+FNZ8sSBFCIzw/L1Ff3esRUsUtJma xsYyNhyVmnHZN4PcT2MiGnyvG3KIp6CRbTdexBAOL8YYtRaBlXH+yoxxXzb3ZHuhLbhS azg7LzrdeBX8wUsn3M4/qGwcva2/8Xbt8AZmlkOhu0+hZ87r9J7ZbjMB5duyjIRQhO/V bRAqRKEdC2Tu08rm42QA0h2LI5Xu9a6J6o4FJrI1zOV3ZE8FKutgU0tzJolvUywg6VbT coUw== X-Gm-Message-State: AHQUAubimfz/4whBWKOaxyDBCCNLDRESPpkWCxcjJM6hIEwgeuXhnEsI W6LGOzG4+vVoQXIbdfH3ftEPQ7oh+PlbtWEm8g4= X-Received: by 2002:ab0:4e23:: with SMTP id g35mr23818918uah.0.1549913433804; Mon, 11 Feb 2019 11:30:33 -0800 (PST) Date: Mon, 11 Feb 2019 11:30:03 -0800 Message-Id: <20190211193008.24101-1-ndesaulniers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.20.1.791.gb4d0f1c61a-goog Subject: [PATCH v2 1/4] init/Kconfig: add config support for detecting linker From: ndesaulniers@google.com To: yamada.masahiro@socionext.com Cc: natechancellor@gmail.com, sedat.dilek@gmail.com, keescook@chromium.org, samitolvanen@google.com, michal.lkml@markovi.net, akpm@linux-foundation.org, hannes@cmpxchg.org, peterz@infradead.org, linux@dominikbrodowski.net, npiggin@gmail.com, mathieu.desnoyers@efficios.com, gor@linux.ibm.com, adrian@lisas.de, rgb@redhat.com, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Nick Desaulniers Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Similar to how we differentiate between CONFIG_CC_IS_GCC and CONFIG_CC_IS_CLANG, add CONFIG_LD_IS_BFD, CONFIG_LD_IS_GOLD, and CONFIG_LD_IS_LLD. This simiplifies patches to Makefiles that need to do different things for different linkers. Cc: Sami Tolvanen Suggested-by: Sedat Dilek Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor Signed-off-by: Nick Desaulniers --- Changes V1->V2: * Add suggested, reviewed, and tested by tags. init/Kconfig | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.20.1.791.gb4d0f1c61a-goog diff --git a/init/Kconfig b/init/Kconfig index c9386a365eea..b6046dcf7794 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -26,6 +26,15 @@ config CLANG_VERSION config CC_HAS_ASM_GOTO def_bool $(success,$(srctree)/scripts/gcc-goto.sh $(CC)) +config LD_IS_BFD + def_bool $(success,$(LD) --version | head -n 1 | grep -q 'GNU ld') + +config LD_IS_GOLD + def_bool $(success,$(LD) --version | head -n 1 | grep -q 'GNU gold') + +config LD_IS_LLD + def_bool $(success,$(LD) --version | head -n 1 | grep -q 'LLD') + config CONSTRUCTORS bool depends on !UML