Ran clang

Joel Sherrill joel at rtems.org
Fri Mar 27 16:06:43 UTC 2020


On Fri, Mar 27, 2020 at 10:39 AM Gedare Bloom <gedare at rtems.org> wrote:

> This appears to be a pretty standard llvm/clang build for a host system.
>
> There are two parts to consider:
> * Using the host tools over RTEMS
> * Using cross-compiler tools over RTEMS
>
> For analyzer I don't think the cross-target is a problem but I'm not
> really sure. That should be understood before pushing further. My
> understanding though is that most of the analyzers run on the LLVM IR, so
> the backend is irrelevant.
>

I think the RISC-V and SPARC  have BSPs that can be built with clang.
clang/llvm has a package in the RSB. I would recommend building llvm using
the RSB and then building the supported BSPs.

That is a more solid base to use for analysis. Building RTEMS with the
native compiler is hopeless (tilting at windmills).

Also gcc 10 has improved analysis (
https://developers.redhat.com/blog/2020/03/26/static-analysis-in-gcc-10/).
I would like to see support for using either for static analysis.

Supporting >1 open source/free tool for static analysis before fixing
anything is important (to me). This is already built by the rtems6 RSB
toolchain. When that builds anyway -- it tracks the tools head. :)

Your project should include any additions to the RSB (if needed) and
documenting use of the analyzers. If there is a technique to annotate
source to avoid false positives or deliberate violations, your project
should document that also


> Gedare
>
> On Fri, Mar 27, 2020 at 12:16 AM suyash singh <suyashsingh234 at gmail.com>
> wrote:
>
>> I have run clang. I faced multiple issues on the way due to incomplete
>> documentation for clang and llvm. So I wrote all the steps to build them
>> here
>>
>> https://github.com/suyashsingh234/rtems-notes/blob/master/README.md
>>
>> [image: image.png]
>> [image: image.png]
>>
>> Next I will run scan-build and scan-view on a test file.
>>
>>
>> https://docs.google.com/document/d/1OerM8Iix7PbDUCyb_J_KEzcMgLbvdqxd4FnK_BqI7XI/edit
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200327/75f61e51/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 200906 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200327/75f61e51/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 94923 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200327/75f61e51/attachment-0003.png>


More information about the devel mailing list