<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=us-ascii">
<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;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.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><!--[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="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am porting FreeRTOS application from gcc toolchain to clang.<o:p></o:p></p>
<p class="MsoNormal">I get the files compiled, but the linker gives below error.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">Building target: r5_app.elf</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">Invoking: ARM R5 clang linker</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:black">clang -v -Wl,-T -Wl,./src/lscript.ld -mcpu=cortex-r5 -mfpu=vfpv3-d16 --target=arm-none-eabi -L../R5_FreeRTOS_clang/psu_cortexr5/lib -L./lib -o
"r5_app.elf" ./obj/echo.o ./obj/iic_phyreset.o ./obj/main.o -lfreertos -llwip4 -lmetal -lopenamp -lxil -lc -lm -lgcc -lgcov</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:#780000">clang version 8.0.0.1 (ssh://diabuild@stash.wrs.com:7999/llvm/clang.git 0a578b9ee67aa40c1e710f3ac9b5a740e2ef1bcd) (llvm/llvm.git 520c9a00874f1ffaf61274c3b7e86dd68697b9ec)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:#780000">Target: arm-none-unknown-eabi</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:#780000">Thread model: posix</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:#780000">InstalledDir: C:\WindRiver_SR0620\compilers\llvm-8.0.0.1\WIN64\bin</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:#780000">"C:\\WindRiver_SR0620\\compilers\\llvm-8.0.0.1\\WIN64\\bin\\ld.lld" -T ./src/lscript.ld ./obj/echo.o ./obj/iic_phyreset.o ./obj/main.o -lfreertos
-llwip4 -lmetal -lopenamp -lxil -lc -lm -lgcc -lgcov -Bstatic "-LC:\\WindRiver_SR0620\\compilers\\llvm-8.0.0.1\\WIN64\\lib\\clang\\8.0.0.1\\lib\\baremetal" -L../R5_FreeRTOS_clang/psu_cortexr5/lib -L./lib -lc -lm -lclang_rt.builtins-arm.a -o r5_app.elf</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:#780000">ld.lld: error: unable to find library -lclang_rt.builtins-arm.a</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:#780000">clang: error: ld.lld command failed with exit code 1 (use -v to see invocation)</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:#C80000">make: *** [r5_app.elf] Error 1</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:Consolas;color:#C80000">Makefile:86: recipe for target 'r5_app.elf' failed</span><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-size:10.0pt;font-family:Consolas;color:#C80000">Build Failed with JOBS=8 in Project 'R5_App_clang' (Process Exit Value was 2): 2020-01-31 17:31:53 (Elapsed Time: 00:08)</span></b><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-size:10.0pt;font-family:Consolas;color:#C80000">If this doesn't look like an obvious error, consider re-building with parallel builds turned OFF in the build console.</span></b><span style="font-size:10.0pt;font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I request you please help me to fix this error.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you,<o:p></o:p></p>
<p class="MsoNormal">Srinivasa.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>