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

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Mon Jan 9 14:23:16 PST 2012


On 09/01/12 04:00 PM, Sebastian Pop wrote:
> 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"
>     }
> ]

Looks like a good place to start. What is your transition plan, add a
--target-config option and if the option is not used fallback to the
current implementation?

I noticed uses of llvm:err() in the patch. I assume those are just for
debugging while the patch is being developed, right?

> In a second step, I would like to add the full explicit path to the
> assembler, to the linker, the -L paths, and the -I paths.

cool.

> I would like the default config file to be created by the configure scripts,
> and all the logic that is currently executed at each clang compilation
> to be moved to configure time.

I would suggest moving the current logic to a helper tool
(clang-gen-config?). That way the same clang binary can be installed in
two different linux systems and the uses just has to create a config
file at install time.

> One other point to be discussed is the place where to install these
> target config files: in the current patch I am looking in targets, a subdir
> of the install dir.  Is there a better place to put these config files?
> 
> Thanks,
> Sebastian
> --
> Qualcomm Innovation Center, Inc is a member of Code Aurora Forum
> 
> 


Thanks,
Rafael



More information about the cfe-dev mailing list