<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">suyashsingh234@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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:0 0 0 .8ex;border-left:1px #ccc solid;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" class="gmail_signature" data-smartmail="gmail_signature">Hesham</div>