[cfe-dev] First shot at Bug 4127 - The clang driver should support cross compilation

James Molloy James.Molloy at arm.com
Tue Jan 10 01:09:47 PST 2012


The idea of embedding a scripting language has been veto'd on multiple occasions because of

(a) the dependency on a scripting language / putting a scripting interpreter in the tree
(b) speed issues
(c) turing completeness makes it impossible to guarantee a decent speed of execution.

The problem has been discussed and a solution (JSON target database) is winging its way to the list shortly. It's just taken me a while to work out just how much of Tools.cpp and ToolChains.cpp I can rip out (5000 lines of "kinda-sorta-common-code"), when, and how to do it incrementally.



-----Original Message-----
From: Konstantin Tokarev [mailto:annulen at yandex.ru]
Sent: 10 January 2012 09:02
To: Sebastian Pop
Cc: cfe-dev at cs.uiuc.edu Developers; clang-commits at cs.uiuc.edu; James Molloy
Subject: Re: [cfe-dev] First shot at Bug 4127 - The clang driver should support cross compilation

10.01.2012, 01:00, "Sebastian Pop" <spop at codeaurora.org>:
> Hi,
> The attached patch uses the JSON parser to read the target
> from a config file.  I would like to get some opinions on this
> patch before we go further to fix
> http://llvm.org/bugs/show_bug.cgi?id=4127
> In a first implementation, I would like to have at least the following
> information registered in the config file:
> [
>     {
>         "target": "arm-none-linux-gnueabi",
>         "c-include-dirs": "/gcc/path:/libc/path",
>         "cxx-include-root": "/some/other/path"
>     }
> ]

I propose to embed Lua and use Lua table instead of JSON. Config could look like

toolchain {
    target = "arm-none-linux-gnueabi",
    c_include_dirs = { "/gcc/path", "/libc/path" },
    cxx_include_root = "/some/other/path",
    as = "/path/to/as",
    ld = "/path/to/ld"

toolchain {
-- next toolchain definition

It would also bring scripting capabilities.


-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.

More information about the cfe-dev mailing list