Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3185627ybb; Mon, 30 Mar 2020 23:26:33 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsW3/H3a89UOeB1vORC++JbI5z+26knygNac68KnpZcadjCzZrZbDfrOY2/cXeZYqdw3NEm X-Received: by 2002:a9d:12d:: with SMTP id 42mr2034480otu.2.1585635993682; Mon, 30 Mar 2020 23:26:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585635993; cv=none; d=google.com; s=arc-20160816; b=fEF8CQo7o7Fi0cdlwqQn2iwFkURpoFO+f5Xe7R9w2vRnUCiPPg02Kr4dED1dYag51v K/xSVmRO6P+s1vwOKXL7RHJ1IKY6x0FzmgGByUynafICd5sf8qmDB1ezKIEn7jQMMXOX T2AY+xk6RR4x3e1b+k3kyMIdcXz/I4hjJ/dyZcWrJYbH5xd7r0aORWpHxI+FSGb8Idod i6yuWu6kQARMZqSi9rKuoXfDPP0qFodwRYWegVLkRbWHRGMCIUiRIu+WINxKO75K7oMg jK8bUOsc3+dosCYH2bZAg1kfw+ehpq9JxO0brWhVT+4hioDgXw4a/ZQDIT0IaT8M5j1H zXQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=bhHDF/pmVptyuAoHUwFW/YtM1ZLRsyzSLz5SMFr9KSE=; b=K/6Bj6t04sWSIhpcQV4MytJJrU21cFOb6HNO4waow0fUq5Yv3019bbrwgj4V5o7hbW cNNL57u00wQI90OdTeeNdjOLhIdkS/bhLNBf73hQjivrDkAO5itr6flbL+/Jtf45CR3o iBIPeFyCoXF6kJiHAa/D+Oh1LcShidF3H91VNC9zTgAeVnlgGKDWhBdSGB3l0YIH45HA 1zq51BeHBXBGryWjUjlEaRcNpVz/mjGr2W4KlN24TlHDd9qNcEkJ6dXZjoMamms3p+dC OUS81yZf3xG0MuWm53/37WUm02wu/qhfND4PzO7aqngL/DEA+AuFGkw5yZ//FZsEwDcU UzkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=ya91m2S2; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w129si6166339oia.232.2020.03.30.23.26.21; Mon, 30 Mar 2020 23:26:33 -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=@nifty.com header.s=dec2015msa header.b=ya91m2S2; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726636AbgCaGZs (ORCPT + 99 others); Tue, 31 Mar 2020 02:25:48 -0400 Received: from conssluserg-05.nifty.com ([210.131.2.90]:41022 "EHLO conssluserg-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725809AbgCaGZs (ORCPT ); Tue, 31 Mar 2020 02:25:48 -0400 Received: from mail-vk1-f177.google.com (mail-vk1-f177.google.com [209.85.221.177]) (authenticated) by conssluserg-05.nifty.com with ESMTP id 02V6PRM2020258; Tue, 31 Mar 2020 15:25:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com 02V6PRM2020258 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1585635928; bh=bhHDF/pmVptyuAoHUwFW/YtM1ZLRsyzSLz5SMFr9KSE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ya91m2S2ZN7KXYPVglJDOXDsplu8DdVyJFEtDyGEoOpgwfq1DBFneqEk/BwlN65ES 55e6i4x7DRc6cbRlCz3AkluPl0vP8M69ekNqBgDcg337mqnq3D/Zv8YdH6YibZT2b7 ZaRXwcDQw5yRaiv/BH1kMx8E8D/M5knpIBh/IbjbU4QYq7T97tJGjBksuiibAic57K etS3EmpxeXs/onxsSAUo1g3MK8LDIi389TKRKpGhFVE6ieG7qBbqq4dNmDWwa07hxc zbvM9XOOheeHMgbSlit9q93L4G6idWao9DPqLZQ7ljQTvySxbVgCwQ1bBVPdLwCR7M dHt3zzqKIF7BA== X-Nifty-SrcIP: [209.85.221.177] Received: by mail-vk1-f177.google.com with SMTP id v129so5060479vkf.10; Mon, 30 Mar 2020 23:25:27 -0700 (PDT) X-Gm-Message-State: AGi0PuYKfODBH7DsH4Up122XzqYnldVTZlx8kvMO6huJe+Jhp+ntUfMF jYRajPezeBogag4YlaBBX1QWlhJFrmD0vtonszo= X-Received: by 2002:a1f:1786:: with SMTP id 128mr10407782vkx.26.1585635926362; Mon, 30 Mar 2020 23:25:26 -0700 (PDT) MIME-Version: 1.0 References: <20200317202404.GA20746@ubuntu-m2-xlarge-x86> <20200317215515.226917-1-ndesaulniers@google.com> <20200327224246.GA12350@ubuntu-m2-xlarge-x86> <20200330190312.GA32257@ubuntu-m2-xlarge-x86> In-Reply-To: <20200330190312.GA32257@ubuntu-m2-xlarge-x86> From: Masahiro Yamada Date: Tue, 31 Mar 2020 15:24:50 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] Makefile.llvm: simplify LLVM build To: Nathan Chancellor Cc: Nick Desaulniers , clang-built-linux , Linux Kbuild mailing list , Linux Kernel Mailing List , Sandeep Patil Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 31, 2020 at 4:03 AM Nathan Chancellor wrote: > > 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 periodically build the latest llvm from the trunk, and install it under my home directory. So, I just thought it would be useful to allow a user to specify the llvm directory. Of course, I can do the equivalent by tweaking PATH, but I hesitate to make the non-released version my default. Having both LLVM_DIR and LLVM_SUFFIX seems verbose. In fact, the debian provides multiple versions of GCC. For example, my machine has masahiro@pug:~$ ls -1 /usr/bin/gcc-* /usr/bin/gcc-4.8 /usr/bin/gcc-5 /usr/bin/gcc-7 /usr/bin/gcc-ar /usr/bin/gcc-ar-4.8 /usr/bin/gcc-ar-5 /usr/bin/gcc-ar-7 /usr/bin/gcc-nm /usr/bin/gcc-nm-4.8 /usr/bin/gcc-nm-5 /usr/bin/gcc-nm-7 /usr/bin/gcc-ranlib /usr/bin/gcc-ranlib-4.8 /usr/bin/gcc-ranlib-5 /usr/bin/gcc-ranlib-7 But, nobody has suggested GCC_SUFFIX. So, I guess CROSS_COMPILE was enough to choose a specific tool version. > 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 > > -- > You received this message because you are subscribed to the Google Groups "Clang Built Linux" group. > To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-linux+unsubscribe@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20200330190312.GA32257%40ubuntu-m2-xlarge-x86. -- Best Regards Masahiro Yamada