<div dir="ltr"><div>after adding -v</div><a href="https://hastebin.com/epijunegix.coffeescript">https://hastebin.com/epijunegix.coffeescript</a><div><br></div><div>with sparc-unknown-elf</div><div><a href="https://hastebin.com/ijohidofus.coffeescript">https://hastebin.com/ijohidofus.coffeescript</a></div><div><br></div><div>(target getting an extra unknown for some reason)</div><div><br></div><div><div>riscv64-unknown-elf</div><div><a href="https://hastebin.com/jirusidoti.sql">https://hastebin.com/jirusidoti.sql</a><br></div><div> different error: unknown register name (maybe because erc32 bsp with riscv) </div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 30, 2020 at 8:08 PM Hesham Almatary <<a href="mailto:heshamelmatary@gmail.com">heshamelmatary@gmail.com</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"><div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 30 Apr 2020 at 15:21, suyash singh <<a href="mailto:suyashsingh234@gmail.com" target="_blank">suyashsingh234@gmail.com</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"><div dir="ltr">I think it doesn't support sparc backend although it does not give unknown target error.<div><br></div><div>I compiled this c program with</div><div><span style="color:rgb(0,0,0);font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",Courier,monospace;font-size:12px">export PATH=$HOME/quick-start/rtems/5/bin:"$PATH"</span></div><div> clang -target sparc-unknown-rtems5 test1.c<br></div><div></div></div></blockquote><div dir="auto">Can you add -v to that command and post the output? Also try with sparc-unknown-elf. Last thing to try is to do the same for riscv64-unknown-elf </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div><u>test1.c</u></div><div>int main(int argc, char **argv) {<br> int k = 0x7fffffff;<br> k += argc;<br> return 0;<br>}<br></div><div><br></div><div>same error</div><div>/usr/bin/as: unrecognized option '-Av8'<br>clang-11: error: assembler command failed with exit code 1<br></div><div><br></div><div>If i write</div><div>clang -target hello test1.c<br></div><div>error: unknown target triple 'hello', please use -triple or -arch<br></div><div><br></div><div>So I guess it is detecting sparc but not working with it</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 30, 2020 at 7:07 PM Hesham Almatary <<a href="mailto:heshamelmatary@gmail.com" target="_blank">heshamelmatary@gmail.com</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"><div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 30 Apr 2020 at 14:18, suyash singh <<a href="mailto:suyashsingh234@gmail.com" target="_blank">suyashsingh234@gmail.com</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"><div dir="ltr"><div><br></div><div>I am using ubuntu 18.04 terminal<br></div><div><br></div>Here's the python script I wrote to find all include files and run clang -fsanitize<div><br></div><div># run with python3 in terminal<br><br>import subprocess<br>import os<br><br>relativedir="../bsps/sparc/erc32/btimer"<br>directory=os.path.join(os.getcwd(),"../")<br>file="btimer.c"<br>root_dir="ubsan"<br><br>arr=['clang','-target','sparc','-</div></div></blockquote><div dir="auto">target needs to be sparc-unknown-rtems5 to pick up the correct tools. Does your clang support sparc backend? Can you try to compile and link some simple C program with it?</div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>fsanitize=undefined',"-I../../../../../../rtems/5/sparc-rtems5/erc32/lib/include","-I../../../../../../rtems/5/sparc-rtems5/include/"]<br><br>for path, subdirs, files in os.walk(directory):<br> for subdir in subdirs:<br> if(subdir=="include"):<br> includepath=os.path.join(path,subdir)<br> idx=includepath.find("..")<br> arr.append("-I../../../../"+includepath[idx+3:])<br>arr.append(file)<br>subprocess.run(arr,cwd=relativedir, stdout=subprocess.PIPE)<br>#result=subprocess.run(['./a.out'],cwd=relativedir, stdout=subprocess.PIPE)<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 30, 2020 at 6:44 PM Hesham Almatary <<a href="mailto:heshamelmatary@gmail.com" target="_blank">heshamelmatary@gmail.com</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"><div><br></div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 30 Apr 2020 at 13:51, Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank">joel@rtems.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"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 30, 2020 at 7:34 AM suyash singh <<a href="mailto:suyashsingh234@gmail.com" target="_blank">suyashsingh234@gmail.com</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"><div dir="ltr">Hello, <div>I was running clang UBSan on</div><div>bsps/sparc/erc32/btimer/btimer.c<br></div><div><br></div><div>and got error</div><div><br></div><div>/usr/bin/as: unrecognized option '-Av8'<br>clang-11: error: assembler command failed with exit code 1<br></div><div><br></div><div>I am not sure but is it because clang is using wrong assembler? </div></div></blockquote><div><br></div><div>I haven't seen anyone run into this in a long time. :)</div><div><br></div><div>In this case, it is likely one of two things:</div><div><br></div><div>+ Look at your $PATH. Make sure the RTEMS tools are first.</div><div><br></div><div>+ But in your case, I expect that it is because the clang didn't<br></div><div>know (somehow) to put the target name in front of the as.</div><div>Did you invoke it for sparc-rtems5? If so, then there is a</div><div>path through clang where it isn't looking at the target name.</div><div></div></div></div></blockquote><div dir="auto">That’s likely to be the problem. I expect Suyash isn’t cross compiling with clang. </div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div><br></div><div>I also double checked the as manual to ensure -Av8 was in</div><div>fact a sparc option. </div></div></div><div dir="ltr"><div class="gmail_quote"><div><br></div><div>--joel</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div><br></div></div>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a></blockquote></div></div>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a></blockquote></div></div>-- <br><div dir="ltr">Hesham</div>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a></blockquote></div>
</blockquote></div></div>-- <br><div dir="ltr">Hesham</div>
</blockquote></div>
</blockquote></div></div>-- <br><div dir="ltr">Hesham</div>
</blockquote></div>