-
Notifications
You must be signed in to change notification settings - Fork 14.9k
[Flang] Fix BUILD_SHARED_LIBS build #155422
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
Conversation
@llvm/pr-subscribers-flang-fir-hlfir Author: Michael Kruse (Meinersbur) ChangesIn contrast to linking a static library, when linking a shared library all referenced symbols must be available in either the objects files, static libraries, or shared libraries passed to the linker command line and cannot be deferred to when building the executable. We have buildbots that build with BUILD_SHARED_LIBS=ON such that new link symbol dependencies (e.g. by a new call of a non-inlined function from a header of another component) are detected post-commit, but we don't seem to have any for Flang, which means such build breakages may go unnoticed. Fixes #150027 Same fix as included #152223, but with only the changes necessary to fix #150027. Full diff: https://github.com/llvm/llvm-project/pull/155422.diff 2 Files Affected:
diff --git a/flang/lib/Optimizer/Builder/CMakeLists.txt b/flang/lib/Optimizer/Builder/CMakeLists.txt
index 8fb36a750d433..404afd185fd31 100644
--- a/flang/lib/Optimizer/Builder/CMakeLists.txt
+++ b/flang/lib/Optimizer/Builder/CMakeLists.txt
@@ -50,6 +50,7 @@ add_flang_library(FIRBuilder
FIRDialectSupport
FIRSupport
FortranEvaluate
+ FortranSupport
HLFIRDialect
MLIR_DEPS
diff --git a/flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt b/flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt
index cc74273d9c5d9..3775a13e31e95 100644
--- a/flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt
+++ b/flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt
@@ -27,6 +27,8 @@ add_flang_library(HLFIRTransforms
FIRSupport
FIRTransforms
FlangOpenMPTransforms
+ FortranEvaluate
+ FortranSupport
HLFIRDialect
LINK_COMPONENTS
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like a reapply of something that already worked for us.
We have this one for flang -> https://lab.llvm.org/buildbot/#/builders/80 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Mmmh, I would have assumed it should be failing then because |
Is the |
In contrast to linking a static library, when linking a shared library all referenced symbols must be available in either the objects files, static libraries, or shared libraries passed to the linker command line and cannot be deferred to when building the executable.
We have buildbots that build with BUILD_SHARED_LIBS=ON such that new link symbol dependencies (e.g. by a new call of a non-inlined function from a header of another component) are detected post-commit, but we don't seem to have any for Flang, which means such build breakages may go unnoticed.
Fixes #150027
Same fix as included in #152223, but with only the changes necessary to fix #150027 (which is unrelated with GCC 15)