[PATCH] D109977: LLVM Driver Multicall tool

2022-07-20 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. Ok, I've made D130158 as an absolutely minimal change that seems to fix it for me. Basically, I'm skipping all the driver-related logic that's not strictly necessary when `LLVM_TOOL_LLVM_DRIVER_BUILD` is off. The driver remains broken w

[PATCH] D109977: LLVM Driver Multicall tool

2022-07-19 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. Unsurprisingly, it fails just the same because using an undefined variable is equivalent to not using it at all, so once again you're trying to link to static libraries that are *not there*. When dylib linking is used, you can't link to static libraries here. Repositor

[PATCH] D109977: LLVM Driver Multicall tool

2022-07-19 Thread Alex Brachet via Phabricator via cfe-commits
abrachet added a comment. In D109977#3662859 , @mgorny wrote: > The actual problem is that you're passing `${USE_SHARED}` to `llvm_config()` > (in `add_llvm_executable`) before it's defined. Moving the definition earlier > fixed this error but uncovers

[PATCH] D109977: LLVM Driver Multicall tool

2022-07-19 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. If you didn't apply my patch, then it works from in-tree build because it uses static libs instead of the dylib. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109977/new/ https://reviews.llvm.org/D109977 __

[PATCH] D109977: LLVM Driver Multicall tool

2022-07-19 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D109977#3662859 , @mgorny wrote: > Ok, I think the key to reproducing it is `-DLLVM_LINK_LLVM_DYLIB=ON`. We pass > that while building LLVM, so it gets passed on to clang but I suppose passing > it to clang build might be suf

[PATCH] D109977: LLVM Driver Multicall tool

2022-07-19 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. Ok, I think the key to reproducing it is `-DLLVM_LINK_LLVM_DYLIB=ON`. We pass that while building LLVM, so it gets passed on to clang but I suppose passing it to clang build might be sufficient to reproduce the problem. The actual problem is that you're passing `${USE_SH

[PATCH] D109977: LLVM Driver Multicall tool

2022-07-19 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. Unfortunately, that doesn't seem to be it. I think at this point it would be easier for both of us if I tried to figure it out myself on Gentoo rather than trying to make it reproducible elsewhere. If you want, you could try grabbing e.g. a Gentoo stage3 image (e.g. via

[PATCH] D109977: LLVM Driver Multicall tool

2022-07-19 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. Hmm, I have another idea. Do you have individual LLVM static (or shared) libraries installed? On Gentoo we install only the dylib and a few unavoidable static libs: /usr/lib/llvm/15/lib64/libRemarks.so /usr/lib/llvm/15/lib64/libRemarks.so.15git /usr/lib/llvm/15/lib

[PATCH] D109977: LLVM Driver Multicall tool

2022-07-19 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. > Personally I really wish that the build system issue can be fixed in the > upcoming 15.0.0 release and encourage distributions to use it to decrease > executable sizes. Me too, not because of multicall but because right now it's impossible to even build clang with mul

[PATCH] D109977: LLVM Driver Multicall tool

2022-07-18 Thread Alex Brachet via Phabricator via cfe-commits
abrachet added a comment. Thanks @mgorny I was able to get CMake to run. Although I didn't end up with the same error as you. I simply had warnings: CMake Warning (dev) at /usr/local/lib/cmake/llvm/TableGen.cmake:103 (add_custom_command): Policy CMP0116 is not set: Ninja generators transf

[PATCH] D109977: LLVM Driver Multicall tool

2022-07-18 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D109977#3660734 , @mgorny wrote: > In D109977#3660006 , @abrachet > wrote: > >> In D109977#3652467 , @mgorny wrote: >> >>> Though I can reprod

[PATCH] D109977: LLVM Driver Multicall tool

2022-07-18 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. In D109977#3660006 , @abrachet wrote: > In D109977#3652467 , @mgorny wrote: > >> Though I can reproduce it with much shorter: >> >> mkdir build >> cd build >> cmake ../clang -G Ninja

[PATCH] D109977: LLVM Driver Multicall tool

2022-07-18 Thread Alex Brachet via Phabricator via cfe-commits
abrachet added a comment. In D109977#3652467 , @mgorny wrote: > In D109977#3652091 , @abrachet > wrote: > >> Could I have a cmake invocation or a bot link? > > The exact CMake invocation for clang is: > > cmake

[PATCH] D109977: LLVM Driver Multicall tool

2022-07-14 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. In D109977#3652091 , @abrachet wrote: > Could I have a cmake invocation or a bot link? The exact CMake invocation for clang is: cmake -C /var/tmp/portage/sys-devel/clang-15.0.0./work/x/y/clang-abi_x86_64.amd64/gentoo_commo

