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

    <tr>
        <th>Summary</th>
        <td>
            Option `--thinlto-emit-index-files` potentially generates huge filenames
        </td>
    </tr>

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

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

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

<pre>
    While building chromium with `lld_emit_indexes_and_imports=true` (That's converted into `-Wl,--thinlto-emit-index-files`), I'm getting 

```
ld.lld: error: cannot open obj/third_party/rust/serde_json_lenient/v0_2/wrapper/libthird_uparty_srust_sserde_ujson_ulenient_sv0_u2_swrapper_cwrapper.rlib(libthird_uparty_srust_sserde_ujson_ulenient_sv0_u2_swrapper_cw
rapper.third_uparty_srust_sserde_ujson_ulenient_sv0_u2_swrapper_cwrapper.6e3eaf7b964e238a-cgu.0.rcgu.o at 67896).thinlto.bc: File name too long
```

On my linux with BTRFS. This is due to (1) The name mangling mechanism in Chromium: https://source.chromium.org/chromium/chromium/src/+/main:build/rust/rust_target.gni;l=44;drc=15d204f8bf5cc292f592792948823a2bbd77d82c and (2) Lack of handling of files with long filenames in LLVM: https://github.com/llvm/llvm-project/blob/665299eb3e7a142199e2c22eb294c5e01ef1655d/llvm/lib/LTO/LTO.cpp#L1402-L1405 

I've created an issue on [Chromium's issue tracker](https://issues.chromium.org/issues/428671568) and [fix proposals in a CL](https://chromium-review.googlesource.com/c/chromium/src/+/6687154) there. But we are wondering if it'd be possible to change code in LLVM's side in a way that it creates shorter file names in the first place. Please see the discussion in the issue tracker on Chromium further information.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykVduOozgTfhrnphQExfkiF0m3Iv1S_5rVbmvnEhm7AM8YG9kmmX77lUnSsz17kFYjITCG-vB3KMy9V6MhOrDyxMrnHV_DZN0hcCeU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