[PATCH v3] MIPS: Make MIPS32_O32 depends on !CC_IS_CLANG

Subsystems: mips, the rest

STALE2026d REVIEWED: 5 (5M)

1 review trailer.

2 messages, 2 authors, 2021-03-04 · open the first message on its own page

[PATCH v3] MIPS: Make MIPS32_O32 depends on !CC_IS_CLANG

From: Tiezhu Yang <yangtiezhu@loongson.cn>
Date: 2021-03-04 08:06:04

When building 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 CONFIG_MIPS32_O32=y directly
in defconfig because GCC works, as Nathan said, the config
should not even be selectable when building with Clang, so
just make MIPS32_O32 depends on !CC_IS_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 <yangtiezhu@loongson.cn>
Acked-by: Nathan Chancellor <nathan@kernel.org>
---

v3: Update the commit message suggested by Nathan, thank you!

 arch/mips/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 3a38d27..f6ba59f 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -3318,6 +3318,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 !CC_IS_CLANG
 	select ARCH_WANT_OLD_COMPAT_IPC
 	select COMPAT
 	select MIPS32_COMPAT
-- 
2.1.0

Re: [PATCH v3] MIPS: Make MIPS32_O32 depends on !CC_IS_CLANG

From: Nick Desaulniers <ndesaulniers@google.com>
Date: 2021-03-04 17:39:33

On Thu, Mar 4, 2021 at 12:04 AM Tiezhu Yang [off-list ref] wrote:
When building 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's my hope we will fix the resourcing issue.  I'm working on that;
it's a non-technical challenge though.
Acked-by: Nick Desaulniers <ndesaulniers@google.com>
quoted hunk
It is not a good idea to remove CONFIG_MIPS32_O32=y directly
in defconfig because GCC works, as Nathan said, the config
should not even be selectable when building with Clang, so
just make MIPS32_O32 depends on !CC_IS_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 <yangtiezhu@loongson.cn>
Acked-by: Nathan Chancellor <nathan@kernel.org>
---

v3: Update the commit message suggested by Nathan, thank you!

 arch/mips/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 3a38d27..f6ba59f 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -3318,6 +3318,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 !CC_IS_CLANG
        select ARCH_WANT_OLD_COMPAT_IPC
        select COMPAT
        select MIPS32_COMPAT
--
2.1.0

--
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/1614845040-12995-1-git-send-email-yangtiezhu%40loongson.cn.


-- 
Thanks,
~Nick Desaulniers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help