-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ABI 'o32' is not supported on CPU 'mips64r2' #884
Comments
From clang source code quoted in #885 (comment): // FIXME: It's valid to use O32 on a 64-bit CPU but the backend can't handle
// this yet. It's better to fail here than on the backend assertion.
if (processorSupportsGPR64() && ABI == "o32") {
Diags.Report(diag::err_target_unsupported_abi) << ABI << CPU;
return false;
} // FIXME: It's valid to use O32 on a mips64/mips64el triple but the backend
// can't handle this yet. It's better to fail here than on the
// backend assertion.
if (getTriple().isMIPS64() && ABI == "o32") {
Diags.Report(diag::err_target_unsupported_abi_for_triple)
<< ABI << getTriple().str();
return false;
} |
Upstream LLVM issue: https://llvm.org/pr38063 Patch disabling |
Upstream thread with some addition info from Arnd: https://lore.kernel.org/CADVatmNtFYyqk0KwYzB1x6hOPkQ=0gV8mPN1BWp6QWrCs5GaxA@mail.gmail.com/ |
@ardbiesheuvel came up with: diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index bb236de13133..d7b7451d055f 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -409,7 +409,7 @@ ifdef CONFIG_MIPS32_N32
endif
ifdef CONFIG_MIPS32_O32
@$(kecho) ' Checking missing-syscalls for O32'
- $(Q)$(MAKE) $(build)=. missing-syscalls missing_syscalls_flags="-mabi=32"
+ $(Q)$(MAKE) $(build)=. missing-syscalls missing_syscalls_flags="--target=mips-linux"
endif
install:
diff --git a/arch/mips/vdso/Makefile b/arch/mips/vdso/Makefile
index f72658b3a53f..2fb69d606547 100644
--- a/arch/mips/vdso/Makefile
+++ b/arch/mips/vdso/Makefile
@@ -141,8 +141,8 @@ ifdef CONFIG_MIPS32_O32
obj-vdso-o32 := $(obj-vdso-y:%.o=$(obj)/%-o32.o)
-$(obj-vdso-o32): KBUILD_CFLAGS := $(cflags-vdso) -mabi=32
-$(obj-vdso-o32): KBUILD_AFLAGS := $(aflags-vdso) -mabi=32
+$(obj-vdso-o32): KBUILD_CFLAGS := $(cflags-vdso) --target=mips-linux -march=mips32r6
+$(obj-vdso-o32): KBUILD_AFLAGS := $(aflags-vdso) --target=mips-linux -march=mips32r6
$(obj)/%-o32.o: $(src)/%.S FORCE
$(call if_changed_dep,vdsoas_o_S)
@@ -151,7 +151,7 @@ $(obj)/%-o32.o: $(src)/%.c FORCE
$(call cmd,force_checksrc)
$(call if_changed_rule,cc_o_c)
-$(obj)/vdso-o32.lds: KBUILD_CPPFLAGS := $(ccflags-vdso) -mabi=32
+$(obj)/vdso-o32.lds: KBUILD_CPPFLAGS := $(ccflags-vdso) --target=mips-linux -march=mips32r6
$(obj)/vdso-o32.lds: $(src)/vdso.lds.S FORCE
$(call if_changed_dep,cpp_lds_S) Seems to build. With some touch ups to avoid passing that flag to GCC will probably be upstreamable. |
Possible workaround: https://lore.kernel.org/llvm/20230407102721.14814-5-jiaxun.yang@flygoat.com/ |
Clang patch: https://reviews.llvm.org/D146269 |
This is fixed in LLVM 17 with llvm/llvm-project@7983f8a. Perhaps now that this is fixed in the toolchain, the kernel will accept a workaround disabling the configuration for older toolchain versions? Otherwise, we could just leave it broken. |
Both
CONFIG_MIPS32_O32=y
andCONFIG_CPU_MIPSR2=y
can not be enabled at the same time.As this comment suggests this should be fixed: https://github.com/ClangBuiltLinux/llvm-project/blob/cccf1ef0c89432339363fc0121e3d97f5a04ac69/clang/test/Driver/mips-abi.c#L12
The text was updated successfully, but these errors were encountered: