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

    <tr>
        <th>Summary</th>
        <td>
            [clang] fmodule-file-home-is-cwd doesn't work
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    To reproduce:
```
touch a.h
clang++ -x c++-header a.h -Xclang -fmodule-file-home-is-cwd -o a.pcm
clang++ -module-file-info a.pcm | grep "Input file"    
```

Got: `/absolute/path/to/a.h`
Want: `a.h`

The same applies to input pcm files, though I don't have a simple reproducer for that.
When I add `-fmodule-file=obj/buildtools/third_party/libc++/std/module.pcm`, I find that the module info output contains  `Imports module 'std': /absolute/path/to/obj/buildtools/third_party/libc++/std/module.pcm`

(And yes, I checked - the file itself contains absolute paths, it's not just output by the tool)

This is a problem for us, because we want to use remote execution, which requires that our paths be relative.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyklM-u6yYQxp8Gb0a2MPm_8CLnHLnK_krtrsIwDpyLjQtDcvP2FTjpaa90V5UixaBvZn58MyBjtNcZsWO7N7b7qGQi40M3SaLYVoPXj-6bh4BL8DopZJsz42e2588fP5NPyoBsDONn5eR8ZeKNiTeof4BaP2uDUmPIGqj_KBqox8nr5LAercPa-AlrG2t111B7kM2ipp_T_Vtv5_GpAnZ4h2vABZgQl3lJBFnBhAAA-AmV8fNvntjmDHktejlE7xIhE_0iyTDRk8_bjVn1v8v5pf5nj_HzN4MQ5YQgl8VZjEAebCmdgXL5yMQ7kPHpauAC2s9MHAiMvCFIiHZaHH5ZGmD0AchIanJNgzNcQGqdy_7HJrb58MMnE_2QrNPkvYsZ2dig_1xkoAcTvbPD03Um-kiaiX7NUCzNp36HC4x21qUikEFYBVBM9YnyQZSfSdo5Qoa4TIsPFF86Jg4l8aFY80sX_z9qMZuJ43nW8Fg9vYAyqL6jhrqgZ1vAUkQ3fjG_gCDjlDBLGRpmT_CZIr1OOTxKkozHxOnVXBvBRpCwBD84nEp3UkkzoJIpItwR7nKm3Pe8DDh5QsAfqBLZ3Ox3uBurDAT8K9mQJyR77VNYkWDIQU6SvWFT6W6jT5uTrLBrDzvebjftUVSmG48DjkqofcvVTp_UdsdRtMi1bo-S631lO8HFju_bA9_vNlw0h_14Eng6btphz_WWsy3HSVrXOHebGh-ulY0xYddut9sDr5wc0MVy8YV43jWR34DQ5YB6SNfIttzZSPErBVly5bVYI3Yf8MurrD3GdfTvPnyvUnCdIVpifkREz0R_tWTS0Cg_5Xlwt9dfvQT_iYqY6AtxHp4n9K0TfwcAAP__sQ6Cyg">