From c5ed77629bcb65b8bae7a056bf66851225ffd506 Mon Sep 17 00:00:00 2001 From: Kai Luo Date: Thu, 13 Apr 2023 13:20:54 +0800 Subject: [PATCH] AIX searches dynamic libraries in `LIBPATH`. --- crates/cargo-util/src/paths.rs | 2 ++ src/doc/src/reference/environment-variables.md | 1 + 2 files changed, 3 insertions(+) diff --git a/crates/cargo-util/src/paths.rs b/crates/cargo-util/src/paths.rs index 69df7a2096c..5e153de04cc 100644 --- a/crates/cargo-util/src/paths.rs +++ b/crates/cargo-util/src/paths.rs @@ -55,6 +55,8 @@ pub fn dylib_path_envvar() -> &'static str { // penalty starting in 10.13. Cargo's testsuite ran more than twice as // slow with it on CI. "DYLD_FALLBACK_LIBRARY_PATH" + } else if cfg!(target_os = "aix") { + "LIBPATH" } else { "LD_LIBRARY_PATH" } diff --git a/src/doc/src/reference/environment-variables.md b/src/doc/src/reference/environment-variables.md index 95c4c87fbb9..353742877a4 100644 --- a/src/doc/src/reference/environment-variables.md +++ b/src/doc/src/reference/environment-variables.md @@ -274,6 +274,7 @@ on the platform: * Windows: `PATH` * macOS: `DYLD_FALLBACK_LIBRARY_PATH` * Unix: `LD_LIBRARY_PATH` +* AIX: `LIBPATH` The value is extended from the existing value when Cargo starts. macOS has special consideration where if `DYLD_FALLBACK_LIBRARY_PATH` is not already