<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:Courier;
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Menlo;
panose-1:2 11 6 9 3 8 4 2 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0in;
font-size:12.0pt;
font-family:Menlo;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:Menlo;}
.MsoChpDefault
{mso-style-type:export-only;
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=MsoPlainText>On 7/17/21, 09:11, "Raul Tambre" <raul@tambre.ee> wrote:<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>> How does the build end up with two commands symlinking to the same location?<o:p></o:p></p><p class=MsoPlainText>> Different targets through `LLVM_RUNTIME_TARGETS` should end up with separate <o:p></o:p></p><p class=MsoPlainText>> build directories. arm64 and arm64e are different targets, right?<o:p></o:p></p><p class=MsoPlainText>><o:p> </o:p></p><p class=MsoPlainText>> Creating the symlinks during CMake configuration should be possible as an <o:p></o:p></p><p class=MsoPlainText>> alternative.<o:p></o:p></p><p class=MsoPlainText><span style='color:black'><o:p> </o:p></span></p><p class=MsoPlainText><span style='color:black'>Ken researched this problem, discovered its cause and suggested a workaround:<o:p></o:p></span></p><p class=MsoPlainText><span style='color:black'><o:p> </o:p></span></p><p class=MsoPlainText style='margin-left:.5in'><span style='color:black'>It appears that when running a </span><span style='font-family:Courier;color:black'>custom_command</span><span style='color:black'>, </span><span style='font-family:Courier;color:black'>cmake</span><span style='color:black'> does not use dependency tracking and collisions can happen.<o:p></o:p></span></p><p class=MsoPlainText style='margin-left:.5in'><span style='color:black'><o:p> </o:p></span></p><p class=MsoPlainText style='margin-left:.5in'><span style='color:black'>"Do not list the output in more than one independent target that may build in parallel or the two instances of the rule may conflict (instead use the </span><span style='font-family:Courier;color:black'>add_custom_target()</span><span style='color:black'> command to drive the command and make the other targets depend on that one)."<o:p></o:p></span></p><p class=MsoPlainText style='margin-left:.5in'><span style='color:black'><o:p> </o:p></span></p><p class=MsoPlainText style='margin-left:.5in'><span style='font-family:"Cambria Math",serif;color:black'></span><span style='color:black'><a href="https://cmake.org/cmake/help/v3.19/command/add_custom_command.html">https://cmake.org/cmake/help/v3.19/command/add_custom_command.html</a> <o:p></o:p></span></p><p class=MsoPlainText style='margin-left:.5in'><span style='color:black'><o:p> </o:p></span></p><p class=MsoPlainText style='margin-left:.5in'><span style='color:black'>The workaround is to </span><span style='font-family:Courier;color:black'>add_custom_target</span><span style='color:black'> a dependency on the output of the custom command.<o:p></o:p></span></p><p class=MsoPlainText style='margin-left:.5in'><span style='color:black'><o:p> </o:p></span></p><p class=MsoPlainText style='margin-left:.5in'><span style='font-family:"Cambria Math",serif;color:black'></span><span style='color:black'><a href="https://gist.github.com/socantre/7ee63133a0a3a08f3990">https://gist.github.com/socantre/7ee63133a0a3a08f3990</a> <o:p></o:p></span></p><p class=MsoPlainText><span style='color:black'><o:p> </o:p></span></p><p class=MsoPlainText><span style='color:black'>It would be great if LLVM maintainers incorporated this workaround, or, at the very least, gave it a try.<o:p></o:p></span></p></div></body></html>