From patchwork Thu Feb 7 22:01:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 157782 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1200739jaa; Thu, 7 Feb 2019 14:02:33 -0800 (PST) X-Google-Smtp-Source: AHgI3IZQa8+/FzIGr/m5whrLZ2IJ5cBNWZk8ZtjPGLwarksWis8ho+/9jg8YoITNQ5rF/btz7OMg X-Received: by 2002:a17:902:8ec8:: with SMTP id x8mr19032715plo.210.1549576953176; Thu, 07 Feb 2019 14:02:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549576953; cv=none; d=google.com; s=arc-20160816; b=vdgj2EbzQ54lpNlazt0hdtfwS1c03YansehK36DseOnzx7JeCJjmQtMqQ0iflAaVx6 qtMkOiCJeGu++y44vFIS2AJajz9rNyPMXNIv5JU9JtRUY/7Rvo18Kql9i8DMOTKep1Qb Opg2sSXHVNWps4zBLAQWoIw6eXAXWgsgx/p6Tx4We7seGL3fLl778XTH64eAlE6M7koL oK8wKDxQ9hd+AxnVAc9c97D9+QkR1v/C/URPF4oAryyaSj2iLeGiKSYX8PEWfVi9LLyP l23J54ywgdhB4T/V6uJW9RjK/nhl/BgrwT8gc3+NgFSQ7naY//KayjKHGsk9lUC/d3qK SmYQ== 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=MqLuibBHajEelET2gmxRQFU5+ervUm+M6PMMM0jIz+k=; b=Qe0FVok3wN16knfRSokFRsYGyIghBxXAkejKnZsDNcMZ/oM000YcUeinqB/PcFnBH1 RkfZe4Rl11oMw2s5a5Qvq3kc9EmK2yUbXcBa3VHvdYSKv3QwYY9oMOMerKKSpT92Uq2U yi3MuGY+v++f/gEY7gmalL/XXyTXvTOVskhwieN9C9RqEKJtQLIJRozTNzoh+SoRPVn6 TFH+10E37Y67+OfIrlU6j+ODpFPpRHmpP95b9RZXBEP3j+Y9OruaYZzMFYn6qaFHP3YT yPQxhkQek2PFVL/hnHZT370XosxIENZCLGzKU58S0EQsrM5QFtorLyg5cm8Q2ly6X96b bCqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=NjzqXAPv; 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 u5si165606pgr.33.2019.02.07.14.02.32; Thu, 07 Feb 2019 14:02:33 -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=NjzqXAPv; 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 S1727083AbfBGWCb (ORCPT + 31 others); Thu, 7 Feb 2019 17:02:31 -0500 Received: from mail-it1-f202.google.com ([209.85.166.202]:41080 "EHLO mail-it1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726576AbfBGWCa (ORCPT ); Thu, 7 Feb 2019 17:02:30 -0500 Received: by mail-it1-f202.google.com with SMTP id 71so2301150ita.6 for ; Thu, 07 Feb 2019 14:02:30 -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=MqLuibBHajEelET2gmxRQFU5+ervUm+M6PMMM0jIz+k=; b=NjzqXAPv2Gw8MbNmaKl8Irqy4dtdTyhJaKdWzaw4RP1C7HT2CI16fy8ualj7GapIKe xUFEeAmjG0112J8IFKsNdet7r3fKZ0/bKmkZJHuesmNFEmJbrRdmF5gK4Gn3ciG/rDEP ZWZ2JVO7WQqtuTlFrvinw01+LGNXX2gGOvPmc5TDylF1MGJNGuX8jVtQt9NbjtztdFGX uBhO1DP9kUuWcl7gGnTRZH9wV0K0p7K6Q2GgsBnlsS2NMW8P/+Wpk+PbF2ld1SxoojoB fX9y4ed58VzKk/6+uFwRM5nsRpzZAJ5V5vQB2Bs9C+nm8a//QWSJ+dqZRKHF4Wc3jB34 yM0w== 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=MqLuibBHajEelET2gmxRQFU5+ervUm+M6PMMM0jIz+k=; b=VqC6P0XE2H7WL2XaBV7BvOSdyXLuW1EuGJqJKjPJRGsVYad5YsWi2gZv5vNXnvI4Tl lN88DXSeI4q/9zPiy3DOh436DhjK/wRaw9mkc5iOUTFTJXPCKrLew85tHrqxFJbjJmS6 rcFTVtHdjv5x5zMKyHCtxRCRoiYA/CTMzsyw8THuFKWVl/xAGbPfZtzNiuyRTmkoxaOq EjBS4kdZeR6ceB+Jz63PVAp7wjEpSuzMIuTiDIO/lFfK7NkDS1chUf4aQbARXec49IQx IoRhrO4y0dOEitBm8ukbEPk7hvVHSLYjgMJu5A4Gy9YqhdsCam3GCq6lpKXvTKDkiYjd wDRQ== X-Gm-Message-State: AHQUAubhyl2WiKqakY1cG+sD74C6eHWB/21UeD2hTOynoNc0x21D7hxt wFxmAPjdt1EXQMm8iKNEvUIvDM/VRFTGJkVD6P0= X-Received: by 2002:a24:5e90:: with SMTP id h138mr7648078itb.27.1549576950026; Thu, 07 Feb 2019 14:02:30 -0800 (PST) Date: Thu, 7 Feb 2019 14:01:49 -0800 Message-Id: <20190207220155.81351-1-ndesaulniers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.20.1.791.gb4d0f1c61a-goog Subject: [PATCH 1/4] init/Kconfig: add config support for detecting linker From: ndesaulniers@google.com To: yamada.masahiro@socionext.com Cc: Nick Desaulniers , Nathan Chancellor , Sami Tolvanen , Andrew Morton , "Peter Zijlstra (Intel)" , Johannes Weiner , Kees Cook , Dominik Brodowski , Nicholas Piggin , Mathieu Desnoyers , Vasily Gorbik , Adrian Reber , Richard Guy Briggs , linux-kernel@vger.kernel.org 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: Nathan Chancellor Cc: Sami Tolvanen Signed-off-by: Nick Desaulniers --- init/Kconfig | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.20.1.791.gb4d0f1c61a-goog Reviewed-by: Kees Cook Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor 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