-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
[CMake/Bazel] Support usage of opt driver as a library #79205
Conversation
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.
If we're going to make opt-driver a library, it should be a library for both CMake and Bazel builds. The set of available libraries shouldn't depend on how you build LLVM.
I'm fine with that but FYI I emulated the clang approach, which does have this in Bazel (
|
1c9d5c6
to
5b376e9
Compare
@efriedma-quic added a CMake Library for opt. I presume we should add one for clang as well, but that should probably be a separate PR. |
12ede4b
to
bf11098
Compare
Looks okay to me, but I'm a bit worried there's something I'm missing, so I'd like a second reviewer to chime in. |
ec2e2e2
to
2ead782
Compare
Consider naming the project, so if other people do any change, they can find the project name from the commit message... It may be worth testing the following configurations:
|
eb21d98
to
d2f8cdd
Compare
@efriedma-quic @MaskRay when I did the build matrix of options unfortunately the @efriedma-quic note, since I had to make a separate driver function, I made it future compatible for #79227. Once this lands, I will rebase the new test/driver in that PR on this. |
d2f8cdd
to
56b7e08
Compare
add_llvm_tool(opt | ||
# We don't want to link this into libLLVM | ||
add_llvm_library(LLVMOptDriver | ||
STATIC |
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.
The usual llvlm style is to have one target per directory. If this is now a lib, could you move this into llvm/tools/opt/lib? Then you don't need the PARTIAL_SOURCES_INTENDED below.
Also, this doesn't build, see e.g. here: https://lab.llvm.org/buildbot/#/builders/217/builds/35051 |
This reverts commit 32f7922. Doesn't build, see #79205 (comment)
Reverted in be08be5 for now. |
Hm are we sure this PR contributed that failure.
The link you sent seems to be in MachineScehduler.cpp
…On Wed, Jan 24, 2024 at 1:52 PM Nico Weber ***@***.***> wrote:
Reverted in be08be5
<be08be5>
for now.
—
Reply to this email directly, view it on GitHub
<#79205 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJTUXDQVCL7C3MCE6FATUTYQFJ7NAVCNFSM6AAAAABCHTUNUWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBYG4ZTCMRWHA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Whoops, sorry, the build failure was due to something else! I'll reland, apologies. Please do move the lib to its own dir though. |
This reverts commit be08be5. The build error was due to a different change, apologies!
Relanded in 3135984. Apologies again. |
Will do! |
In Bazel, Clang current separates the clang executable into a clang-driver library, and the actual clang executable. This allows downstream users to make their own variations of clang, without having to redo/maintain separate build pipelines.
This adds the same for opt for both CMake and Bazel.