[PATCH] D41660: [cmake] Add new linux toolchain file

Don Hinton via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 2 02:35:56 PST 2018

hintonda added a comment.

In https://reviews.llvm.org/D41660#965656, @smeenai wrote:

> Why is this a cache file rather than a toolchain file (but passing itself as a toolchain file to CMake under some circumstances?) Aren't toolchain files traditionally used for cross-compilation?

Thanks for taking a look.

Yes, this is for cross-compiling clang+llvm for Linux on Darwin -- and possibly Windows to Linux, but that hasn't been tested -- or Linux to Linux if you have completely different system files.  It enforces using --sysroot to find the targets headers and libraries.

Cache files are preferred since they are only loaded once, but toolchain files are more flexible -- particularly when setting -target and --sysroot.  Users shouldn't care if the cache file reloads itself as a toolchain file, and keeping everything is one file makes it easier to understand.  This version doesn't include arch-specific builtins and runtimes, but that could easily be added.

Also, I'm happy to rename it if that would help.

  rC Clang


More information about the cfe-commits mailing list