[PATCH] [libc++] Add support for cross compiling libc++.

Dan Albert danalbert at google.com
Wed Jan 14 18:20:37 PST 2015


REPOSITORY
  rL LLVM

================
Comment at: CMakeLists.txt:85
@@ +84,3 @@
+#===============================================================================
+if (LIBCXX_CROSSCOMPILING)
+  option(LIBCXX_SYSROOT "Sysroot for cross compiling.")
----------------
We can't use `CMAKE_CROSSCOMPILING` for this because AFAICT cmake (prior to 3.x) will only set that if you are compiling to a different system (i.e. Linux to Windows), but not to a different architecture. Since the variable can't be overridden, we just introduce our own.

libc++abi will need a similar one, so perhaps it should just be `LLVM_CROSSCOMPILING`? Do we already have such a thing? I need to take another look through how LLVM handles this.

Another option would just be removing it entirely. I suppose setting a sysroot/toolchain is probably helpful for non-cross compiles as well, and the only other thing this guards is the passing of `LIBCXX_TARGET_TRIPLE` to `lit.site.cfg` and its subsequent use in `lit.cfg`.

http://reviews.llvm.org/D6990

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list