[PATCH] D109977: LLVM Driver Multicall tool

2022-07-14 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. In D109977#3652091 , @abrachet wrote: > In D109977#3611683 , @mgorny wrote: > >> This seems to have broken standalone builds for Gentoo. >> >> While building Clang, I get: >> >> CMake Erro

[PATCH] D109977: LLVM Driver Multicall tool

2022-07-14 Thread Alex Brachet via Phabricator via cfe-commits
abrachet marked an inline comment as done. abrachet added a comment. In D109977#3611683 , @mgorny wrote: > This seems to have broken standalone builds for Gentoo. > > While building Clang, I get: > > CMake Error at /usr/lib/llvm/15/lib/cmake/llvm/LLVM-C

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-27 Thread Michał Górny via Phabricator via cfe-commits
mgorny added a comment. This seems to have broken standalone builds for Gentoo. While building Clang, I get: CMake Error at /usr/lib/llvm/15/lib/cmake/llvm/LLVM-Config.cmake:138 (message): Target Sparc is not in the set of libraries. Call Stack (most recent call first): /usr/lib/llv

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-09 Thread Nikita Popov via Phabricator via cfe-commits
nikic added inline comments. Comment at: llvm/cmake/modules/AddLLVM.cmake:890 +configure_file( + ${LLVM_MAIN_SRC_DIR}/cmake/driver-template.cpp.in + ${CMAKE_CURRENT_BINARY_DIR}/${name}-driver.cpp) nikic wrote: > nikic wrote: > > chapuni wrote: > > >

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-09 Thread Nikita Popov via Phabricator via cfe-commits
nikic added inline comments. Comment at: llvm/cmake/modules/AddLLVM.cmake:890 +configure_file( + ${LLVM_MAIN_SRC_DIR}/cmake/driver-template.cpp.in + ${CMAKE_CURRENT_BINARY_DIR}/${name}-driver.cpp) nikic wrote: > chapuni wrote: > > Do you have a plan

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-09 Thread Nikita Popov via Phabricator via cfe-commits
nikic added inline comments. Comment at: llvm/cmake/modules/AddLLVM.cmake:890 +configure_file( + ${LLVM_MAIN_SRC_DIR}/cmake/driver-template.cpp.in + ${CMAKE_CURRENT_BINARY_DIR}/${name}-driver.cpp) chapuni wrote: > Do you have a plan to export the te

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-06 Thread Nico Weber via Phabricator via cfe-commits
thakis added inline comments. Comment at: llvm/test/lit.cfg.py:142 tools = [ +ToolSubst('%llvm', FindTool('llvm')), ToolSubst('%lli', FindTool('lli'), post='.', extra_args=lli_args), abrachet wrote: > thakis wrote: > > This causes `llvm-lit: > > /Users

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-06 Thread NAKAMURA Takumi via Phabricator via cfe-commits
chapuni added a comment. An interesting improvement. Thanks. Comment at: llvm/cmake/modules/AddLLVM.cmake:890 +configure_file( + ${LLVM_MAIN_SRC_DIR}/cmake/driver-template.cpp.in + ${CMAKE_CURRENT_BINARY_DIR}/${name}-driver.cpp) Do you have a plan

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-06 Thread Alex Brachet via Phabricator via cfe-commits
abrachet marked an inline comment as done. abrachet added inline comments. Comment at: llvm/test/lit.cfg.py:142 tools = [ +ToolSubst('%llvm', FindTool('llvm')), ToolSubst('%lli', FindTool('lli'), post='.', extra_args=lli_args), thakis wrote: > This caus

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-06 Thread Nico Weber via Phabricator via cfe-commits
thakis added inline comments. Comment at: llvm/test/lit.cfg.py:142 tools = [ +ToolSubst('%llvm', FindTool('llvm')), ToolSubst('%lli', FindTool('lli'), post='.', extra_args=lli_args), This causes `llvm-lit: /Users/thakis/src/llvm-project/llvm/utils/lit/

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-05 Thread Alex Brachet via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. abrachet marked 2 inline comments as done. Closed by commit rGf06abbb39380: LLVM Driver Multicall tool (authored by beanz, committed by abrachet). Repository: rG LLV

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-05 Thread Alex Brachet via Phabricator via cfe-commits
abrachet marked 2 inline comments as done. abrachet added inline comments. Comment at: llvm/cmake/modules/AddLLVM.cmake:2030 +string(REPLACE "-" "_" key ${link_name}) +string(REPLACE "+" "p" key ${key}) +string(REPLACE "llvm-" "" tool_name ${link_name}) --

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-05 Thread Alex Brachet via Phabricator via cfe-commits
abrachet updated this revision to Diff 434370. abrachet marked an inline comment as done. abrachet added a comment. - Fix bazel build, `llvm-driver` can't be built by bazel, but the existing tools which lost their `main` will still work. - Remove `--version` - Fix `dsymutil` not depending on `Dsy

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-05 Thread Petr Hosek via Phabricator via cfe-commits
phosek accepted this revision. phosek added a comment. LGTM Comment at: llvm/cmake/modules/AddLLVM.cmake:2030 +string(REPLACE "-" "_" key ${link_name}) +string(REPLACE "+" "p" key ${key}) +string(REPLACE "llvm-" "" tool_name ${link_name}) Alternativ

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-05 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay accepted this revision. MaskRay added a comment. This revision is now accepted and ready to land. LGTM from my perspective, but this needs someone else's review. Comment at: llvm/tools/llvm-driver/llvm-driver.cpp:50 + bool ConsumeFirstArg = false; + if (LaunchedTool =

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-05 Thread Alex Brachet via Phabricator via cfe-commits
abrachet marked 5 inline comments as done. abrachet added a comment. In D109977#3558762 , @MaskRay wrote: > Thanks for picking up the change. I confirm that I can build `llvm` without > an error and it appears to work fine. > >> llvm-driver can be disabl

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-05 Thread Alex Brachet via Phabricator via cfe-commits
abrachet updated this revision to Diff 434352. abrachet marked an inline comment as done. abrachet edited the summary of this revision. abrachet added a comment. Better handling of names with version, ie `llvm-cxxfilt-15` -> `cxxfilt` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109977/

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-04 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. % /tmp/out/custom1/bin/llvm --help OVERVIEW: llvm compiler driver USAGE: llvm [subcommand] [options] SUBCOMMANDS: ar- ar ## should be llvm-ar bitcode-strip - bitcode-strip ### should be llvm-bitcode-strip clang

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-04 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. > llvm-driver can be disabled from builds by setting > LLVM_TOOL_LLVM_DRIVER_BUILD=Off. I think this should be opt-in. The new `llvm` executable takes a lot of space and not needed by many developers/build bots. It's useful to some groups (distributions) but they can sp

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-04 Thread Alex Brachet via Phabricator via cfe-commits
abrachet marked 5 inline comments as done. abrachet added a comment. In D109977#3378312 , @phosek wrote: > Another potential future improvement is error reporting for subcommands: > > $ ./bin/llvm clang > llvm: error: no input files > $ ./bin

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-04 Thread Alex Brachet via Phabricator via cfe-commits
abrachet updated this revision to Diff 434277. abrachet added a comment. Herald added a subscriber: hiraditya. - `llvm llvm-$tool` -> `llvm $tool` - Error messages will now show `$tool: error: ...` instead of `error: ...` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109977/new/ https:/

[PATCH] D109977: LLVM Driver Multicall tool

2022-06-04 Thread Alex Brachet via Phabricator via cfe-commits
abrachet commandeered this revision. abrachet added a reviewer: beanz. abrachet added a comment. I spoke to @beanz offline to make sure he is still ok with the patch being commandeered. Thanks for the patch @beanz, very excited about this :) Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D109977: LLVM Driver Multicall tool

