From patchwork Wed Nov 29 23:44:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 10083923 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 E50A96056F for ; Wed, 29 Nov 2017 23:45:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D78D229C84 for ; Wed, 29 Nov 2017 23:45:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC13E29D52; Wed, 29 Nov 2017 23:45:55 +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 87AA329D55 for ; Wed, 29 Nov 2017 23:45:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753248AbdK2Xo7 (ORCPT ); Wed, 29 Nov 2017 18:44:59 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:35427 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753012AbdK2Xoz (ORCPT ); Wed, 29 Nov 2017 18:44:55 -0500 Received: by mail-pl0-f66.google.com with SMTP id b96so3077007pli.2 for ; Wed, 29 Nov 2017 15:44:55 -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=3dM+cMbXUDV8KftlnZtBpbRZVBOm9iQ9yQUeMnETPsE=; b=ZXsaHJdZMkwCh/r2vLirruD++6iAIPJw5aSkm+T/GuN1JD0OMIBiQndXFy7Aen+u0Y ODNnWd6ZuFE8USIU9XbJTJWItAPLmPcVl4Z6l4OzBXbRi3ZMtO3Liwp2VXi1Y3haSzHV UziP1C3XTPsNeKjHHn9eHO+QH6kmcq1BHsbBECWEDsUSQzYHCRbBpebH4LXxzh+3wIlL g85Jl5Ps65ybp0gvi6lHPjP8dnTgYaghuRdGQX7/ERmWwloWRD/b9G2h50XiZ7Gr3ljR fxGh0bzn8Uh/Z2P7REjJ2X7eONk3SgxPsHL9nl2z37Zx50iwoNUv28udRR3rPNwCsFuB 7mKQ== 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=3dM+cMbXUDV8KftlnZtBpbRZVBOm9iQ9yQUeMnETPsE=; b=iNYSGLP43UHLuy6VKPVBacitgMLSJJW4vJjTSKfLcJBAzWeICCqgOgPtHOZkmi4atz 29umd+Tm+4gD4/JObXBbj5pe03P0jGvrAGQr1Z6IYclJMHxoTkyZ5T2MET5qFgZyO/Id yCh0RGv51z2c16yWbh6IvFB9dYetMAO9ufAwl7c5U77x0OH3yrEjUHH/Hi4acfO2GXQD AP+hRLa/GfnqeCNUuVL89l2EpCzEFvwhCyKxpb8WKHOQ/ghatEATc9Lof0icfmA3lfRx MIlJnEIRGsvLZJiaO7S6eFTIb3vmsc/539/mOZu5cwknz7PUQq9N5Bzrb+vuohJ7QH5M G9vg== X-Gm-Message-State: AJaThX7znJsKTbyhiSbxHBrdGV40QaX01eTsc7appBaY2w9r0QR7Yism B8rcORxM/apQoOgLepmsZ7wlXg== X-Google-Smtp-Source: AGs4zMa6Vpw5FUtEBMmiAOvTfb5HPfGmeHzPPiGjNnw3b9ZhrVRZPjHiypaLHmojZVXaKKan+13JGg== X-Received: by 10.159.195.7 with SMTP id bd7mr574046plb.43.1511999094909; Wed, 29 Nov 2017 15:44:54 -0800 (PST) Received: from samitolvanen.mtv.corp.google.com ([100.98.112.14]) by smtp.gmail.com with ESMTPSA id s14sm5326948pfe.36.2017.11.29.15.44.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Nov 2017 15:44:54 -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 2/7] kbuild: add ld-if-name-version and linker-specific macros Date: Wed, 29 Nov 2017 15:44:37 -0800 Message-Id: <20171129234442.655-3-samitolvanen@google.com> X-Mailer: git-send-email 2.15.0.531.g2ccb3012c9-goog In-Reply-To: <20171129234442.655-1-samitolvanen@google.com> References: <20171129234442.655-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 Add macros for testing both linker name and version. Signed-off-by: Sami Tolvanen --- scripts/Kbuild.include | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index a7c7843c2cf1..5d286d69e8dc 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -289,6 +289,18 @@ ld-version = $(call shell-cached,$(LD) --version | $(srctree)/scripts/ld-version # Usage: $(call ld-ifversion, -ge, 22252, y) ld-ifversion = $(shell [ $(ld-version) $(1) $(2) ] && echo $(3) || echo $(4)) +# ld-if-name-version +# Usage: $(call ld-if-name-version, gold, -ge, 112000000, y) +ld-if-name-version = $(shell [ $(ld-name) == $(1) ] && [ $(ld-version) $(2) $(3) ] && echo $(4) || echo $(5)) + +# bfd-ifversion +# Usage: $(call bfd-ifversion, -ge, 227000000, y) +bfd-ifversion = $(call ld-if-name-version, bfd, $(1), $(2), $(3), $(4)) + +# gold-ifversion +# Usage: $(call gold-ifversion, -ge, 112000000, y) +gold-ifversion = $(call ld-if-name-version, gold, $(1), $(2), $(3), $(4)) + ###### ###