From patchwork Thu Nov 30 23:39:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 10085785 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BB583602BC for ; Thu, 30 Nov 2017 23:39:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC2AD2A41E for ; Thu, 30 Nov 2017 23:39:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0F652A2DC; Thu, 30 Nov 2017 23:39:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 595352A2DC for ; Thu, 30 Nov 2017 23:39:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751628AbdK3XjT (ORCPT ); Thu, 30 Nov 2017 18:39:19 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:36188 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751980AbdK3XjP (ORCPT ); Thu, 30 Nov 2017 18:39:15 -0500 Received: by mail-it0-f67.google.com with SMTP id d16so527943itj.1 for ; Thu, 30 Nov 2017 15:39:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EYPs7LRefUM9pK/6E+B74WxKwcfX50XDLOlskgFJQlg=; b=VpZ/xFJV1rdbfiijeo6mvtyaFWvkGzLO67SGBboPYCbWGtIgZ1qsBPU9wy84cVAVcP EyjI5t4UFlFKmf2O2NPwW1H5LywDaUuE88hTOcBAQhvLcKBT6GB+lHBqTjVZeZf6h0WD zaQ/W+IydopC8tTYB8fMwGcxkZpt5gowuvpkuhzMolMLR4jrac8Rf/SK3p5Ms4jWBTsr DxQIzXsxaTqkyaDSXaOBWDbccMAG2Ue66EFENoT3iSPquPvHeYLpxTJI7UodPrNrXUSD /7Xox2/J4igSQlnFEJJVtWGCUIDkrnoHOrtGVWvvvEPb5YuhEIKjZYbNFOYuxwL51TuK I1Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EYPs7LRefUM9pK/6E+B74WxKwcfX50XDLOlskgFJQlg=; b=DoGI3X5a5aBF38XH/VoU1ZM3oZWzHmcw8fFpx7XOFoUf7E10CvThdQnRg6jeueoE4a WAjjt4jofsNkGMXjYwYP1xNWWOycwy/hm4rtu8oaC9Dvb0LXfZ3+omV6kROdArGlSJYb ECmWzN2j69D+93EwVrQ1ENXnOfUAb/k7x80zLLIR5+SpU9VJZoq3opS3mAAImNYPXLS1 nSZOuHy+ajbuiljR0UlOc8Ma8HmB9zKbRGiegu7v9WuIUs+6F8UuDlJzuCEtVr2a6/5G IXU6vV3O6f1qt6wRbtUhKEssZ9uD/V4VcWnTwxcyVrp3DZwkWeGMQLd7UXwM7LoW65uZ AVUg== X-Gm-Message-State: AJaThX63sf111fuAtdjDjhkhwdLYMID+FpeX/F8OKm1snNlX9HQkGmlj ypqfzOngt6zdwCiBVsTQhf263g== X-Google-Smtp-Source: AGs4zMb+ihYCsJB0GfE7cmRmTJM6Z0H6QWx+kFwGpHjrkwQo1XQjkmvK8iBNMJ38SsbaMB/DkpyoGw== X-Received: by 10.36.225.136 with SMTP id n130mr5514007ith.146.1512085154140; Thu, 30 Nov 2017 15:39:14 -0800 (PST) Received: from samitolvanen.mtv.corp.google.com ([100.98.112.14]) by smtp.gmail.com with ESMTPSA id h73sm2896676itb.21.2017.11.30.15.39.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Nov 2017 15:39:13 -0800 (PST) From: Sami Tolvanen To: Alex Matveev , Andi Kleen , Ard Biesheuvel , Greg Hackmann , Kees Cook , linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Rutland , Masahiro Yamada , Maxim Kuvyrkov , Michal Marek , Nick Desaulniers , Yury Norov , Matthias Kaehlcke , Nicholas Piggin Cc: Sami Tolvanen Subject: [PATCH v2 3/7] kbuild: add ld-name macro Date: Thu, 30 Nov 2017 15:39:01 -0800 Message-Id: <20171130233905.130602-4-samitolvanen@google.com> X-Mailer: git-send-email 2.15.0.531.g2ccb3012c9-goog In-Reply-To: <20171130233905.130602-1-samitolvanen@google.com> References: <20171129234442.655-1-samitolvanen@google.com> <20171130233905.130602-1-samitolvanen@google.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP GNU gold may require different flags than GNU ld. Add a macro for detecting the linker. Signed-off-by: Sami Tolvanen Reviewed-by: Nick Desaulniers --- scripts/Kbuild.include | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index eb2cf2780f6e..899863e4cd05 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -273,6 +273,10 @@ ld-option = $(call try-run-cached,\ # Important: no spaces around options ar-option = $(call try-run-cached, $(AR) rc$(1) "$$TMP",$(1),$(2)) +# ld-name +# Expands to either bfd or gold +ld-name = $(shell $(LD) -v 2>&1 | grep -q "GNU gold" && echo gold || echo bfd) + # ld-version # Note this is mainly for HJ Lu's 3 number binutil versions ld-version = $(call shell-cached,$(LD) --version | $(srctree)/scripts/ld-version.sh)