[llvm] [llvm] explicitly link llvm-jitlink-executor with ExecutionEngine (PR #144778)
Andrew Rogers via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 18 11:34:59 PDT 2025
https://github.com/andrurogerz created https://github.com/llvm/llvm-project/pull/144778
## Overview
Explicitly link `llvm-jitlink-executor` with `ExecutionEngine` to avoid link failures when building LLVM as a Windows DLL. This link dependency should probably have always been declared here, but didn't matter when building against an LLVM static library because it was (presumably) picked up as a transitive dependency.
This change is required to enable the Windows DLL build because `llvm-jitlink-executor` is declared using `add_llvm_utility` which invokes `add_llvm_executable` with [`DISABLE_LLVM_LINK_LLVM_DYLIB`](https://github.com/llvm/llvm-project/blob/main/llvm/cmake/modules/AddLLVM.cmake#L500-L502) so it links statically against its dependencies instead of against the main LLVM library.
## Background
The effort to support building LLVM as a Windows DLL is tracked in #109483. Additional context is provided in [this discourse](https://discourse.llvm.org/t/psa-annotating-llvm-public-interface/85307).
>From 1f25e1f008c6b92a4a76bdc4b39871ca4c63bb5a Mon Sep 17 00:00:00 2001
From: Andrew Rogers <andrurogerz at gmail.com>
Date: Wed, 18 Jun 2025 10:53:30 -0700
Subject: [PATCH] [llvm] explicitly link llvm-jitlink-executor with
ExecutionEngine
---
llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt b/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt
index f2daa294eec07..792ecf544f616 100644
--- a/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt
+++ b/llvm/tools/llvm-jitlink/llvm-jitlink-executor/CMakeLists.txt
@@ -1,4 +1,5 @@
set(LLVM_LINK_COMPONENTS
+ ExecutionEngine
OrcShared
OrcTargetProcess
Support
More information about the llvm-commits
mailing list