2022-03-24 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. In D109977#3405687 , @phosek wrote: > @beanz Let me know if you need help, I'm happy to commandeer the change if > you're too busy. Please feel free to commandeer it. I'm really sorry I've held this up so long and I'm totally swa

[PATCH] D109977: LLVM Driver Multicall tool

2022-03-24 Thread Petr Hosek via Phabricator via cfe-commits
phosek added a comment. Herald added a subscriber: StephenFan. @beanz Let me know if you need help, I'm happy to commandeer the change if you're too busy. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109977/new/ https://reviews.llvm.org/D109977

[PATCH] D109977: LLVM Driver Multicall tool

2022-03-13 Thread Petr Hosek via Phabricator via cfe-commits
phosek added a comment. Another potential future improvement is error reporting for subcommands: $ ./bin/llvm clang llvm: error: no input files $ ./bin/clang clang-15: error: no input files Ideally, the multicall tool would produce the same error message. C

[PATCH] D109977: LLVM Driver Multicall tool

2022-03-12 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. Herald added a project: All. In D109977#3282545 , @MaskRay wrote: > I have tried the latest diff but > `-DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;flang;lldb;lld;compiler-rt;openmp;mlir;cross-project-tests' > -DLLVM_TOOL_LL

[PATCH] D109977: LLVM Driver Multicall tool

