<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/60682>60682</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            libunwind: FTBFS on mips64r6el (Linux, gcc)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          MingcongBai
      </td>
    </tr>
</table>

<pre>
    While attempting to build LLVM 15.0.7 for mips64r6el using GCC, the assembler fails to build `libunwind/src/UnwindRegistersRestore.S` due to missing `mthi` and `mtlo` instructions.

```
[424/7384] Building ASM object projects/libunwind/src/CMakeFiles/unwind_shared_objects.dir/UnwindRegistersRestore.S.o
FAILED: projects/libunwind/src/CMakeFiles/unwind_shared_objects.dir/UnwindRegistersRestore.S.o
/usr/bin/gcc -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/cache/acbs/build/acbs.z65dyy_1/llvm
-project-15.0.7.src/llvm/build/projects/libunwind/src -I/var/cache/acbs/build/acbs.z65dyy_1/llvm-project-15.0.7.src/libunwind/src -I/var/ca
che/acbs/build/acbs.z65dyy_1/llvm-project-15.0.7.src/llvm/build/include -I/var/cache/acbs/build/acbs.z65dyy_1/llvm-project-15.0.7.src/llvm/
include -I/var/cache/acbs/build/acbs.z65dyy_1/llvm-project-15.0.7.src/libunwind/include -fPIC -fno-shrink-wrap -O2 -g -DNDEBUG -fPIC -Werro
r=return-type -W -Wall -Wchar-subscripts -Wconversion -Wmismatched-tags -Wmissing-braces -Wno-unused-function -Wshadow -Wsign-compare -Wsig
n-conversion -Wstrict-aliasing=2 -Wstrict-overflow=4 -Wunused-parameter -Wunused-variable -Wwrite-strings -Wundef -Wno-suggest-override -Wno-error -pedantic -funwind-tables -nostdinc++ -D_DEBUG -UNDEBUG -D_LIBUNWIND_IS_NATIVE_ONLY -fno-rtti -MD -MT projects/libunwind/src/CMakeFiles/unwind_shared_objects.dir/UnwindRegistersRestore.S.o -MF projects/libunwind/src/CMakeFiles/unwind_shared_objects.dir/UnwindRegistersRestore.S.o.d -o projects/libunwind/src/CMakeFiles/unwind_shared_objects.dir/UnwindRegistersRestore.S.o -c /var/cache/acbs/build/acbs.z65dyy_1/llvm-project-15.0.7.src/libunwind/src/UnwindRegistersRestore.S
/var/cache/acbs/build/acbs.z65dyy_1/llvm-project-15.0.7.src/libunwind/src/UnwindRegistersRestore.S:1023:72: warning: invoking macro GLUE2 argument 1: empty macro arguments are undefined in ISO C90 [-Wpedantic]
 1023 | DEFINE_LIBUNWIND_FUNCTION(_ZN9libunwind21Registers_mips_newabi6jumptoEv)
 | ^
/var/cache/acbs/build/acbs.z65dyy_1/llvm-project-15.0.7.src/libunwind/src/UnwindRegistersRestore.S:1023:72: warning: invoking macro GLUE2 argument 1: empty macro arguments are undefined in ISO C90 [-Wpedantic]
/var/cache/acbs/build/acbs.z65dyy_1/llvm-project-15.0.7.src/libunwind/src/UnwindRegistersRestore.S:1023:72: warning: invoking macro GLUE2 argument 1: empty macro arguments are undefined in ISO C90 [-Wpedantic]
/var/cache/acbs/build/acbs.z65dyy_1/llvm-project-15.0.7.src/libunwind/src/UnwindRegistersRestore.S:1023:72: warning: invoking macro GLUE2 argument 1: empty macro arguments are undefined in ISO C90 [-Wpedantic]
/var/cache/acbs/build/acbs.z65dyy_1/llvm-project-15.0.7.src/libunwind/src/UnwindRegistersRestore.S: Assembler messages:
/var/cache/acbs/build/acbs.z65dyy_1/llvm-project-15.0.7.src/libunwind/src/UnwindRegistersRestore.S:1064: Error: opcode not supported on this processor: mips64r6 (mips64r6) `mthi $8'
/var/cache/acbs/build/acbs.z65dyy_1/llvm-project-15.0.7.src/libunwind/src/UnwindRegistersRestore.S:1066: Error: opcode not supported on this processor: mips64r6 (mips64r6) `mtlo $8'
```
</pre>
<img width="1px" height="1px" alt=""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