[llvm] [AIX] use LIBPATH on AIX instead of LD_LIBRARY_PATH (PR #94602)

Anh Tuyen Tran via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 6 08:49:34 PDT 2024


https://github.com/anhtuyenibm updated https://github.com/llvm/llvm-project/pull/94602

>From 97355f58cc094864213ac6e16acfa9e1b41f2281 Mon Sep 17 00:00:00 2001
From: Chen Zheng <czhengsz at cn.ibm.com>
Date: Thu, 6 Jun 2024 04:31:14 -0400
Subject: [PATCH 1/2] use LIBPATH on AIX instead of LD_LIBRARY_PATH

---
 llvm/utils/lit/lit/llvm/config.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/llvm/utils/lit/lit/llvm/config.py b/llvm/utils/lit/lit/llvm/config.py
index 1d4babc99984b..8d5da6b4f9dc0 100644
--- a/llvm/utils/lit/lit/llvm/config.py
+++ b/llvm/utils/lit/lit/llvm/config.py
@@ -588,7 +588,10 @@ def use_clang(
             if getattr(self.config, pp, None)
         ]
 
-        self.with_environment("LD_LIBRARY_PATH", lib_paths, append_path=True)
+        if sys.platform.startswith("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)

>From 4c02111d95d4d60b2d73f06aeb193c3b361a1268 Mon Sep 17 00:00:00 2001
From: Anh Tuyen Tran <34661776+anhtuyenibm at users.noreply.github.com>
Date: Thu, 6 Jun 2024 11:49:24 -0400
Subject: [PATCH 2/2] Update llvm/utils/lit/lit/llvm/config.py

Co-authored-by: David Tenty <daltenty.dev at gmail.com>
---
 llvm/utils/lit/lit/llvm/config.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/utils/lit/lit/llvm/config.py b/llvm/utils/lit/lit/llvm/config.py
index 8d5da6b4f9dc0..afb7f078072fc 100644
--- a/llvm/utils/lit/lit/llvm/config.py
+++ b/llvm/utils/lit/lit/llvm/config.py
@@ -588,7 +588,7 @@ def use_clang(
             if getattr(self.config, pp, None)
         ]
 
-        if sys.platform.startswith("aix"):
+        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)



More information about the llvm-commits mailing list