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: 10083975 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 37C8160234 for ; Thu, 30 Nov 2017 00:13:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28E5329D78 for ; Thu, 30 Nov 2017 00:13:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D82329D80; Thu, 30 Nov 2017 00:13:53 +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 AAB9A29D78 for ; Thu, 30 Nov 2017 00:13:52 +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=SMrMgrO8shfGMU5Z+cVMQ4MLiqDMN4Mi8VwBQ8aQi7c=; b=tLLf9Rk1ycbMuGAtdlXEkT+DAU UiEfuBE0MJAPcWnZx6TvCYAs5ZLs9zjkCCk4KC59MNDV6x0lq1U62JPPSGUXwdfxMniEPwjQGHfW3 JGvhMu6H4Qt8L8QQoKVpkftVez0QbMnGzf+2PJJa+RrfCluD5wD23V6+usYoG8kVbD/hU9J/A20Cu BvWniES2iKaCpSbcONvijNeaMHyvptOx+P+fT//szQCVyrRLnWd4FIKpF4f22JAkShD1lMGjY+jmE uD3ZbY5Qj+ExLLF8zIABSmLfmxuRlTRb0jqB+/7EieniJSoV3dBt85ck2KgE8DhikFg8hJg50QpK6 eX1RRB7Q==; 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 1eKCUB-0006W1-2v; Thu, 30 Nov 2017 00:13:51 +0000 Received: from mail-pl0-x243.google.com ([2607:f8b0:400e:c01::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eKC2U-0003Yt-69 for linux-arm-kernel@lists.infradead.org; Wed, 29 Nov 2017 23:45:19 +0000 Received: by mail-pl0-x243.google.com with SMTP id bi12so3052808plb.6 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=VJSu+c/vKYx3pxF8z9iVSULMrJHg3BcJO4uCLeQR4BaGj2vpGS7KBJZw5p2RpPrTBn htXXEzCAw0srjCh1zobobpSPON4sjjF98C4UqbKCYq9Nrrua+5EYNf9InCzalhOpfJmL 43mC3te6jJZNq4brOTm4mFCvXMsmi14Dt5HsmDjMELo1gWI5w9LuS0FTQ9JvxBB4KLVU 3AAW3jUmNP7H5qYNXx6K0SdD/M4L3QSrUZok1ib6UZoKAOJ9Ko2WKFrL1dZa5ViiAEua RxZvP9D+RsYNfjbRKSrYzRjkF6ROYNRqFWQlP5w1M/bglGyXq9lQ1zM3963zcwEL3xII 5MOg== X-Gm-Message-State: AJaThX4vGdE/tPIslhhdY8qFEgvLMrCrUAwqw29ckaUFkTdSIEjYga4I 0xek9jnds6/WXsRNE3g5KT0+Tw== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171129_154514_331860_7CE16CEA X-CRM114-Status: UNSURE ( 8.08 ) 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 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)) + ###### ###