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

    <tr>
        <th>Summary</th>
        <td>
            Build is not reproducible wrt build directory path length
        </td>
    </tr>

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

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

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

<pre>
    Shared runtime libs like `libc++.so` have their rpath set to somewhere in the build directory. Then, as one of the very last steps of the installation, these internal references to build directory are erased with `RPATH_SET`:

```
Set runtime path of "/...build-dir.../lib/x86_64-unknown-linux-musl/libc++.so.1.0" to ""
```

This good intention becomes one toe-stubbing brick forming the road to utter confusion.
The problem is, this erasure is not re-linking, and whatever build-dir-path-len-dependent offsets the shared library had because of the varying builddir length are kept intact.
The result looks as if `libc++.so`/`libc++abi.so` compiled from same `.o` files just differ in internal offsets for no good reason.

One (hacky) workaround to that is using a constant-len build-dir. Clearly, there must be a better way.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsVM1u4zgMfhr5Qthw5MRpDj5MZzbY2y62vQ9ki441kaWApJrJ2y-ktOn-DBAosGSR3x9tmN0pIA5q96x23yqTZIk0yOZpq3d9NUZ7G14WQ2iBUhC3Ing3Mnh3RlB96904Kf2s9HPDUfUtLOYNQRZ0BHQxsgCjgETguOJ1QUJwIZ_DmJy3YB3hJJFuDbwuGJT-CoYhBoQ4l9fekG7gDQuw4IU_tl1gMd4bcbFckgU57wpSMB4IZyQME3Lu_Z9WYAgByTBauDpZMo-__vzy-vv3l99eVd-q7otqv6n2Y-3b9195fEF5SFEIxhmU1kofm6YpnWrrqGkapY_ejUoffz713_ttncI5xGuovQvpZ70m9vc3PvVrNk2rtM6QS0X9SwD39XVxDKcYbSEdsg4w4hRXvMsnEWuWNI4unGAkN51hjrTmp6wfRWNznySCBFMMc2IXQ_NRHOFCcfS4guO7vo6LZik7yBCiAGHmcnbhVGwLFq6LEXxDgocOdZao9hhqixcMFoNAnGdG4YKD79nybiRDN1iMzSxM4s8AGLoVDrmkdQQew0mWYuIZL5L5m0n-gZyQkxfwMZ45p8nNv0qq0sd_7ZrRvUd4iuvFebQwU1yBzVqS3pSz2Xlk-JFYwLp5RspxfsTug9kcCUK820No-CHsff0jICj9tJjpfFP6ANdIZ0MxhWKJLEayxIkzbZPNYTFBsoqfwjbw1aMhf3tPPyGsGdWIYGDEYuvV3JrKDp09dAdT4bDpD7t-v-87XS1Df2hbrXeH1m5w207Ym36r93pqjemmTf9UuUG3umsPeqc3XbfTTdvZebvdW2Na3ZoR1bbF1TjfeP-2NpFOlWNOOPT7br-rvBnRc_muaB3wCuUwh3r3raIh36nHdGK1bb1j4c8q4sTj8FyG9hG1C0WbJjd6hCvJ_0a6TOI9GVUiPywiF86DrI9KH09OljQ2U1zzyPm3j7_6QvEHTqL0saBjpY8F_d8BAAD__xjlr4U">