Skip to content

Commit f882f8c

Browse files
Chen Zhenganhtuyenibmdaltenty
authored
[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 <[email protected]> Co-authored-by: David Tenty <[email protected]>
1 parent e9174ba commit f882f8c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/utils/lit/lit/llvm/config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,10 @@ def use_clang(
588588
if getattr(self.config, pp, None)
589589
]
590590

591-
self.with_environment("LD_LIBRARY_PATH", lib_paths, append_path=True)
591+
if platform.system() == "AIX":
592+
self.with_environment("LIBPATH", lib_paths, append_path=True)
593+
else:
594+
self.with_environment("LD_LIBRARY_PATH", lib_paths, append_path=True)
592595

593596
shl = getattr(self.config, "llvm_shlib_dir", None)
594597
pext = getattr(self.config, "llvm_plugin_ext", None)

0 commit comments

Comments
 (0)