John Paul Adrian Glaubitz via llvm-dev
2018-Aug-19 14:29 UTC
[llvm-dev] Adding minimal target support to build clang
Hi! In Debian, we have recently run into the situation that the package qttools-opensource-src has added LLVM's clang parser as a build dependency with the effect that the package can no longer be built for a couple of architectures like alpha or ia64 [1].>From my current understanding, qttools-opensource-src is merely using theparser part in clang to parse C/C++ code for code analysis which is not necessarily an architecture-specific task. Now, does anyone know whether it would be possible to enable this feature on any given architecture without having to add a full target backend to LLVM? Maybe we could just build an LLVM variant on unsupported targets with the x86 backend enabled (in case it's mandatory to have at least one backend enabled). Thanks, Adrian> [1] https://buildd.debian.org/status/package.php?p=qttools-opensource-src&suite=sid-- .''`. John Paul Adrian Glaubitz : :' : Debian Developer - glaubitz at debian.org `. `' Freie Universitaet Berlin - glaubitz at physik.fu-berlin.de `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
David Blaikie via llvm-dev
2018-Aug-19 16:07 UTC
[llvm-dev] Adding minimal target support to build clang
Backends are necessary for parsing because clang parses inline assembly using the llvm integrated assembles, if I recall correctly On Sun., 19 Aug. 2018, 7:30 am John Paul Adrian Glaubitz via llvm-dev, < llvm-dev at lists.llvm.org> wrote:> Hi! > > In Debian, we have recently run into the situation that the package > qttools-opensource-src has added LLVM's clang parser as a build dependency > with the effect that the package can no longer be built for a couple of > architectures like alpha or ia64 [1]. > > From my current understanding, qttools-opensource-src is merely using the > parser part in clang to parse C/C++ code for code analysis which is not > necessarily an architecture-specific task. > > Now, does anyone know whether it would be possible to enable this feature > on any given architecture without having to add a full target backend to > LLVM? Maybe we could just build an LLVM variant on unsupported targets > with the x86 backend enabled (in case it's mandatory to have at least > one backend enabled). > > Thanks, > Adrian > > > [1] > https://buildd.debian.org/status/package.php?p=qttools-opensource-src&suite=sid > > -- > .''`. John Paul Adrian Glaubitz > : :' : Debian Developer - glaubitz at debian.org > `. `' Freie Universitaet Berlin - glaubitz at physik.fu-berlin.de > `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913 > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180819/87079cb0/attachment.html>
Justin Bogner via llvm-dev
2018-Aug-20 06:08 UTC
[llvm-dev] Adding minimal target support to build clang
John Paul Adrian Glaubitz via llvm-dev <llvm-dev at lists.llvm.org> writes:> Hi! > > In Debian, we have recently run into the situation that the package > qttools-opensource-src has added LLVM's clang parser as a build dependency > with the effect that the package can no longer be built for a couple of > architectures like alpha or ia64 [1]. > > From my current understanding, qttools-opensource-src is merely using the > parser part in clang to parse C/C++ code for code analysis which is not > necessarily an architecture-specific task.Building llvm without any backends is supposed to work (and has in the past!), but it appears to fail quite a few tests currently. You can try this by calling cmake with -DLLVM_TARGETS_TO_BUILD=''. I don't know if clang works in that configuration, especially given David's point about inline assembly.> Now, does anyone know whether it would be possible to enable this feature > on any given architecture without having to add a full target backend to > LLVM? Maybe we could just build an LLVM variant on unsupported targets > with the x86 backend enabled (in case it's mandatory to have at least > one backend enabled). > > Thanks, > Adrian > >> [1] > https://buildd.debian.org/status/package.php?p=qttools-opensource-src&suite=sid
Bruce Hoult via llvm-dev
2018-Aug-20 06:23 UTC
[llvm-dev] Adding minimal target support to build clang
I've been regularly building llvm+clang with -DLLVM_TARGETS_TO_BUILD='' but a non-empty LLVM_EXPERIMENTAL_TARGETS_TO_BUILD. On Sun, Aug 19, 2018 at 11:08 PM, Justin Bogner via llvm-dev < llvm-dev at lists.llvm.org> wrote:> John Paul Adrian Glaubitz via llvm-dev <llvm-dev at lists.llvm.org> writes: > > Hi! > > > > In Debian, we have recently run into the situation that the package > > qttools-opensource-src has added LLVM's clang parser as a build > dependency > > with the effect that the package can no longer be built for a couple of > > architectures like alpha or ia64 [1]. > > > > From my current understanding, qttools-opensource-src is merely using the > > parser part in clang to parse C/C++ code for code analysis which is not > > necessarily an architecture-specific task. > > Building llvm without any backends is supposed to work (and has in the > past!), but it appears to fail quite a few tests currently. You can try > this by calling cmake with -DLLVM_TARGETS_TO_BUILD=''. I don't know if > clang works in that configuration, especially given David's point about > inline assembly. > > > Now, does anyone know whether it would be possible to enable this feature > > on any given architecture without having to add a full target backend to > > LLVM? Maybe we could just build an LLVM variant on unsupported targets > > with the x86 backend enabled (in case it's mandatory to have at least > > one backend enabled). > > > > Thanks, > > Adrian > > > >> [1] > > https://buildd.debian.org/status/package.php?p=qttools- > opensource-src&suite=sid > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180819/bdc89f81/attachment.html>
Friedman, Eli via llvm-dev
2018-Aug-20 19:17 UTC
[llvm-dev] Adding minimal target support to build clang
On 8/19/2018 7:29 AM, John Paul Adrian Glaubitz via llvm-dev wrote:> Hi! > > In Debian, we have recently run into the situation that the package > qttools-opensource-src has added LLVM's clang parser as a build dependency > with the effect that the package can no longer be built for a couple of > architectures like alpha or ia64 [1]. > > From my current understanding, qttools-opensource-src is merely using the > parser part in clang to parse C/C++ code for code analysis which is not > necessarily an architecture-specific task.clang needs to support a target to some extent to parse C code for that target. Among other things, it needs to define target-specific macros, it needs to know the correct sizes for a bunch of different types, and it needs to parse target-specific intrinsics. See clang/lib/Basic/Targets/. And depending on what you're doing, you might need support for parsing target-specific options and finding the correct include paths; this code is part of clang/lib/Driver/. If there's some specific use-case for adding this support for a target which doesn't have a corresponding LLVM backend, we could consider it; the maintenance burden is relatively small.> Now, does anyone know whether it would be possible to enable this feature > on any given architecture without having to add a full target backend to > LLVM? Maybe we could just build an LLVM variant on unsupported targets > with the x86 backend enabled (in case it's mandatory to have at least > one backend enabled).LLVM is always a cross-compiler: you can build it any number of targets enabled, and it should build on any machine with a supported C++ compiler. See https://llvm.org/docs/GettingStarted.html . -Eli -- Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project