Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1222857pxb; Thu, 4 Mar 2021 06:30:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiU+LqMDnjVDYoP6cnWIbH1yyjW7JgwaeeyQb955BM5Mgv9sX2IvpgvGMVcF+IfgJtzIPl X-Received: by 2002:a17:907:78d9:: with SMTP id kv25mr4582505ejc.415.1614868230186; Thu, 04 Mar 2021 06:30:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614868230; cv=none; d=google.com; s=arc-20160816; b=H29xt/zJL9x5VwlQqy4ClOO6ySHa3bx207m+h98jQKrCSDQ2h5d8xGBvvlcDCdvk6Q T8snKl6jR2aSqm5M/V25xVx52Jkg5MnXYrHmwLbSH8IWw7tdW+uwKXbtMiYKKPBiMD/N D75jXHzKmQ7+R8LY/ASFfUbhvPhSTuwfwj0pYTLWh7nEO9l+Bdqjb5F2ON9V0g2JUHhR 8iKyzai9EieS0uASTfXz/LaKqEzOgbNgX6Gp0WoUx69vEBaV75cRvVkOv2gobrXrPvfv tGWrN+ww75oRdvZOR8koaeRW6bkVxzsyXBtA8zoElIN+rakYMW/NZ4pp1CLwbGoVPqiL m6Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2O40Dttz+aPYmlgkICqAwlui9FfzQvoMDTWtgEsG9ag=; b=SQcqM47REy2xY+asOnBy6YQW/nvzitCUFy3IT19ZBd3rrAFzBwBt9AJs4/+KOZRDN3 snSskNdBM8hrjoDXE1HYJsbqfdVuspLZ8cb4xnqqz9LX4mzoUmG9bhk+08R25WEqCWhf 0n+Ng/mNnYyRVngJVv29+iDwBUpAbxT7mnezSkpWWzCnpfGRv2PKe+3gEUUmHD1pMdY1 S4rDLLrFkZBoZIqOUjhpv9RpwfxfkTITMokX6bK93fimdTlE3YuZMw9qXNRLZ1WkQfOc taRrLogHgsmn1Q8XCsXF5xZqdOmaV9seVHyq1ulnOLG2oEgrq/aWp1Rlz5fhGHHUAnPb +UiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pTADc1lp; 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 8si17191004ejz.244.2021.03.04.06.30.05; Thu, 04 Mar 2021 06:30:30 -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=@kernel.org header.s=k20201202 header.b=pTADc1lp; 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 S232131AbhCDCDe (ORCPT + 99 others); Wed, 3 Mar 2021 21:03:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:59480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232327AbhCDCD3 (ORCPT ); Wed, 3 Mar 2021 21:03:29 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id DE8FC65032; Thu, 4 Mar 2021 02:02:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614823369; bh=DrYX2qaJ9dvf1qQJvkrG1HtM2hWEUOPp/Y+12r4zZCg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pTADc1lpgDGV9isZh76J0naVDGMaKZbfBfwku5J8vI0Q/p5S5tS1bqYoNoMyEyeVx tpdEctVmzjgP2Beg1meSAjAVdLVmSvf1Q4/o3soT5YTYCO8zbVfS+8vvLFNNH8/0H6 3k/FQgKn1UDX3SIEvO03XcpCB1CTnOvjQxiBgGVd9aEjflZ7q6rK79xiYYQgDWHu+X E9xFpmaU2zKuIfIOmqoyBu7pOGy5oqGJYmKwTRee+HgsQs3TTP89/HYCXlZp2ya5WL PY9442mX4ijTepCwEOyNMmGRJ3awLhAVsXFkG76NgdVEjPmUOsRfT0DhuA4F3QxHX2 E9SZXJr1Uye+Q== Date: Wed, 3 Mar 2021 19:02:44 -0700 From: Nathan Chancellor To: Tiezhu Yang Cc: Thomas Bogendoerfer , Nick Desaulniers , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Xuefeng Li Subject: Re: [PATCH] MIPS: Add comment about CONFIG_MIPS32_O32 in loongson3_defconfig when build with Clang Message-ID: <20210304020244.pza6xd4ixziysrom@archlinux-ax161> References: <1614820544-10686-1-git-send-email-yangtiezhu@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1614820544-10686-1-git-send-email-yangtiezhu@loongson.cn> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 04, 2021 at 09:15:44AM +0800, Tiezhu Yang wrote: > When build kernel with Clang [1]: > > $ make CC=clang loongson3_defconfig > $ make CC=clang > > there exists the following error: > > Checking missing-syscalls for O32 > CALL scripts/checksyscalls.sh > error: ABI 'o32' is not supported on CPU 'mips64r2' > make[1]: *** [Kbuild:48: missing-syscalls] Error 1 > make: *** [arch/mips/Makefile:419: archprepare] Error 2 > > This is a known bug [2] with Clang, as Simon Atanasyan said, > "There is no plan on support O32 for MIPS64 due to lack of > resources". > > It is not a good idea to remove this config due to GCC works > well, so add comment to point out this bug and suggest the > users to remove CONFIG_MIPS32_O32=y in defconfig when build > kernel with Clang. > > [1] https://www.kernel.org/doc/html/latest/kbuild/llvm.html > [2] https://bugs.llvm.org/show_bug.cgi?id=38063 > > Signed-off-by: Tiezhu Yang > --- > arch/mips/configs/loongson3_defconfig | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/arch/mips/configs/loongson3_defconfig b/arch/mips/configs/loongson3_defconfig > index 0e79f81..cacf9dd 100644 > --- a/arch/mips/configs/loongson3_defconfig > +++ b/arch/mips/configs/loongson3_defconfig > @@ -35,6 +35,9 @@ CONFIG_NUMA=y > CONFIG_SMP=y > CONFIG_HZ_256=y > CONFIG_KEXEC=y > +# Please remove CONFIG_MIPS32_O32=y when build with Clang > +# due to "ABI 'o32' is not supported on CPU 'mips64r2'", > +# https://bugs.llvm.org/show_bug.cgi?id=38063 > CONFIG_MIPS32_O32=y > CONFIG_MIPS32_N32=y > CONFIG_VIRTUALIZATION=y > -- > 2.1.0 > I think this might be a better solution. I know that I personally never read defconfig files if a build fails. If CONFIG_MIPS32_O32 is broken with clang and the MIPS backend maintainer has said that it will not be supported due to lack of resources, then the config should not even be selectable in my opinion. Cheers, Nathan diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index d89efba3d8a4..ed35318a759d 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -3315,6 +3315,8 @@ config SYSVIPC_COMPAT config MIPS32_O32 bool "Kernel support for o32 binaries" depends on 64BIT + # https://bugs.llvm.org/show_bug.cgi?id=38063 + depends on $(success,$(CC) $(CLANG_FLAGS) -march=mips64 -o32 -c -x c /dev/null -o /dev/null) select ARCH_WANT_OLD_COMPAT_IPC select COMPAT select MIPS32_COMPAT