Commit 3b1c54d
Consistently use
* Consistently use `RUNPATH` in our libraries
When loading dependencies on Linux, we can either use `RPATH` or
`RUNPATH` as a list of relative paths to search for libraries. The
difference, for our purposes, mainly lies within how this interacts with
`LD_LIBRARY_PATH`: `RPATH` is searched first, then `LD_LIBRARY_PATH`,
then `RUNPATH`. So by using `RUNPATH` here, we are explicitly allowing
ourselves to be overridden by `LD_LIBRARY_PATH`. This is fine, as long
as we are consistent across our entire library line, however in the
`v1.8.0` release, there was an inconsistency, reported in [0].
The inconsistency occured because of the following confluence of factors:
- Ancient `ld` builds (such as the one used in our build environment)
do not default to using `RUNPATH`, but instead use `RPATH`.
- `patchelf`, when it rewrites the RPATH, will default to using
`RUNPATH` instead.
- We were only using `patchelf` on `libjulia-internal`, not on
`libjulia-codegen`, which was newly added in `v1.8`.
These three factors together caused us to ship a binary with `RUNPATH`
in `libjulia-internal`, but `RPATH` in `libjulia-codegen`, which caused
loading to fail in [0] due to first `libjulia-internal` being loaded,
(which brought in the external `libstdc++`), then `libjulia-codegen`
failed to load (because it found an incompatible `libstdc++`), causing
the mysterious compiler error.
This PR fixes this twofold; first, when building the libraries in the
first place, we pass `--enable-new-dtags` to the linker to encourage it
to use `runpath` when possible. This removes the possibility for a
missing `patchelf` invocation to break things in this way. Second, we
apply `patchelf` properly to `libjulia-codegen` as well.
[0] #46409
* Update Make.inc
Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com>
Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com>RUNPATH in our libraries (#46464)1 parent 8dde54d commit 3b1c54d
2 files changed
+11
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1223 | 1223 | | |
1224 | 1224 | | |
1225 | 1225 | | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
1226 | 1229 | | |
1227 | 1230 | | |
1228 | 1231 | | |
| |||
1236 | 1239 | | |
1237 | 1240 | | |
1238 | 1241 | | |
1239 | | - | |
1240 | | - | |
1241 | | - | |
| 1242 | + | |
1242 | 1243 | | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
1243 | 1248 | | |
1244 | 1249 | | |
1245 | | - | |
1246 | | - | |
1247 | 1250 | | |
1248 | 1251 | | |
1249 | 1252 | | |
| |||
1266 | 1269 | | |
1267 | 1270 | | |
1268 | 1271 | | |
1269 | | - | |
| 1272 | + | |
1270 | 1273 | | |
1271 | 1274 | | |
1272 | 1275 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
| 373 | + | |
373 | 374 | | |
374 | 375 | | |
| 376 | + | |
375 | 377 | | |
376 | 378 | | |
377 | 379 | | |
| |||
0 commit comments