Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2748440ybb; Mon, 30 Mar 2020 12:05:04 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvkECj7kAptzLBx0eOrMicMGmB7h1ANWXOEAE+34TXsh3hJrzyUl/BxRQLeWPh/0ASsy+VP X-Received: by 2002:aca:3dd7:: with SMTP id k206mr602631oia.63.1585595104177; Mon, 30 Mar 2020 12:05:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585595104; cv=none; d=google.com; s=arc-20160816; b=UOmYFz7ymAg/fwRfIDYIQyqmclHuiksGMA2iWpJys4DZNeqF4UgNIxl+ubz42lDGEv 8oyahZA/H3dv4H3lCD+7hnFV4GsK2MlpafN/hqP0cMVHh5vhuLNjE3RbiMrDJtdFtbG2 bpbvIWbl964WxqoqB2EqWgOxAy4oRBOlA1yRjhJn5z5MiRKJSi5P+9uZZe1jyBuigt6R by417DU0rqby/PlU4LsfLiKcZ7ZUOkFwNeba3tJGGseJwn78JfsAykDQeD2DyQzQtGuN j8yXPLQA/C0SJZL9dvDDTljoE1Q/D4wZSEmyPkc2yDk4HR+KXMYLnzOWPeEUp2ficI3s 93gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=zeoBlPxZ+Ud3NYVMylVFKFU+gocBDIOivDsTMxLaWac=; b=XXCc3HQta/0ugjSZAtj78gKjUhdYvKJGgCoQvSXfiSUioeh8Xr2R69ZxnIWFpfb7ls a+VlLwHexdS8NIySH83kaGNL4F8RdMa07HQ93axYPtXBEyR+o0UxGCTIr9YdbGDA1Kaq Ds3AxMNPrlGPsm2QkpMurE2+GMusANuH2c65GT5BMObEZqyUvzXB/Mp7uxPf/Ss4cMlk yxw0K7fg4sxfix6ES/H4q9laBpW+n+GfLAGY/VeTY6UvZ61IuIG6KkV10uPr6gu3E48K kA7utVqXzRDM17H8/WZOokmLfQeM8U55htiM+Z3/S9gBSvpDVOXWGSklVptpZx9QyaDX 2Fdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WhhkvcSu; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i124si6297730oib.172.2020.03.30.12.04.51; Mon, 30 Mar 2020 12:05:04 -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=@gmail.com header.s=20161025 header.b=WhhkvcSu; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727954AbgC3TDQ (ORCPT + 99 others); Mon, 30 Mar 2020 15:03:16 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:39436 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726518AbgC3TDP (ORCPT ); Mon, 30 Mar 2020 15:03:15 -0400 Received: by mail-ot1-f65.google.com with SMTP id x11so19308059otp.6; Mon, 30 Mar 2020 12:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zeoBlPxZ+Ud3NYVMylVFKFU+gocBDIOivDsTMxLaWac=; b=WhhkvcSuf7XMeV/nvNGHJZiA3X3e7FQvL/apW4ILZiCEPgxBHT0jzpMmxYqDJUNQ8L qGBErGd7vZZ8KP9DbP5SsmKCZ9F9T3JGQ+MfEHexksRfWJukEnRb91irh4GiyfEFC/CZ 27qTgEVF2Jvz9qRVPHnrObZiNRghLU5kUgQsMqCd8QTiW6LrPa/l3jvDum/O20QU3oC5 fpFijKzMJgc32YP92Wpk7aBbavTuRBCqzZAQzh80Bo2bKODcDZ0p6byeqT9DLC6hr08x CmCqim3Tx++bTR8/LfAbC+NbRtyPCcKU5sp6ych36vRsoA9tcTDiILl5x6SLKPY2faTU 2sfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=zeoBlPxZ+Ud3NYVMylVFKFU+gocBDIOivDsTMxLaWac=; b=P/DPIADG56O0t4DQKE5JUs8V+pf+cjlML023Op9o0IWFbxXL7/FFvy5a/m/4v4wiPX TSOIYFgnZKsFxxBe3gV6L/+NdOLsAApoa4cx9rwy2NQjYZ37lrNDihx5SqQi6/8zlfde UxGHhH8hXLTk2uJtMEjgF5LMZTUOIOFlNg7YzCAJKxFbz1E9mfSMmdD5aKBAfDbKHS+Z vBvfiqyatj5smAcXIDwGeiaTzCUygrOwOcssoG6sBxgrOCjAiibqK50PxKtnjWHiQyB1 s319TDhnTH/3BFJMobvnyGvOPYpVdRg8xfAej4uNwjLjA3WDcHLs3XcXz7LJ0LLSqTOq Zdmw== X-Gm-Message-State: ANhLgQ1AKXuyd+L6CcYiknp6Hsdnvs/Ad9XBLT59lzoI8IFrufFhwYii qmys75uUigTmuk+WYf375Cc= X-Received: by 2002:a05:6830:1e93:: with SMTP id n19mr10914726otr.153.1585594994572; Mon, 30 Mar 2020 12:03:14 -0700 (PDT) Received: from ubuntu-m2-xlarge-x86 ([2604:1380:4111:8b00::1]) by smtp.gmail.com with ESMTPSA id c12sm4690809otk.4.2020.03.30.12.03.13 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Mar 2020 12:03:14 -0700 (PDT) Date: Mon, 30 Mar 2020 12:03:12 -0700 From: Nathan Chancellor To: Nick Desaulniers Cc: Masahiro Yamada , clang-built-linux , Linux Kbuild mailing list , Linux Kernel Mailing List , Sandeep Patil Subject: Re: [PATCH v2] Makefile.llvm: simplify LLVM build Message-ID: <20200330190312.GA32257@ubuntu-m2-xlarge-x86> References: <20200317202404.GA20746@ubuntu-m2-xlarge-x86> <20200317215515.226917-1-ndesaulniers@google.com> <20200327224246.GA12350@ubuntu-m2-xlarge-x86> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 30, 2020 at 11:58:19AM -0700, Nick Desaulniers wrote: > On Sat, Mar 28, 2020 at 6:57 PM Masahiro Yamada wrote: > > > > I also had planned to provide a single switch to change > > all the tool defaults to LLVM. > > > > So, supporting 'LLVM' is fine, but I'd rather want this > > look symmetrical, and easy to understand. > > > > CPP = $(CC) -E > > ifneq ($(LLVM),) > > Yes, a simple if statement is much simpler than the overly complex patch I had. > > > CC = $(LLVM_DIR)clang > > Do we need $LLVM_DIR? Shouldn't users just have that in their $PATH? > > Also, I think we need to support suffixed binaries, as debian > distributes these with version suffixes, as Nathan points out. Or do > the debian packages install suffixed binaries AND path versioned > non-suffixed binaries? I think the idea here is that ultimately, the suffixed versions of clang that Debian has in /usr/bin are symlinks to binaries in /usr/lib/llvm-#/bin; as a result, a user could say LLVM_DIR=/usr/lib/llvm-#/bin/ and all of those tools would be picked up automatically. I am not really sure what is better. I'll try to have some other comments by later today/tonight. > > LD = $(LLVM_DIR)ld.lld > > AR = $(LLVM_DIR)llvm-ar > > NM = $(LLVM_DIR)llvm-nm > > OBJCOPY = $(LLVM_DIR)llvm-objcopy > > OBJDUMP = $(LLVM_DIR)llvm-objdump > > READELF = $(LLVM_DIR)llvm-readelf > > OBJSIZE = $(LLVM_DIR)llvm-size > > STRIP = $(LLVM_DIR)llvm-strip > > else > > CC = $(CROSS_COMPILE)gcc > > LD = $(CROSS_COMPILE)ld > > AR = $(CROSS_COMPILE)ar > > NM = $(CROSS_COMPILE)nm > > OBJCOPY = $(CROSS_COMPILE)objcopy > > OBJDUMP = $(CROSS_COMPILE)objdump > > READELF = $(CROSS_COMPILE)readelf > > OBJSIZE = $(CROSS_COMPILE)size > > STRIP = $(CROSS_COMPILE)strip > > endif > > > > > > > > I attached two patches. > > Comments appreciated. > > I'm not sure the second one that recommends changing cc/c++ is the way > to go; I think it might harm hermeticity. Agreed. I do not modify my host system at all for this project, just relying on PATH modification. In theory, we can still override HOSTCC and HOSTCXX but that would defeat the purpose of that patch. Cheers, Nathan