Krzysztof Parzyszek via llvm-dev
2016-Oct-19 13:38 UTC
[llvm-dev] unable to compile llvm with gcc 4.7.4
On 10/18/2016 4:54 AM, Renato Golin via llvm-dev wrote:> Unfortunately, we don't have a C-only front-end, nor you can select > some C-only libraries in LLVM to compile C-only code. Such a goal > should have been set from the beginning, and honestly, it would have > made LLVM's code horrendous to work with.An option would be to have a C backend again, and then cross-compile the toolchain for the new target, but compile it into C, which then can be recompiled into binaries on the target platform. I actually bootstrapped an SML compiler for FreeBSD/ppc this way a while back. A part of the compiler was written in SML and there was an option to compile SML to C (that was actually one of the ways to generate final code: the C output would then be passed to a system C compiler). I think the SML compiler was mlton, but I'm not 100% certain. -Krzysztof -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Bruce Hoult via llvm-dev
2016-Oct-19 14:43 UTC
[llvm-dev] unable to compile llvm with gcc 4.7.4
On Wed, Oct 19, 2016 at 4:38 PM, Krzysztof Parzyszek via llvm-dev < llvm-dev at lists.llvm.org> wrote:> On 10/18/2016 4:54 AM, Renato Golin via llvm-dev wrote: > >> Unfortunately, we don't have a C-only front-end, nor you can select >> some C-only libraries in LLVM to compile C-only code. Such a goal >> should have been set from the beginning, and honestly, it would have >> made LLVM's code horrendous to work with. >> > > An option would be to have a C backend again, and then cross-compile the > toolchain for the new target, but compile it into C, which then can be > recompiled into binaries on the target platform. > > I actually bootstrapped an SML compiler for FreeBSD/ppc this way a while > back. A part of the compiler was written in SML and there was an option to > compile SML to C (that was actually one of the ways to generate final code: > the C output would then be passed to a system C compiler). I think the SML > compiler was mlton, but I'm not 100% certain. >There are lots of languages that use C as a kind of virtual assembly language as a back end. Usually, little more than K&R is needed. Very often replacing some ancient custom code generator with C to feed to a modern gcc or clang will improve performance considerably. Not to mention being far more portable. What was the difficulty with the C back end previously in LLVM? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161019/d4443816/attachment.html>
Michael Kuperstein via llvm-dev
2016-Oct-20 18:31 UTC
[llvm-dev] unable to compile llvm with gcc 4.7.4
AFAIK, nobody cared about it enough to maintain it, so it bit-rotted. On Wed, Oct 19, 2016 at 7:43 AM, Bruce Hoult via llvm-dev < llvm-dev at lists.llvm.org> wrote:> On Wed, Oct 19, 2016 at 4:38 PM, Krzysztof Parzyszek via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> On 10/18/2016 4:54 AM, Renato Golin via llvm-dev wrote: >> >>> Unfortunately, we don't have a C-only front-end, nor you can select >>> some C-only libraries in LLVM to compile C-only code. Such a goal >>> should have been set from the beginning, and honestly, it would have >>> made LLVM's code horrendous to work with. >>> >> >> An option would be to have a C backend again, and then cross-compile the >> toolchain for the new target, but compile it into C, which then can be >> recompiled into binaries on the target platform. >> >> I actually bootstrapped an SML compiler for FreeBSD/ppc this way a while >> back. A part of the compiler was written in SML and there was an option to >> compile SML to C (that was actually one of the ways to generate final code: >> the C output would then be passed to a system C compiler). I think the SML >> compiler was mlton, but I'm not 100% certain. >> > > There are lots of languages that use C as a kind of virtual assembly > language as a back end. Usually, little more than K&R is needed. Very often > replacing some ancient custom code generator with C to feed to a modern gcc > or clang will improve performance considerably. Not to mention being far > more portable. > > What was the difficulty with the C back end previously in LLVM? > > > _______________________________________________ > 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/20161020/67f43128/attachment.html>