[llvm-dev] unable to compile llvm with gcc 4.7.4

Bruce Hoult via llvm-dev llvm-dev at lists.llvm.org
Wed Oct 19 07:43:09 PDT 2016


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>


More information about the llvm-dev mailing list