<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="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;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:12.0pt;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt"><a href="https://reviews.llvm.org/D96404">https://reviews.llvm.org/D96404</a> landed recently to default Android targets to using compiler-rt instead of libgcc. Amusingly enough, it broke our builds of compiler-rt
 for Android in the runtimes build setup. What’s happening is that the configuration for the builtins for Android tests for all supported architectures [1], using check_symbol_exists to check for the architecture’s preprocessor macro [2]. check_symbol_exists
 tries to link a test executable, which fails because my just-built compiler doesn’t have compiler-rt yet (since it’s trying to build compiler-rt). Consequently, the builtins don’t think that any architectures are supported, and just don’t build anything as
 a result.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Other places in the builtins’ CMake logic use custom functions like try_compile_only to only test compilation and not linking, to avoid issues like this. My understanding is that the builtins will never be
 built as shared libraries. The build already instructs its custom test macros to always only check compilation [3]; now that we’re on a newer CMake version, would it be appropriate to always set CMAKE_TRY_COMPILE_TARGET_TYPE to STATIC_LIBRARY for the builtins
 as well, so that all CMake checks build static libraries (which has the same effect of only testing compilation and not linking)? We could also probably clean up a lot of the custom logic for only checking compilation afterwards.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">[1] <a href="https://github.com/llvm/llvm-project/blob/c7712087cbb505d324e1149fa224f607c91a8c6a/compiler-rt/cmake/base-config-ix.cmake#L164-L167">
https://github.com/llvm/llvm-project/blob/c7712087cbb505d324e1149fa224f607c91a8c6a/compiler-rt/cmake/base-config-ix.cmake#L164-L167</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">[2] <a href="https://github.com/llvm/llvm-project/blob/c7712087cbb505d324e1149fa224f607c91a8c6a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake#L155-L170">
https://github.com/llvm/llvm-project/blob/c7712087cbb505d324e1149fa224f607c91a8c6a/compiler-rt/cmake/Modules/CompilerRTUtils.cmake#L155-L170</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">[3] <a href="https://github.com/llvm/llvm-project/blob/c7712087cbb505d324e1149fa224f607c91a8c6a/compiler-rt/cmake/builtin-config-ix.cmake#L4-L5">
https://github.com/llvm/llvm-project/blob/c7712087cbb505d324e1149fa224f607c91a8c6a/compiler-rt/cmake/builtin-config-ix.cmake#L4-L5</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
</div>
</body>
</html>