From patchwork Tue Apr 23 21:27:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 162736 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp4265456jan; Tue, 23 Apr 2019 14:27:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNxTDqwoLg1xq7UZ4586W+nF7PfoXjX+o0UnjfTHCUEgUIJ7qhvdn52gGJtTT6UpNHrgfD X-Received: by 2002:a63:6849:: with SMTP id d70mr26057617pgc.21.1556054869558; Tue, 23 Apr 2019 14:27:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556054869; cv=none; d=google.com; s=arc-20160816; b=se9SuL9dRCEyDPw6MdAWXpcwZkwV9nnGwnZyCWoIyAIpThNz0DCkPQTdPwrxiGefbD Zlq2eVQgzb6p+v2ZaiEMDdQ83tVgy1qjW6GKkqMn/HtCV+MvzBO4mvryYrLH52kCPqx/ 2M3jbxZQxxuOxPShmrOeG/XNw6biTi7ghSN+om8PiUzX8EZFjNmKzrpX6E7BJotIkSIu hmgcg+HiZz8GId3M00IJKAKiu6KA0RtFQYg0e0iNTpqj3A40tp2pV33iFuTcoWvk/MTU QiWXsrefbbIQndyVtcjrz089gV5rPMY2cd0DSzoIvr5g06gVoMYlBEp5UXviCM5cK2A1 pivA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:mime-version :message-id:date:dkim-signature; bh=41aTYzy88TUD1CyveIip5i2BawgilNUUCUyijcx9oaA=; b=wVX77jGKAx+0c4YA5HsnAlkv9pk3qBz/JA76/2VNFNmMuOHpMo2gObOLblSXvJB2bw bvPTzrwf/OqQpU+AQufPKJRFVYAxnwM4w/XOfkSZNXaOjeQljvjjnILgx6T7vcUN3Tb1 UZh5s/Gx3ZrgYyNU5x3DM3TDijVCj9kdLIJKvhqe+2j63AtS8TlgAnKGZ/IxVW235FlA dlB0gZAOBalj5aqtt43GEWpnqRRR7o5QqdrPf0uy41ZxrrUSy/i0/vqdUWurI1QABg02 5QqZzvFuKR0mQe/NPMYw8+/0u3gXKTXUeE927OQH+ECRJaug14uByNXjVE7S80rCKgPY AFOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=uR9fVOkR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x26si9169049pgl.274.2019.04.23.14.27.49; Tue, 23 Apr 2019 14:27:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=uR9fVOkR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728034AbfDWV1r (ORCPT + 30 others); Tue, 23 Apr 2019 17:27:47 -0400 Received: from mail-pf1-f202.google.com ([209.85.210.202]:48035 "EHLO mail-pf1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726075AbfDWV1r (ORCPT ); Tue, 23 Apr 2019 17:27:47 -0400 Received: by mail-pf1-f202.google.com with SMTP id n63so10440179pfb.14 for ; Tue, 23 Apr 2019 14:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=41aTYzy88TUD1CyveIip5i2BawgilNUUCUyijcx9oaA=; b=uR9fVOkRKS7Tscs+Ze0Tagavk/8dShLsyV9Xl2jtuL/vKkp0DuxgPCs8GUxx3nhzJL JS0/QboYft1EWQCEotbrAIfCgSwLSI1lwxv00p4VaEeu4NxQDjk2OPqzFJf0nfO+vDdt a0KQAkZx6xTNXFfMe9/SIz2c/9EBQOcowOk6aQNQEz9I0D9WksPeGT6HD+Vy7betuVJB A7m9ey7OSCaq05YaRw8vpne3+8n/Msr76b9nz2ikn8MAtVcHy06+rVBZKR0lJCq5nsAb yHTPMN612oofssR6+VKVdg9GWiwVL0cmCOqg5i2nvG6yrAK9Nf8yEiUxhBa6SbnN6DnZ x/vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=41aTYzy88TUD1CyveIip5i2BawgilNUUCUyijcx9oaA=; b=dcj1wNFx7b33zH8uhqyvsZ9XyyxiAEVIIhDUDgTFOPUFQDmH+TN4YiOldpR8M2ntZZ 3d2O9rspBPyB+tq2YYqT5DquDBIW+KDuL/hGkgtpzRvsYDyIRuaKRBHacU4HH+Jld3Dm dnRI+IWHtDX/nI2QVz38mNrR8NQVRp5+oIwImKv/jhN0ZnZqMgGbQARu5V0Lf41Agjat lY+Sx9YxMKifkCh9vQH2YyoOOTs/XX7o+j3YtEOD0MqBZgqW9nAjrmQryC8Rt/J5tAjW gAtOkGSr+Q87FnvPcCS6KMo35f8EoOXrOdjswD/1q5oKEfv6L9yDxlLsfnDGcboX+FRT N4Gw== X-Gm-Message-State: APjAAAVBxV2Ie8wM0g2lzZTUv5qzJ40L07Uo0miHCtsWVTNMoE9yB9He R6bHPHjidZ8TwMr14hYStK1K3ftqICLc21m+s+Q= X-Received: by 2002:a65:4183:: with SMTP id a3mr26848110pgq.121.1556054866607; Tue, 23 Apr 2019 14:27:46 -0700 (PDT) Date: Tue, 23 Apr 2019 14:27:41 -0700 Message-Id: <20190423212741.12219-1-ndesaulniers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.21.0.593.g511ec345e18-goog Subject: [PATCH] kbuild: drop support for cc-ldoption From: Nick Desaulniers To: yamada.masahiro@socionext.com, michal.lkml@markovi.net, corbet@lwn.net Cc: Nick Desaulniers , clang-built-linux@googlegroups.com, linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If you want to see if your linker supports a certain flag, then ask the linker directly with ld-option (not the compiler with cc-ldoption). Checking for linker flag support is an antipattern that complicates the usage of various linkers other than bfd via -fuse-ld={bfd|gold|lld}. Cc: clang-built-linux@googlegroups.com Suggested-by: Masahiro Yamada Signed-off-by: Nick Desaulniers --- This should probably wait until all of the call sites have been cleaned up. Masahiro sent them for arm and arm64, while I sent cleanups for all the rest. Documentation/kbuild/makefiles.txt | 14 -------------- scripts/Kbuild.include | 5 ----- 2 files changed, 19 deletions(-) -- 2.21.0.593.g511ec345e18-goog diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index 03c065855eaf..d65ad5746f94 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt @@ -437,20 +437,6 @@ more details, with real examples. The second argument is optional, and if supplied will be used if first argument is not supported. - cc-ldoption - cc-ldoption is used to check if $(CC) when used to link object files - supports the given option. An optional second option may be - specified if first option are not supported. - - Example: - #arch/x86/kernel/Makefile - vsyscall-flags += $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) - - In the above example, vsyscall-flags will be assigned the option - -Wl$(comma)--hash-style=sysv if it is supported by $(CC). - The second argument is optional, and if supplied will be used - if first argument is not supported. - as-instr as-instr checks if the assembler reports a specific instruction and then outputs either option1 or option2 diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index 7484b9d8272f..fbfb37d1bcc8 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -138,11 +138,6 @@ cc-disable-warning = $(call try-run,\ # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1) cc-ifversion = $(shell [ $(CONFIG_GCC_VERSION)0 $(1) $(2)000 ] && echo $(3) || echo $(4)) -# cc-ldoption -# Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) -cc-ldoption = $(call try-run,\ - $(CC) $(1) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2)) - # ld-option # Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y) ld-option = $(call try-run, $(LD) $(KBUILD_LDFLAGS) $(1) -v,$(1),$(2),$(3))