[llvm] 25986a2 - [llvm-jitlink] Don't hardcode LLVM version number into the runtime path.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 26 20:17:55 PDT 2021


Author: Lang Hames
Date: 2021-07-27T13:04:50+10:00
New Revision: 25986a21ef6de4222f5bbd8b7f1e2c865b90431d

URL: https://github.com/llvm/llvm-project/commit/25986a21ef6de4222f5bbd8b7f1e2c865b90431d
DIFF: https://github.com/llvm/llvm-project/commit/25986a21ef6de4222f5bbd8b7f1e2c865b90431d.diff

LOG: [llvm-jitlink] Don't hardcode LLVM version number into the runtime path.

This should unbreak builders that were failing due to different patch numbers.

Added: 
    

Modified: 
    llvm/tools/llvm-jitlink/llvm-jitlink.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
index 645d5aa574555..6e03d63cbf750 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
+++ b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp
@@ -1191,7 +1191,11 @@ static Error sanitizeArguments(const Triple &TT, const char *ArgV0) {
       if (DefaultOrcRuntimePath.endswith("bin"))
         sys::path::remove_filename(DefaultOrcRuntimePath); // remove 'bin'
       sys::path::append(DefaultOrcRuntimePath,
-                        "lib/clang/13.0.0/lib/darwin/libclang_rt.orc_osx.a");
+                        ("lib/clang/" + Twine(LLVM_VERSION_MAJOR) + "." +
+                         Twine(LLVM_VERSION_MINOR) + "." +
+                         Twine(LLVM_VERSION_PATCH) +
+                         "/lib/darwin/libclang_rt.orc_osx.a")
+                            .str());
       OrcRuntimePath = DefaultOrcRuntimePath.str().str();
     }
   }


        


More information about the llvm-commits mailing list