2022-01-29 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. Hope that someone familiar with CMake can take a look. > As currently implemented llvm-driver contains dsymutil, llvm-ar, > llvm-cxxfilt, llvm-objcopy, and clang (if clang is included in the build). I think either (bundled clang+binary utilities) or (bundled lld+binary

[PATCH] D109977: LLVM Driver Multicall tool

2022-01-28 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 404114. beanz added a comment. Adding support for multiple subcommands mapping to the same entry. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109977/new/ https://reviews.llvm.org/D109977 Files: clang/cmake/m

[PATCH] D109977: LLVM Driver Multicall tool

2022-01-28 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. Sorry for disappearing on this. I'm working right now on adding support for multi-entry tools (like objcopy). I'll get an update in today. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109977/new/ https://reviews.llvm.org/D1

[PATCH] D109977: LLVM Driver Multicall tool

2022-01-28 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. Ping @beanz Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109977/new/ https://reviews.llvm.org/D109977 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[PATCH] D109977: LLVM Driver Multicall tool

2021-10-22 Thread Petr Hosek via Phabricator via cfe-commits
phosek added a comment. @beanz Is this ready to land or do you plan on making any more changes? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109977/new/ https://reviews.llvm.org/D109977 ___ cfe-commits

[PATCH] D109977: LLVM Driver Multicall tool

2021-09-17 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: llvm/tools/llvm-objcopy/llvm-objcopy.cpp:404 -int main(int argc, char **argv) { +int llvm_objcopy_main(int argc, char **argv) { InitLLVM X(argc, argv); aganea wrote: > Shouldn't we say: > ``` > int objcopy_main(int ar

[PATCH] D109977: LLVM Driver Multicall tool

2021-09-17 Thread Alexandre Ganea via Phabricator via cfe-commits
aganea added a comment. This is really a great change, thanks @beanz! Comment at: llvm/tools/llvm-objcopy/llvm-objcopy.cpp:404 -int main(int argc, char **argv) { +int llvm_objcopy_main(int argc, char **argv) { InitLLVM X(argc, argv); Shouldn't we say: ```

[PATCH] D109977: LLVM Driver Multicall tool

2021-09-17 Thread Chris Bieneman via Phabricator via cfe-commits
beanz updated this revision to Diff 373300. beanz added a comment. Renaming llvm-driver binary to llvm. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109977/new/ https://reviews.llvm.org/D109977 Files: clang/cmake/modules/AddClang.cmake clang/

[PATCH] D109977: LLVM Driver Multicall tool

2021-09-17 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added inline comments. Comment at: llvm/tools/llvm-driver/CMakeLists.txt:17 + +add_llvm_tool(llvm-driver + llvm-driver.cpp phosek wrote: > As was already suggested on D104686, I'd prefer naming this just `llvm` so > you can invoke tools with `llvm name` w

[PATCH] D109977: LLVM Driver Multicall tool

2021-09-17 Thread Chris Bieneman via Phabricator via cfe-commits
beanz added a comment. In D109977#3006687 , @mehdi_amini wrote: > That's pretty nice! Have you thought about looking into a lit option > (triggered by a cmake flag maybe) that would change the substitution for the > tools that are enabled by llvm-drive

[PATCH] D109977: LLVM Driver Multicall tool

2021-09-17 Thread Petr Hosek via Phabricator via cfe-commits
phosek added inline comments. Comment at: llvm/tools/llvm-driver/CMakeLists.txt:17 + +add_llvm_tool(llvm-driver + llvm-driver.cpp As was already suggested on D104686, I'd prefer naming this just `llvm` so you can invoke tools with `llvm name` which doesn't requ

[PATCH] D109977: LLVM Driver Multicall tool

2021-09-17 Thread Mehdi AMINI via Phabricator via cfe-commits
mehdi_amini added a comment. That's pretty nice! Have you thought about looking into a lit option (triggered by a cmake flag maybe) that would change the substitution for the tools that are enabled by llvm-driver to use the latter instead when running the tests? Repository: rG LLVM Github Mo

[PATCH] D109977: LLVM Driver Multicall tool

2021-09-17 Thread Chris Bieneman via Phabricator via cfe-commits
beanz created this revision. beanz added reviewers: leonardchan, phosek, MaskRay, compnerd, mehdi_amini. Herald added subscribers: rupprecht, mgorny. Herald added a reviewer: JDevlieghere. Herald added a reviewer: alexander-shaposhnikov. Herald added a reviewer: rupprecht. Herald added a reviewer: