Skip to content

Commit d90ff55

Browse files
committed
Auto merge of #11968 - bzEq:aix-libpath, r=weihanglo
fix: AIX searches dynamic libraries in `LIBPATH`. ### What does this PR try to resolve? On IBM AIX machines people have encountered issues in `compiletest` and rustc's bootstrap builder. They haven't encountered any in cargo. This PR is made for avoiding potential failures in the future in cargo. It's documented in <https://www.ibm.com/support/pages/libpath-environment-variables-aix-platforms>: > The `LIBPATH` environment variable tells AIX applications where to find shared libraries when located in a different directories than those specified in the header section of the executable. See also the counterpart in <rust-lang/rust#109526> ### How to verify and test this in Cargo's CI? This is indeed an issue. At IBM people are maintaining a buildbot since GitHub Action doesn't support AIX yet.
2 parents 2b3356c + c5ed776 commit d90ff55

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

crates/cargo-util/src/paths.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ pub fn dylib_path_envvar() -> &'static str {
5555
// penalty starting in 10.13. Cargo's testsuite ran more than twice as
5656
// slow with it on CI.
5757
"DYLD_FALLBACK_LIBRARY_PATH"
58+
} else if cfg!(target_os = "aix") {
59+
"LIBPATH"
5860
} else {
5961
"LD_LIBRARY_PATH"
6062
}

src/doc/src/reference/environment-variables.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ on the platform:
274274
* Windows: `PATH`
275275
* macOS: `DYLD_FALLBACK_LIBRARY_PATH`
276276
* Unix: `LD_LIBRARY_PATH`
277+
* AIX: `LIBPATH`
277278

278279
The value is extended from the existing value when Cargo starts. macOS has
279280
special consideration where if `DYLD_FALLBACK_LIBRARY_PATH` is not already

0 commit comments

Comments
 (0)