From patchwork Thu Nov 30 23:39:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sami Tolvanen X-Patchwork-Id: 10085807 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 B2A67602BC for ; Thu, 30 Nov 2017 23:42:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A37062A42B for ; Thu, 30 Nov 2017 23:42:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 985AF2A430; Thu, 30 Nov 2017 23:42:01 +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 01F6A2A42B for ; Thu, 30 Nov 2017 23:42:01 +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=6Xwh1SPRuhRq/VQIkzUy00ZDSczZWCcKu8r3eZI1jF8=; b=Zwp5xLXdDcqVsX+EkspQNq24CY R976A9aIjMdHh8JXR77cgukdfZwxQkbYTWZo0L0EgJr4Yx+KEnOTYEOW9wSQrvUI6nrq6Iq48UpD4 fqoLbVjVOmwzNz/C2GkgKTSoX3q4Ua3gq7HWp2HiEf5+ZU0s5iIBUoqHMaxaEM/Vohv3s3H9ES5wY R8lOXtrWJKN6E9g7wJySSVwgDi8WYon379I5ZvdGe8BvZCQvaFeQFx0hsJ7G93Nv1bfCll+XIn476 sE5Fs6UI/cIB54xz/CN95WQQTlns6WKWMWOgtf8LJyRmVf5/+GeqZyjhp3TOZiyObzcANzfzjsEpP 8nmiw9kA==; 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 1eKYSu-0004FH-Ak; Thu, 30 Nov 2017 23:42:00 +0000 Received: from mail-it0-x242.google.com ([2607:f8b0:4001:c0b::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eKYQb-00014b-9C for linux-arm-kernel@lists.infradead.org; Thu, 30 Nov 2017 23:39:42 +0000 Received: by mail-it0-x242.google.com with SMTP id f143so528198itb.0 for ; Thu, 30 Nov 2017 15:39:16 -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=HoGKLYpjsO6oXYncNFfdNYKidAnzCh/Y83uTqBj2Lfs=; b=IyxHvcQDCefTeqpmTWOx4B4RG64QcIESxAZSFqsR6pxlF05zkAXIgBOJ0lCNB7y7IW 7EJOJoT7DOFtLlzu1WIirl5RXB23Ut4ZHe28r9VfnyNBipkXKQ01v22WnGBK27ad6FmU 82DQu17NT+FRYsve0IqNkJXVhopT04WAdacCCe1VYWVCuZM76v3PgZoeOFtAExyZAofn eRplXYh6FP5mQ4wmk+k5GJwulATLBIMAnzM0txQLjo+kIFT0+X7eud+qwPELJhuoCQA3 9Icjxp4OunzxgfScVjVDQmTHmMJ8M3D8UTIXFTTspwowANBecZ98X6Ridas0PnnpVU8Q CDBw== 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=HoGKLYpjsO6oXYncNFfdNYKidAnzCh/Y83uTqBj2Lfs=; b=a6SVvk+FwLgAH/Big6jiW6wGaS10asQAO706TJ+/KZAK6cWYU2vs53VPDD3WbwmjOy wE3jZJbyvIRXg1t92rGCKMWhu53cuMz/MZhspITMy1gMbMWnFNC1oKm1lcu9WwK2Frc2 N/yRbBbvn1X/tOKCav6/7g2dWww8r5Tz8cFRvq9/FuFT1H99CYQRdwxrqXw/a+s0Jfn5 xMNaOLzojfybAEfVjb+Qme5lYweCJcmJkEr0TdlwIcCnPLpLmK2CJt9zn7dd0Uw7CErk 1OKLYr071QqOop7N/veeSQiSweJegsnwStVVtlxymAcLpd/AOgadpWMoHl9f9wWKXzn1 uvbQ== X-Gm-Message-State: AJaThX4pK3CBLdZQsc/SmQ27mXMAroWKajtigsk3dIQf75Pu69Qkupbw 4J0ZBzGEvwUcsOQht5Bo6Nixbw== X-Google-Smtp-Source: AGs4zMZfAp2sBcXYDIACGdsRU0AeZ/orgu6FKxOHVv6Z330tzzAjjB5EC66yiOqwC+aj+2PI/zMq+w== X-Received: by 10.36.2.212 with SMTP id 203mr5640602itu.43.1512085155551; Thu, 30 Nov 2017 15:39:15 -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.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Nov 2017 15:39:15 -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 4/7] kbuild: add __ld-ifversion and linker-specific macros Date: Thu, 30 Nov 2017 15:39:02 -0800 Message-Id: <20171130233905.130602-5-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_153937_637720_4BE3BC98 X-CRM114-Status: UNSURE ( 8.13 ) 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 899863e4cd05..2991b463b4ce 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -285,6 +285,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-ifversion +# Usage: $(call __ld-ifversion, gold, -ge, 112000000, y) +__ld-ifversion = $(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-ifversion, bfd, $(1), $(2), $(3), $(4)) + +# gold-ifversion +# Usage: $(call gold-ifversion, -ge, 112000000, y) +gold-ifversion = $(call __ld-ifversion, gold, $(1), $(2), $(3), $(4)) + ###### ###