<html xmlns:v="urn:schemas-microsoft-com:vml" 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="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",serif;}
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.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        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",serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:56.7pt 42.5pt 56.7pt 85.05pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hi Hans,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">the bug we had was due to misconfiguration.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">The patch has been posted due to I think on most Linux installations, check for libc is actually always true.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">If we believe that iconv is present on libc, it would be good to check it explicitly.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Meanwhile, our issue can workarounded internally, so I'm ok with revert of this patch.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Thank you,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Serguei.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="RU" style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Eric Beckmann [mailto:ecbeckmann@google.com]
<br>
<b>Sent:</b> Tuesday, November 7, 2017 5:46 AM<br>
<b>To:</b> Hans Wennborg <hans@chromium.org><br>
<b>Cc:</b> Serguei Katkov <serguei.katkov@azul.com>; llvm-commits <llvm-commits@lists.llvm.org>; Peter Collingbourne <pcc@google.com><br>
<b>Subject:</b> Re: [llvm] r316064 - Fix the incorrect detection of ICONV_LIBRARY_PATH<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">The reason this was added in the first place was that certain builds (android?  I think) would break when libxml was present but iconv was not.  Libxml2 uses iconv for some internationalization encoding it does (<a href="http://xmlsoft.org/encoding.html" target="_blank">http://xmlsoft.org/encoding.html</a>). 
 Even though libxml2 was found on these builds, a compile time error which went something like “fatal error: iconv.h: No such file or directory" would be thrown.  This is perhaps a bug with libxml2 in that it assumes iconv is present in all situations.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I'm not sure why the check was made specific to Linux, perhaps check with Nico, this was done in r315873.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Sorry this was a while ago and this is most of the info I can give.<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Mon, Nov 6, 2017 at 2:18 PM, Hans Wennborg <<a href="mailto:hans@chromium.org" target="_blank">hans@chromium.org</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">I've reverted this in r317517 as it (silently) broke our builds, i.e.<br>
it was no longer setting LLVM_LIBXML2_ENABLED.<br>
<br>
Questions inline.<br>
<br>
On Tue, Oct 17, 2017 at 11:26 PM, Serguei Katkov via llvm-commits<br>
<<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
> Author: skatkov<br>
> Date: Tue Oct 17 23:26:39 2017<br>
> New Revision: 316064<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=316064&view=rev" target="_blank">
http://llvm.org/viewvc/llvm-project?rev=316064&view=rev</a><br>
> Log:<br>
> Fix the incorrect detection of ICONV_LIBRARY_PATH<br>
><br>
> This is introduced in rL308711.<br>
> Check for c library is incorrect here just because libc will be found always<br>
> and it does not mean that iconv is presented.<br>
><br>
> Thank to Andrew Krasny for narrowing down the root cause.<br>
<br>
What this was the root cause of? I couldn't find any bug, and no<br>
discussion on the code review or mailing list.<br>
<br>
> Reviewers: ecbeckmann<br>
> Reviewed By: ecbeckmann<br>
> Subscribers: mgorny, llvm-commits<br>
> Differential Revision: <a href="https://reviews.llvm.org/D38875" target="_blank">
https://reviews.llvm.org/D38875</a><br>
><br>
> Modified:<br>
>     llvm/trunk/cmake/config-ix.cmake<br>
><br>
> Modified: llvm/trunk/cmake/config-ix.cmake<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/config-ix.cmake?rev=316064&r1=316063&r2=316064&view=diff" target="_blank">
http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/config-ix.cmake?rev=316064&r1=316063&r2=316064&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/cmake/config-ix.cmake (original)<br>
> +++ llvm/trunk/cmake/config-ix.cmake Tue Oct 17 23:26:39 2017<br>
> @@ -157,7 +157,7 @@ if( NOT PURE_WINDOWS AND NOT LLVM_USE_SA<br>
>      set(HAVE_TERMINFO 0)<br>
>    endif()<br>
><br>
> -  find_library(ICONV_LIBRARY_PATH NAMES iconv libiconv libiconv-2 c)<br>
> +  find_library(ICONV_LIBRARY_PATH NAMES iconv libiconv libiconv-2)<br>
<br>
On Linux, I believe libc usually provides iconv() which is why the<br>
check was written that way.<br>
<br>
>    set(LLVM_LIBXML2_ENABLED 0)<br>
>    set(LIBXML2_FOUND 0)<br>
>    if((LLVM_ENABLE_LIBXML2) AND ((CMAKE_SYSTEM_NAME MATCHES "Linux") AND (ICONV_LIBRARY_PATH) OR APPLE))<br>
<br>
But this raises lots of questions.<br>
<br>
Why do we need to check for iconv here? Isn't it enough that we find<br>
libxml2; i.e., if we find it, can't we assume that it's usable?<br>
<br>
And why is the iconv() check specific to Linux? Is it not needed on<br>
Mac, and what if the user is on FreeBSD or something else -- no<br>
libxml2 for them?<br>
<br>
Does anyone know what's going on here?<br>
<br>
Thanks,<br>
Hans<o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>