-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "circt: Drop dylib patch, just working around for now."
This reverts commit 9737aba.
- Loading branch information
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
From be96ffaae1e9cdbc53151ba1797bf6dc111c5dae Mon Sep 17 00:00:00 2001 | ||
From: Will Dietz <will.dietz@sifive.com> | ||
Date: Fri, 10 May 2024 12:43:46 -0500 | ||
Subject: [PATCH] dylib-lit-paths | ||
|
||
lit.cfg.py only, leave Unit as-is for now. | ||
--- | ||
test/lit.cfg.py | 28 ++++++++++++++++++++++++++++ | ||
1 file changed, 28 insertions(+) | ||
|
||
diff --git a/test/lit.cfg.py b/test/lit.cfg.py | ||
index 009a561a5..abbf72a60 100644 | ||
--- a/test/lit.cfg.py | ||
+++ b/test/lit.cfg.py | ||
@@ -90,3 +90,31 @@ if config.slang_frontend_enabled: | ||
tools.append('circt-verilog') | ||
|
||
llvm_config.add_tool_substitutions(tools, tool_dirs) | ||
+ | ||
+ | ||
+def find_shlibpath_var(): | ||
+ if platform.system() in ["Linux", "FreeBSD", "NetBSD", "OpenBSD", "SunOS"]: | ||
+ yield "LD_LIBRARY_PATH" | ||
+ elif platform.system() == "Darwin": | ||
+ yield "DYLD_LIBRARY_PATH" | ||
+ elif platform.system() == "Windows": | ||
+ yield "PATH" | ||
+ elif platform.system() == "AIX": | ||
+ yield "LIBPATH" | ||
+ | ||
+ | ||
+for shlibpath_var in find_shlibpath_var(): | ||
+ # in stand-alone builds, shlibdir is clang's build tree | ||
+ # while llvm_libs_dir is installed LLVM (and possibly older clang) | ||
+ shlibpath = os.path.pathsep.join( | ||
+ ( | ||
+ config.circt_shlib_dir, | ||
+ config.environment.get(shlibpath_var, ""), | ||
+ ) | ||
+ ) | ||
+ config.environment[shlibpath_var] = shlibpath | ||
+ break | ||
+else: | ||
+ lit_config.warning( | ||
+ "unable to inject shared library path on '{}'".format(platform.system()) | ||
+ ) | ||
-- | ||
2.39.3 (Apple Git-146) | ||
|