Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2829455pxb; Tue, 9 Mar 2021 11:57:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJ6G1sltAa+rHvgo2x3BRG/su1jh8hPccFl7jCrgK+5fW9kxRzsVoBJPSjpmcG4y0Kawdf X-Received: by 2002:a17:906:3388:: with SMTP id v8mr22467534eja.278.1615319851763; Tue, 09 Mar 2021 11:57:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615319851; cv=none; d=google.com; s=arc-20160816; b=NwavRN4ASyD7A3J7Xv9725afPVTTKgHICzU1wqjvX1QhDNx6XQehZ/xU4vQ74iPQNA aAN3BA/Xddg7OW3+LGaV+iY/VCPuV/gUY4lNr+yN1yeX4wrK2XYHXGiIpz1JzUsK2fjo oUxvUhADVHSJvYArsyE2VkH9uKnQaS5QiCnieTp9y80Z5X6ON6myT9kwm4WaxnOdPBcb 2GF4BLwbTvrtedZB2Fmu/yRsT2VFxpK+EE2mQrHdJzOkqMqTeY9e/EwZ2TwLuocTeHGa ZFZCn4eVZ8lDBdz3Lx6pDJhNI7pPmSitoWJHmUmywTbH3rzD4Oofle8mJpRtKfRnSf+X Mchw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=O2Wusp+oF1an+HCfKF/8accMBu76kIYY85AHixnE3LA=; b=cIchJ1sZYQ3TogHRzQo61Le/vVQZSz9vP9HxCtoANcm5EYDDWy9utbzqwRzGebTmim nkuYWWxD2tViTkEI6iWPy9a8oVhDq5IoHwUXEiBcxKr8Mh3GdXyev7d4/17koR40owpu b9QgYdwn3M14hrNQflM2VN5n1bmCRRy4dMUasRFA5DUvlSezJGLq48T1qxXr3erhHP/B x0kaOa80U8pltPpnpBh2iRYXzNDWB74JlfsPQj+zm3QcOCQ+Aeqtwluhd7bx/r2FYn7y vbIVafDYnrKqjcPFLZAgja3+CpTLwhH4C1ql/5ddBxQlt68snYma8aie9mCRor7tthTk WFNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=2tBjBYar; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si9683003ejj.290.2021.03.09.11.57.08; Tue, 09 Mar 2021 11:57:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=2tBjBYar; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231467AbhCIT4M (ORCPT + 99 others); Tue, 9 Mar 2021 14:56:12 -0500 Received: from conssluserg-01.nifty.com ([210.131.2.80]:42753 "EHLO conssluserg-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230431AbhCIT4I (ORCPT ); Tue, 9 Mar 2021 14:56:08 -0500 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (authenticated) by conssluserg-01.nifty.com with ESMTP id 129Jtd8V015140; Wed, 10 Mar 2021 04:55:39 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com 129Jtd8V015140 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1615319739; bh=O2Wusp+oF1an+HCfKF/8accMBu76kIYY85AHixnE3LA=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=2tBjBYarT9iWOhUds3YLiEf+1/6OXbrgghJw2c9e7XL9ITknLmpugZGp7pPcWxBuu x1JMBapghXLDHko+27MAgrNA+VkWcZkW9/j8IhkXpvpKD7uVfBvqf5dWnCm7tc9JRg nFpOF9yNiz/BP3zHTmFfCka/Y6U936t+M1lV0jb4s+ZTh7dPmrPF1mMJ2nJXlht901 m7N5WkIfns+Pjw55Qlo7rKONiuAP5XrCTavOqKBICimUfCTyWirQ/R/aSH5kXXSbnd 3ylEgcGx54V+Qc5s7v2uUEQFGhATUkSZ5C2CiSuj/QWPjTpQ+G+vKZmr85SNMd3h9Z wRNmfO720Przw== X-Nifty-SrcIP: [209.85.214.171] Received: by mail-pl1-f171.google.com with SMTP id n17so3600061plc.7; Tue, 09 Mar 2021 11:55:39 -0800 (PST) X-Gm-Message-State: AOAM533GIi30z1z2ZLq+Eb0iCk0nubCdp8Sw947Ol2RpiupxafEfLOgr ZnKe93ivYtITp0h/Ni27ED/aKVFJMjr+Y2Eruvw= X-Received: by 2002:a17:90a:5510:: with SMTP id b16mr6321761pji.87.1615319738849; Tue, 09 Mar 2021 11:55:38 -0800 (PST) MIME-Version: 1.0 References: <20210302210646.3044738-1-nathan@kernel.org> <20210302210646.3044738-2-nathan@kernel.org> In-Reply-To: <20210302210646.3044738-2-nathan@kernel.org> From: Masahiro Yamada Date: Wed, 10 Mar 2021 04:55:00 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] Makefile: Only specify '--prefix=' when building with clang + GNU as To: Nathan Chancellor Cc: Michal Marek , Nick Desaulniers , Linux Kbuild mailing list , Linux Kernel Mailing List , clang-built-linux Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 3, 2021 at 6:07 AM Nathan Chancellor wrote: > > When building with LLVM_IAS=1, there is no point to specifying > '--prefix=' because that flag is only used to find the cross assembler, > which is clang itself when building with LLVM_IAS=1. All of the other > tools are invoked directly from PATH or a full path specified via the > command line, which does not depend on the value of '--prefix='. > > Sharing commands to reproduce issues becomes a little bit easier without > a '--prefix=' value because that '--prefix=' value is specific to a > user's machine due to it being an absolute path. > > Signed-off-by: Nathan Chancellor I was tricked by a couple of Reviewed-by/Tested-by tags. With this patch applied, the code looks as follows: ifneq ($(CROSS_COMPILE),) CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%)) ifneq ($(LLVM_IAS),1) GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit)) CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE)) CLANG_FLAGS += -no-integrated-as endif endif For the native build (empty CROSS_COMPILE), you cannot add -no-integrated-as. I dropped this from my tree. Is the correct code as follows? ifneq ($(LLVM_IAS),1) CLANG_FLAGS += -no-integrated-as ifneq ($(CROSS_COMPILE),) CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%)) GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit)) CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE)) endif endif > --- > Makefile | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/Makefile b/Makefile > index c20f0ad8be73..0413b8c594cd 100644 > --- a/Makefile > +++ b/Makefile > @@ -566,12 +566,12 @@ CC_VERSION_TEXT = $(shell $(CC) --version 2>/dev/null | head -n 1 | sed 's/\#//g > ifneq ($(findstring clang,$(CC_VERSION_TEXT)),) > ifneq ($(CROSS_COMPILE),) > CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%)) > +ifneq ($(LLVM_IAS),1) > GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit)) > CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE)) > -endif > -ifneq ($(LLVM_IAS),1) > CLANG_FLAGS += -no-integrated-as > endif > +endif > CLANG_FLAGS += -Werror=unknown-warning-option > KBUILD_CFLAGS += $(CLANG_FLAGS) > KBUILD_AFLAGS += $(CLANG_FLAGS) > -- > 2.31.0.rc0.75.gec125d1bc1 > -- Best Regards Masahiro Yamada