-
Notifications
You must be signed in to change notification settings - Fork 110
[flang] Add dependency for out-of-tree flang on compiler-rt #482
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
flang on AArch64 now always depends on compiler-rt so it needs to be built in the main LLVM build for the out-of-tree flang bots.
@@ -19,7 +19,7 @@ def getFlangOutOfTreeBuildFactory( | |||
f = getCmakeWithNinjaBuildFactory( | |||
depends_on_projects=['llvm','clang','mlir','openmp','flang','flang-rt'], | |||
enable_projects=['llvm','clang','mlir'], | |||
enable_runtimes=['openmp'], | |||
enable_runtimes=['openmp', 'compiler-rt'], |
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.
I'm not sure, but I think that 'compiler-rt' should also be added to depends_on_projects
.
My understanding is that this way builds are also triggered by changes in compiler-rt.
Add compiler-rt to depends_on_projects
https://lab.llvm.org/staging/#/builders/46/builds/4084 uses the out of tree config now too, so this will fix that builder as well. I don't see any more of our Flang builders with this issue, so we can assume they don't need changing. |
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.
LGTM
In-tree flang has the dependency listed in the cmake so compiler-rt will get auto added, in the same way flang-rt does. There's just no real way to do this for out of tree flang unfortunately. I'm also adding to the release notes to note this new dependency on compiler-rt. |
This is now present on staging, but the flang-libcxx builder is still failing the test. The initial llvm build has compiler-rt now:
Test fails:
I see two of those files, but not in that location:
I think @luporl can you take a look at this? |
It looks like after llvm/llvm-project#144710 out-of-tree flang can't build executables anymore, when it is run from its build dir.
The problem is that, unlike flang-rt, compiler-rt builtins' path is hardcoded, so I don't know if it is possible to work around it using driver flags only. Appending the correct path to builtins doesn't work, as the linker still complains that the other library was not found. Even when out-of-tree flang is installed, it will only be able to find compiler-rt builtins, and thus generate binaries, if it is installed in the same directory as the unified tree. @DavidTruby, do you have any suggestions on how to address this issue? |
Oh, I see. How does an out of tree clang with -DCLANG_DEFAULT_RTLIB=compiler-rt resolve this, if at all? I guess I should have a look at that... |
Does clang support being built out of tree? Is it documented somewhere? I tried it but got blocked by some cmake errors. |
Clang is supposed to be able to be built standalone with pre-compiled LLVM: It is possible that it is not working anymore because nobody is testing it. |
Sorry, I just got around to looking at this again; clang has the same issue as flang here if built out of tree with -DCLANG_DEFAULT_RTLIB=compiler-rt. The driver code simply assumes that the path to compiler-rt is relative to the driver itself. I think changing this might be non-trivial. |
I think @MaskRay might know better what the logic is for how clang looks for compiler-rt; maybe they have an idea what we could do? |
flang on AArch64 now always depends on compiler-rt so it needs to be
built in the main LLVM build for the out-of-tree flang bots.