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: 10085811 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 37026602BC for ; Thu, 30 Nov 2017 23:44:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24A242A42E for ; Thu, 30 Nov 2017 23:44:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 199F32A422; Thu, 30 Nov 2017 23:44:12 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A35092A422 for ; Thu, 30 Nov 2017 23:44:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=dst3kvxSNUSJ5d4Dm58+KMOMj+TWUcZYUGLgrTNAErU=; b=hb+8QRoq8yKn9g6MKA4JouLyq9 ai5aNZrvTKNyfS6e4tRh2m69oCXOJrXv+QibH0c3SK4dm20Y611f0M4B5lnnwUhjQs6LYdm61/mjb ASx+Wl+M0dka61ENWz1mwEw+q6vFVFJ73d4JgzPG31c4uvpEuxPPA0OwE8iH4rBV42gHd/0nJVMsD WJAlGnyxP4mUSGcEPw/h+2K+7E3OMXHDvKCz+KNGI0S5X5tKl139AYO7XYe7KzfPHS+BwL94DdcOs 33Lt3WsCTTzOLUc+gAHmYiQF33UFSgg5n2+CJresctEOHPV0BXuZgyOlEH+uX75XfK6v3JX165lGu 13d566hA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eKYUy-00055h-JK; Thu, 30 Nov 2017 23:44:08 +0000 Received: from mail-it0-x243.google.com ([2607:f8b0:4001:c0b::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eKYQY-00013N-3x for linux-arm-kernel@lists.infradead.org; Thu, 30 Nov 2017 23:39:39 +0000 Received: by mail-it0-x243.google.com with SMTP id d137so514680itc.2 for ; Thu, 30 Nov 2017 15:39:15 -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=LSlOjeVYolvQjYwCEucdIDKvq0dzRnnI0UHkD1FkkVtUHXbX/LaXappVRevEsiDBOw mm2e1XYrRc55RlktovUaUeAxQ+8ICm6yj+h+b8ZQD82/QW/ZlYa9ad9w2ImBocvuzARZ Z5I6T1u2yUZx3lUcr3coTD7MIu9373vdkg22mlSLsn/SuuoTgyr68ewe8Azsb4KA+ekH HPHXZ/Fp6/w/bKI1JY5/jz2wS4zqrZgUXlpkzGd5QqDIE3zVu2MB1egdmpagQMg+NJLf qNroYoWND8giwpRcu2p1Vzzw2LwTtW+lqevjpCbDDXVKtzLDPoAh5lVAb6r0AfBErUcl OFyw== X-Gm-Message-State: AJaThX48Q7ZjmUWxvbUjGj53XTcNxSaDA4TxUZzvGCuTZ8QuS7g2fg/X CwyaCrOXeSjYX1Har70AKkVHlQ== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171130_153934_850857_DBDAE910 X-CRM114-Status: UNSURE ( 8.49 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sami Tolvanen MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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)