Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mlir-cpu-runner] Pass --exclude-libs to linker when building runner #122329

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andfau-amd
Copy link
Contributor

This fixes a conflict between the version of LLVM linked against by the runner and the unrelated version of LLVM that may be dynamically loaded by a graphics driver. (Relevant to #73457: fixes loading certain Vulkan drivers.)

This fixes a conflict between the version of LLVM linked against by the
runner and the unrelated version of LLVM that may be dynamically loaded
by a graphics driver. (Relevant to llvm#73457: fixes loading certain Vulkan
drivers.)
@andfau-amd andfau-amd requested a review from Hardcode84 January 9, 2025 18:21
@llvmbot llvmbot added mlir:core MLIR Core Infrastructure mlir labels Jan 9, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 9, 2025

@llvm/pr-subscribers-mlir

Author: Andrea Faulds (andfau-amd)

Changes

This fixes a conflict between the version of LLVM linked against by the runner and the unrelated version of LLVM that may be dynamically loaded by a graphics driver. (Relevant to #73457: fixes loading certain Vulkan drivers.)


Full diff: https://github.com/llvm/llvm-project/pull/122329.diff

1 Files Affected:

  • (modified) mlir/tools/mlir-cpu-runner/CMakeLists.txt (+7)
diff --git a/mlir/tools/mlir-cpu-runner/CMakeLists.txt b/mlir/tools/mlir-cpu-runner/CMakeLists.txt
index 811583b97bc71d..f6ed2ed414647c 100644
--- a/mlir/tools/mlir-cpu-runner/CMakeLists.txt
+++ b/mlir/tools/mlir-cpu-runner/CMakeLists.txt
@@ -26,3 +26,10 @@ target_link_libraries(mlir-cpu-runner PRIVATE
   MLIRExecutionEngine
   MLIRJitRunner
   )
+target_link_options(mlir-cpu-runner
+  PRIVATE
+    # On Linux, disable re-export of any static linked libraries that came
+    # through. This prevents our LLVM build from interfering with the version of
+    # LLVM included in certain graphics drivers.
+    $<$<PLATFORM_ID:Linux>:LINKER:--exclude-libs,ALL>
+)

@llvmbot
Copy link
Member

llvmbot commented Jan 9, 2025

@llvm/pr-subscribers-mlir-core

Author: Andrea Faulds (andfau-amd)

Changes

This fixes a conflict between the version of LLVM linked against by the runner and the unrelated version of LLVM that may be dynamically loaded by a graphics driver. (Relevant to #73457: fixes loading certain Vulkan drivers.)


Full diff: https://github.com/llvm/llvm-project/pull/122329.diff

1 Files Affected:

  • (modified) mlir/tools/mlir-cpu-runner/CMakeLists.txt (+7)
diff --git a/mlir/tools/mlir-cpu-runner/CMakeLists.txt b/mlir/tools/mlir-cpu-runner/CMakeLists.txt
index 811583b97bc71d..f6ed2ed414647c 100644
--- a/mlir/tools/mlir-cpu-runner/CMakeLists.txt
+++ b/mlir/tools/mlir-cpu-runner/CMakeLists.txt
@@ -26,3 +26,10 @@ target_link_libraries(mlir-cpu-runner PRIVATE
   MLIRExecutionEngine
   MLIRJitRunner
   )
+target_link_options(mlir-cpu-runner
+  PRIVATE
+    # On Linux, disable re-export of any static linked libraries that came
+    # through. This prevents our LLVM build from interfering with the version of
+    # LLVM included in certain graphics drivers.
+    $<$<PLATFORM_ID:Linux>:LINKER:--exclude-libs,ALL>
+)

@kuhar kuhar requested a review from joker-eph January 9, 2025 18:31
@Hardcode84
Copy link
Contributor

LGTM, but give it some time for other people to comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mlir:core MLIR Core Infrastructure mlir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants