From patchwork Thu Feb 7 21:03:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 10802165 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 B637E14E1 for ; Thu, 7 Feb 2019 21:03:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A35EC2E5BB for ; Thu, 7 Feb 2019 21:03:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92DB12E5C3; Thu, 7 Feb 2019 21:03:14 +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 3E7762E5BB for ; Thu, 7 Feb 2019 21:03:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727281AbfBGVDO (ORCPT ); Thu, 7 Feb 2019 16:03:14 -0500 Received: from mail-pf1-f170.google.com ([209.85.210.170]:43575 "EHLO mail-pf1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726832AbfBGVDN (ORCPT ); Thu, 7 Feb 2019 16:03:13 -0500 Received: by mail-pf1-f170.google.com with SMTP id w73so526586pfk.10 for ; Thu, 07 Feb 2019 13:03:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc; bh=V7/zy2qc/meT0RgCALd3iCTlcjScmY/bu3M+47AUlj0=; b=ZCZ/3PKsNhdmgLasQ25L63RKyDoFyHDShr/jPsLTyh4rBOUy56Gr5acXcQqd6tm2Ge Cdxc/5bRGTRQDFiXloxissGQubJADGh2Q1aOMzpCzr4ut1wrcZbeL2YDcFt49XPcqDNv vvxIV6ze765tWFmJn+l1H6r0KIJPxlnTiVWN+4EpiyZyRmh5ALCOZj/Zns3S3d9tt5Z9 nxdMeC/DBaWEAa4Oir99Y6Q7i/d2L9mW52psWPuODk05ZWy+X368t5J1OrlhKRxLpeFA jTfAgYN08wQ5nWb2ifi8OOnm/rGibKxmURADjQvW9G7/07jwXI572NCXH1p+C7qkMAG1 OLnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=V7/zy2qc/meT0RgCALd3iCTlcjScmY/bu3M+47AUlj0=; b=c2k6Y7YUHNIRCAjEvSmPCJdcmDWD6nvHBqdgmynCSn9wbzTSptQH6yYuKr7aPBEfep YCSCk1w8wXHq0yNB4nJoV4ebe/LCDc42AV77tnKhbJxAPjzjA7yGUWRedRq2SToZ+oTL xxksM0lCMYVKB/qvcuDALFuDTxgWGNWWblr2ZBZ9PCBZrTomdfmoa+EOxFYniQrshos6 0kBrEIVO9XZ2OWhrgqpiFXF1vTkgSI2byHVpUklVcQR6CQvLmtVebHPNt+UdseJRJD68 LG03UOP+X+IEUOD8fBpDPDIfJDkqRDcs9Pnqqe02YAPARCChCKFKYbiJRRDd9VCSZQjJ w+wA== X-Gm-Message-State: AHQUAuargsvupBGQs9/XqXP9OHLT+9XOYURkVM2J3BP3UaYgMBiXyvAJ 8TRy3JcSgJQxLmI+gj35o8fsx0NAktfYTXLU9xCqOwtGVdMr9w== X-Google-Smtp-Source: AHgI3IZpgG0spRmYJbSbpRJA3EdMDajZS+TRbhPVizYsc75ct8q4w/rYv8qWb+K0wiLtcSE/E/mJ14BR72Z9ANrhNmU= X-Received: by 2002:a62:109b:: with SMTP id 27mr17977638pfq.227.1549573392859; Thu, 07 Feb 2019 13:03:12 -0800 (PST) MIME-Version: 1.0 From: Nick Desaulniers Date: Thu, 7 Feb 2019 13:03:01 -0800 Message-ID: Subject: CONFIG_CC_IS_CLANG To: Masahiro Yamada Cc: Nathan Chancellor , Linux Kbuild mailing list 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 Masahiro, I was looking into sprucing up Kbuild for improved LLD support. One thing I was curious about was the different checks for clang in the top level Makefile. How come a change like: doesn't work? It's odd that later on in the top level Makefile, we have that kind of check. I was hoping to do something similar for LLD, but it seems that the config options are not defined for that particular make target? Does this have to do with config-targets? diff --git a/Makefile b/Makefile index 3142e67d03f1..525b3fef7d27 100644 --- a/Makefile +++ b/Makefile @@ -489,7 +489,7 @@ ifneq ($(KBUILD_SRC),) $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile $(srctree) endif -ifneq ($(shell $(CC) --version 2>&1 | head -n 1 | grep clang),) +ifdef CONFIG_CC_IS_CLANG ifneq ($(CROSS_COMPILE),) CLANG_FLAGS := --target=$(notdir $(CROSS_COMPILE:%-=%)) GCC_TOOLCHAIN_DIR := $(dir $(shell which $(LD)))