<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/112010>112010</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Mips] out of range PC16 fixup when linking the Zig compiler for some target triples
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
alexrp
</td>
</tr>
</table>
<pre>
Seen in:
* https://github.com/ziglang/zig-bootstrap/issues/195 (dynamically linked glibc, soft float)
* https://github.com/ziglang/zig-bootstrap/issues/196 (dynamically linked glibc, hard float)
* https://github.com/ziglang/zig-bootstrap/issues/192 (statically linked musl, hard float)
The following triples link successfully, however:
* `mips-linux-musleabi` (statically linked musl, soft float)
* `mips-linux-musleabihf` (statically linked musl, hard float)
* `mipsel-linux-gnueabi` (dynamically linked glibc, soft float)
* `mipsel-linux-gnueabihf` (dynamically linked glibc, hard float)
* `mipsel-linux-musleabi` (statically linked musl, soft float)
* `mipsel-linux-musleabihf` (statically linked musl, hard float)
* `mips64-linux-gnuabi64` (dynamically linked glibc, hard float)
* `mips64el-linux-gnuabi64` (dynamically linked glibc, hard float)
* `mips64el-linux-musl` (statically linked musl, hard float)
If there is a pattern here, I don't see it. :slightly_frowning_face:
This started happening with LLVM 19, but it's possible that's just a coincidence. It's unclear to me if the bug is in LLVM or LLD.
Example steps to reproduce:
```
$ git clone git@github.com:ziglang/zig-bootstrap.git
$ cd zig-bootstrap
$ ./build mips64-linux-musl baseline
```
On a modern x86 machine, this will take ~15 minutes to build the compiler for the current machine, and then another ~15 minutes to (attempt to) build the compiler that runs on `mips64-linux-musl`.
Note that this repo builds and uses a "vendored" LLVM, LLD, and Clang as its purpose is to allow low-effort bootstrapping of Zig for any system. The vendored code here is ~equivalent to the tagged LLVM 19.1.0 release, with only some trivial build system patches on top to avoid building unnecessary fluff.
Still trying to see if I can reduce this to a more manageable repro, but for now, this is the best I've got.
</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