<div dir="ltr">Sorry about that, I forgot to test my change on macOS and I naively assumed that their libc provides the same symbol. I'll revert the change and see what other symbols would be appropriate.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 28, 2019 at 11:04 AM Hans Wennborg <<a href="mailto:hans@chromium.org">hans@chromium.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">We're seeing breakages of Chromium's compiler-rt build on Mac after<br>
this change: <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=925895" rel="noreferrer" target="_blank">https://bugs.chromium.org/p/chromium/issues/detail?id=925895</a><br>
<br>
I'm not entirely sure how your change would cause the error we're<br>
seeing, but it seems clear that COMPILER_RT_HAS_LIBC was getting set<br>
before, and is set no longer, and I'm guessing that wasn't<br>
intentional. Do you know what might be going on here? Maybe there's<br>
some other symbol that could be used and exists across both glibc and<br>
Mac's libc?<br>
<br>
On Sun, Jan 27, 2019 at 11:12 PM Petr Hosek via llvm-commits<br>
<<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
><br>
> Author: phosek<br>
> Date: Sun Jan 27 20:12:54 2019<br>
> New Revision: 352341<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=352341&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=352341&view=rev</a><br>
> Log:<br>
> [CMake] Use __libc_start_main rather than fopen when checking for C library<br>
><br>
> The check_library_exists CMake uses a custom symbol definition. This<br>
> is a problem when checking for C library symbols because Clang<br>
> recognizes many of them as builtins, and returns the<br>
> -Wbuiltin-requires-header (or -Wincompatible-library-redeclaration)<br>
> error. When building with -Werror which is the default, this causes<br>
> the check_library_exists check fail making the build think that C<br>
> library isn't available.<br>
><br>
> To avoid this issue, we should use a symbol that isn't recognized by<br>
> Clang and wouldn't cause the same issue. __libc_start_main seems like<br>
> reasonable choice that fits the bill.<br>
><br>
> Differential Revision: <a href="https://reviews.llvm.org/D57142" rel="noreferrer" target="_blank">https://reviews.llvm.org/D57142</a><br>
><br>
> Modified:<br>
>     compiler-rt/trunk/cmake/config-ix.cmake<br>
><br>
> Modified: compiler-rt/trunk/cmake/config-ix.cmake<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/config-ix.cmake?rev=352341&r1=352340&r2=352341&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/config-ix.cmake?rev=352341&r1=352340&r2=352341&view=diff</a><br>
> ==============================================================================<br>
> --- compiler-rt/trunk/cmake/config-ix.cmake (original)<br>
> +++ compiler-rt/trunk/cmake/config-ix.cmake Sun Jan 27 20:12:54 2019<br>
> @@ -12,7 +12,7 @@ function(check_linker_flag flag out_var)<br>
>    cmake_pop_check_state()<br>
>  endfunction()<br>
><br>
> -check_library_exists(c fopen "" COMPILER_RT_HAS_LIBC)<br>
> +check_library_exists(c __libc_start_main "" COMPILER_RT_HAS_LIBC)<br>
>  if (COMPILER_RT_USE_BUILTINS_LIBRARY)<br>
>    include(HandleCompilerRT)<br>
>    find_compiler_rt_library(builtins COMPILER_RT_BUILTINS_LIBRARY)<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>