diff options
author | Chen Zheng <czhengsz@cn.ibm.com> | 2024-06-06 23:49:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-06 11:49:58 -0400 |
commit | f882f8c293d2064619f7eb3dc716dcaf3e2da875 (patch) | |
tree | 2bd92d0c9faad41e8da8efef73083c31eb4839d8 | |
parent | e9174ba789531b26709764b4f404ec368b77db44 (diff) | |
download | llvm-f882f8c293d2064619f7eb3dc716dcaf3e2da875.zip llvm-f882f8c293d2064619f7eb3dc716dcaf3e2da875.tar.gz llvm-f882f8c293d2064619f7eb3dc716dcaf3e2da875.tar.bz2 |
[AIX] use LIBPATH on AIX instead of LD_LIBRARY_PATH (#94602)
LD_LIBRARY_PATH will become invalid when LIBPATH is also set on AIX.
See below example on AIX:
```
$ldd a.out
a.out needs:
/usr/lib/libc.a(shr.o)
Cannot find libtest.a
/unix
/usr/lib/libcrypt.a(shr.o)
$./a.out
Could not load program ./a.out:
Dependent module libtest.a could not be loaded.
Could not load module libtest.a.
System error: No such file or directory
$export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp
$./a.out ; echo $?
10
$export LIBPATH=./
$./a.out ; echo $? >>>>>> Now LD_LIBRARY_PATH is not used by system loader
Could not load program ./a.out:
Dependent module libtest.a could not be loaded.
Could not load module libtest.a.
System error: No such file or directory
```
This breaks many AIX LIT cases on our downstream buildbots which sets
LIBPATH.
---------
Co-authored-by: Anh Tuyen Tran <34661776+anhtuyenibm@users.noreply.github.com>
Co-authored-by: David Tenty <daltenty.dev@gmail.com>
-rw-r--r-- | llvm/utils/lit/lit/llvm/config.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/utils/lit/lit/llvm/config.py b/llvm/utils/lit/lit/llvm/config.py index 1d4babc..afb7f07 100644 --- a/llvm/utils/lit/lit/llvm/config.py +++ b/llvm/utils/lit/lit/llvm/config.py @@ -588,7 +588,10 @@ class LLVMConfig(object): if getattr(self.config, pp, None) ] - self.with_environment("LD_LIBRARY_PATH", lib_paths, append_path=True) + if platform.system() == "AIX": + self.with_environment("LIBPATH", lib_paths, append_path=True) + else: + self.with_environment("LD_LIBRARY_PATH", lib_paths, append_path=True) shl = getattr(self.config, "llvm_shlib_dir", None) pext = getattr(self.config, "llvm_plugin_ext", None) |