<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Calibri;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body bgcolor="white" lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">I just tested on Ubuntu 14.04 as well. The configuration goes through correctly. There are 30 unexpected failures both with and without the patch when I run check-libcxx.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri">Are there any other platforms in particular which I should be testing on?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Calibri"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-family:Calibri;color:black">From: </span>
</b><span style="font-family:Calibri;color:black">cfe-commits <cfe-commits-bounces@lists.llvm.org> on behalf of Shoaib Meenai via cfe-commits <cfe-commits@lists.llvm.org><br>
<b>Reply-To: </b>Shoaib Meenai <smeenai@fb.com><br>
<b>Date: </b>Tuesday, August 23, 2016 at 10:18 AM<br>
<b>To: </b>"reviews+d23791+public+1be7b6c753063b3c@reviews.llvm.org" <reviews+d23791+public+1be7b6c753063b3c@reviews.llvm.org>, Eric Fiselier <eric@efcs.ca><br>
<b>Cc: </b>"mclow.lists@gmail.com" <mclow.lists@gmail.com>, Richard Smith <richard@metafoo.co.uk>, "cfe-commits@lists.llvm.org" <cfe-commits@lists.llvm.org><br>
<b>Subject: </b>Re: [PATCH] D23791: [libc++] Perform configuration checks with -nodefaultlibs<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">I tested on OS X 10.11 and Ubuntu 16.04.<o:p></o:p></p>
<div>
<p class="MsoNormal">Get <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__aka.ms_o0ukef&d=DQMFAg&c=5VD0RTtNlTh3ycd41b3MUw&r=o3kDXzdBUE3ljQXKeTWOMw&m=l7bou7qSkm2CYotaUVRllyhV5IFtNt_Fs0WNzO_lJ3w&s=FaEEFpWn73yOistHV_tTWJzVlr5r2Q-WkUv7FrV6CDA&e=">
Outlook for iOS</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
<br>
<o:p></o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">On Mon, Aug 22, 2016 at 8:37 PM -0700, "Eric Fiselier" <<a href="mailto:eric@efcs.ca" target="_blank">eric@efcs.ca</a>> wrote:<o:p></o:p></p>
</div>
<div>
<p>What platforms was this tested on?<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Aug 22, 2016 9:20 PM, "Shoaib Meenai" <<a href="mailto:smeenai@fb.com">smeenai@fb.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal" style="margin-bottom:12.0pt">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=" target="_blank">https://reviews.llvm.org/D23791</a><br>
<br>
Files:<br>
  cmake/config-ix.cmake<br>
<br>
Index: cmake/config-ix.cmake<br>
===================================================================<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(-nodefaultlibs LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)<br>
+if (LIBCXX_SUPPORTS_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>
<o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>