[PATCH] D117781: [flang] Update tco tool pipline and add translation to LLVM IR

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 24 04:09:50 PST 2022


clementval added a comment.

In D117781#3265649 <https://reviews.llvm.org/D117781#3265649>, @awarzynski wrote:

> Hi @clementval , thanks for this patch! I saw the buildbot failure that led to this being reverted: https://lab.llvm.org/buildbot/#/builders/177/builds/3311:
>
>   ./bin/tco --target=aarch64-unknown-linux-gnu /home/kircha02/llvm-project/flang/test/Fir/basic-program.fir
>   : CommandLine Error: Option 'aarch64-enable-ccmp' registered more than once!
>   LLVM ERROR: inconsistency in registered CommandLine options
>   Aborted (core dumped)
>
> I took a quick look and I think that "flang/tools/tco/CMakeLists.txt" needs tweaking, In particular, `LLVM_LINK_COMPONENTS` is used in add_llvm_executable <https://github.com/llvm/llvm-project/blob/e7cb716ef95551000d9de2d0334ab1bf84a120a3/llvm/cmake/modules/AddLLVM.cmake#L942> (which is called by `add_flang_tool`). So, I think that this will cause some libraries to be included twice in the list of dependencies:
>
>   target_link_libraries(tco PRIVATE
>     ${llvm_libs}
>   )
>
> which in turn would lead to some command line options being registered twice.
>
> Also, `llvm-config --components` suggests that these aren't really components (I might be reading it wrong though):
>
>   set(LLVM_LINK_COMPONENTS
>     AllTargetsAsmParsers
>     AllTargetsCodeGens
>     AllTargetsDescs
>     AllTargetsInfos
>   )
>
> Why not use `${LLVM_TARGETS_TO_BUILD}` instead? HTH!

Hi @awarzynski!

I figured out the same thing I just updated the patch to reflect that. Other tools like the new bolt-driver or clang and llvm tools are using the same mechanism.

Thanks for looking at this as well.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D117781/new/

https://reviews.llvm.org/D117781



More information about the llvm-commits mailing list