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: 10913763 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AE511922 for ; Tue, 23 Apr 2019 21:27:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D752285F7 for ; Tue, 23 Apr 2019 21:27:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8EF9C288D2; Tue, 23 Apr 2019 21:27:48 +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=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL 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 2785D285F7 for ; Tue, 23 Apr 2019 21:27:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727918AbfDWV1r (ORCPT ); Tue, 23 Apr 2019 17:27:47 -0400 Received: from mail-pf1-f202.google.com ([209.85.210.202]:56367 "EHLO mail-pf1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727831AbfDWV1r (ORCPT ); Tue, 23 Apr 2019 17:27:47 -0400 Received: by mail-pf1-f202.google.com with SMTP id l74so10402642pfb.23 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=UKkH6pXorjJgPgXYsVOvtAR6x4P/KhubLDxLKp5BBKlQQ78H1ZkgcKVwApGtg+PZFQ oWUtTtJr/Fx3JBvgZj5K7a5Z3F4Wy10KYePaMSzFYbAJeN7QriVWCyoDIb979dAQ/SQk r5qtYrpf4dLDpHL/mBaRfS1eO4K4H7pWHTcMAI9bMd9et5ywv3NK4E/ypSv8L9LfnpBz oWc9vv5GA2DbLBfDPCujEytBk/yKDpSNa04H7n1spiTZtAygX+lwLtqkDkz8QqCBfRD0 wYlkhj+8Ee9xjFQ/va8W293fcQmJ2dRUl3cknV3FnfXH3N4+7mjXtzg8JZsy9gHf4tyF 4/og== X-Gm-Message-State: APjAAAUTxBcjJ+B0RORdqsijfrs7TqoNcEW8nxOcVbZK6X0szGnV/lHg KJCxdg3zlEzLiruT30TEAldDT6QdraF83g6X4cE= X-Google-Smtp-Source: APXvYqyhG2vTC3jWAx/p08kp5ptoz96a2fY+KEPJvsAxWPyxEBF38D9nK/P44eHwWUCG6mBl9aGJfLaP27cml/TPvBI= 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-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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))