<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta content="text/html; charset=utf-8">
</head>
<body>
<div>I tested on OS X 10.11 and Ubuntu 16.04.<br>
<br>
<div class="acompli_signature">Get <a href="https://aka.ms/o0ukef">Outlook for iOS</a></div>
<br>
</div>
<br>
<br>
<br>
<div class="gmail_quote">On Mon, Aug 22, 2016 at 8:37 PM -0700, "Eric Fiselier" <span dir="ltr">
<<a href="mailto:eric@efcs.ca" target="_blank">eric@efcs.ca</a>></span> wrote:<br>
<br>
</div>
<div>
<p dir="ltr">What platforms was this tested on?</p>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Aug 22, 2016 9:20 PM, "Shoaib Meenai" <<a href="mailto:smeenai@fb.com">smeenai@fb.com</a>> wrote:<br type="attribution">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex; border-left:1px #ccc solid; padding-left:1ex">
smeenai created this revision.<br>
smeenai added reviewers: beanz, compnerd, EricWF, mclow.lists, rsmith.<br>
smeenai added a subscriber: cfe-commits.<br>
<br>
We're compiling libc++ with -nodefaultlibs, so we should also pass this<br>
option during the configuration checks to ensure those checks are<br>
consistent with the actual build.<br>
<br>
The primary motivation here is to ease cross-compilation against a<br>
non-standard set of C++ libraries. Previously, the configuration checks<br>
would attempt to link against the standard C++ libraries, which would<br>
cause link failures when cross-compiling, even though the actual library<br>
link would go through correctly (because of the use of -nodefaultlibs<br>
and explicitly specifying any needed libraries). This is more correct<br>
even ignoring the motivation, however.<br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__reviews.llvm.org_D23791&d=DQMFaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=canNAfshUtSeM58gyOrRQoF0tgW8MEhlz2mHMbuyEQE&s=B2hLMlMDoMII263TrdLusbDuiFYnpqFYCsrXl4E9K1I&e=" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D23791</a><br>
<br>
Files:<br>
  cmake/config-ix.cmake<br>
<br>
Index: cmake/config-ix.cmake<br>
==============================<wbr>==============================<wbr>=======<br>
--- cmake/config-ix.cmake<br>
+++ cmake/config-ix.cmake<br>
@@ -1,5 +1,26 @@<br>
 include(CheckLibraryExists)<br>
 include(CheckCXXCompilerFlag)<br>
+<br>
+check_library_exists(c fopen "" LIBCXX_HAS_C_LIB)<br>
+check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)<br>
+<br>
+# libc++ is built with -nodefaultlibs, so we want all our checks to also<br>
+# use this option, otherwise we may end up with an inconsistency between<br>
+# the flags we think we require during configuration (if the checks are<br>
+# performed without -nodefaultlibs) and the flags that are actually<br>
+# required during compilation (which has the -nodefaultlibs). libc is<br>
+# required for the link to go through.<br>
+check_cxx_compiler_flag(-<wbr>nodefaultlibs LIBCXX_SUPPORTS_NODEFAULTLIBS_<wbr>FLAG)<br>
+if (LIBCXX_SUPPORTS_<wbr>NODEFAULTLIBS_FLAG)<br>
+  list(APPEND CMAKE_REQUIRED_LIBRARIES -nodefaultlibs)<br>
+  if (LIBCXX_HAS_C_LIB)<br>
+    list(APPEND CMAKE_REQUIRED_LIBRARIES c)<br>
+  endif ()<br>
+  if (LIBCXX_HAS_GCC_S_LIB)<br>
+    list(APPEND CMAKE_REQUIRED_LIBRARIES gcc_s)<br>
+  endif ()<br>
+endif ()<br>
+<br>
 include(CheckLibcxxAtomic)<br>
<br>
 # Check compiler flags<br>
@@ -14,7 +35,5 @@<br>
<br>
 # Check libraries<br>
 check_library_exists(pthread pthread_create "" LIBCXX_HAS_PTHREAD_LIB)<br>
-check_library_exists(c fopen "" LIBCXX_HAS_C_LIB)<br>
 check_library_exists(m ccos "" LIBCXX_HAS_M_LIB)<br>
 check_library_exists(rt clock_gettime "" LIBCXX_HAS_RT_LIB)<br>
-check_library_exists(gcc_s __gcc_personality_v0 "" LIBCXX_HAS_GCC_S_LIB)<br>
<br>
<br>
</blockquote>
</div>
</div>
</div>
</body>
</html>