https://bugs.llvm.org/show_bug.cgi?id=38063

            Bug ID: 38063
           Summary: Failed Checking missing-syscalls for O32
           Product: clang
           Version: trunk
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: lesliez...@llvm.org.cn
                CC: llvm-bugs@lists.llvm.org

Hi LLVM developers,

I am building Linux Kernel[1] with LLVM toolchain[2] for mips64el.
But it failed Checking missing-syscalls for O32:


error: ABI 'o32' is not supported on CPU 'mips64r2'
Kbuild:98: recipe for target 'missing-syscalls' failed
make[1]: *** [missing-syscalls] Error 1


GCC is able to work:

...
Checking missing-syscalls for O32
  CHK     include/generated/timeconst.h
  CHK     include/generated/bounds.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/bounds.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/asm-offsets.h
...


So ugly workaround patch:

diff --git a/lib/Basic/Targets/Mips.cpp b/lib/Basic/Targets/Mips.cpp
index cbd5a01..59dd34b 100644
--- a/lib/Basic/Targets/Mips.cpp
+++ b/lib/Basic/Targets/Mips.cpp
@@ -207,8 +207,7 @@ bool MipsTargetInfo::validateTarget(DiagnosticsEngine
&Diags) const {
   // 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;
+    return true;
   }

   // 64-bit ABI's require 64-bit CPU's.


1. Linux Kernel 4.9 branch https://github.com/loongson-community/linux-stable
2. Loongson clang version 7.0.0 (g...@github.com:llvm-mirror/clang.git
ef356db5c03a0f052c09ebd0a964b9eda3852847) (g...@github.com:llvm-mirror/llvm.git
ab9920d16bc0acaa2a458b49a43b3aaa9bcda8e6) (based on LLVM 7.0.0svn)
Target: mips64el-redhat-linux
Thread model: posix
InstalledDir: /opt/llvm-git/bin
Found candidate GCC installation: /usr/lib/gcc/mips64el-redhat-linux/4.9.3
Selected GCC installation: /usr/lib/gcc/mips64el-redhat-linux/4.9.3
Candidate multilib: .;
Selected multilib: .;

Regards,
Leslie Zhai

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to