Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Real-Time Software Components (RTSC) » RTSC XDC Module around SPLINT(Create a RTSC XDC module wrapper around SPLINT)
RTSC XDC Module around SPLINT [message #710167] Thu, 04 August 2011 19:17 Go to next message
Matt Clarkson is currently offline Matt Clarkson
Messages: 9
Registered: August 2011
Junior Member
Hello,

We use RTSC and XDC to build our C code for various platforms.

I would like to use SPLINT to do static analysis on the code.

It would be good if I could write a XDC module around the SPLINT executable so that it can be consumed and easily used by other people.

Does anyone have information on how I could do this? Do I need to inherit ITarget? Is that the correct way to go?

Thanks,

Matt
Re: RTSC XDC Module around SPLINT [message #710972 is a reply to message #710167] Fri, 05 August 2011 16:28 Go to previous messageGo to next message
Dave Russo is currently offline Dave Russo
Messages: 172
Registered: July 2009
Senior Member
You can use ITargetFilter's to integrate tools like splint. We've done
this for Coverity integration, for example. See
http://rtsc.eclipse.org/cdoc-tip/index.html#xdc/bld/ITargetFilter.html.

I'll try to get this up on the svn site as an example.

On 8/4/2011 12:17 PM, mattyclarkson wrote:
> Hello,
>
> We use RTSC and XDC to build our C code for various platforms.
>
> I would like to use SPLINT to do static analysis on the code.
>
> It would be good if I could write a XDC module around the SPLINT
> executable so that it can be consumed and easily used by other people.
>
> Does anyone have information on how I could do this? Do I need to
> inherit ITarget? Is that the correct way to go?
>
> Thanks,
>
> Matt
Re: RTSC XDC Module around SPLINT [message #711061 is a reply to message #710972] Fri, 05 August 2011 18:36 Go to previous messageGo to next message
Matt Clarkson is currently offline Matt Clarkson
Messages: 9
Registered: August 2011
Junior Member
Cool, thanks.

I'm just looking over the documentation for IFilter now.

Are there any guidelines on namespace conventions for the splint xdc module?

packages/tools/splint?

Matt

Also how do I work with the XDC SVN?

[Updated on: Fri, 05 August 2011 20:05]

Report message to a moderator

Re: RTSC XDC Module around SPLINT [message #714040 is a reply to message #711061] Tue, 09 August 2011 16:39 Go to previous messageGo to next message
Matt Clarkson is currently offline Matt Clarkson
Messages: 9
Registered: August 2011
Junior Member
Dave,

I checked out the xdccore from http:/ /dev.eclipse.org/svnroot/technology/org.eclipse.rtsc/xdc/xdccore/trunk

However, the readme seems alien saying to SH-MAKE .all-files. I do not understand what SH-MAKE is and I do not have a .all-files hidden file.

Could you point me to the SVN address that you would commit the coverity ITargetFilter package to?

I don't quite understand the XDCcore/XDCtools seperation.

Thanks,

Matt
Re: RTSC XDC Module around SPLINT [message #714069 is a reply to message #714040] Tue, 09 August 2011 18:17 Go to previous messageGo to next message
Matt Clarkson is currently offline Matt Clarkson
Messages: 9
Registered: August 2011
Junior Member
Also I wouldn't mind writing a XDC module for doxygen as we use that too.
Re: RTSC XDC Module around SPLINT [message #725802 is a reply to message #714040] Thu, 15 September 2011 20:01 Go to previous messageGo to next message
Sasha Slijepcevic is currently offline Sasha Slijepcevic
Messages: 89
Registered: July 2009
Member
Matt,
you don't really need to check out all of the XDC core code to add your modules. You can just install XDCtools, and you can develop your code in a separate repository. Then, just attach your code here so we can review it. I am sure there are some other formal steps for contribution to the RTSC project, and Dave Russo would know more about it. But, without being a committer for the RTSC project, you can't add code directly to SVN.

XDC core packages are ones that you can't remove from XDCtools and still use it to build any executable.

The names for your packages could be xdc.tools.splint and xdc.tools.doxygen.
Re: RTSC XDC Module around SPLINT [message #725973 is a reply to message #725802] Fri, 16 September 2011 10:12 Go to previous messageGo to next message
Matt Clarkson is currently offline Matt Clarkson
Messages: 9
Registered: August 2011
Junior Member
Sasha,

Cool, I was planning to add it as an SVN patch.

I really need some guidance or an example of the ITargetFilter interface. could you point me in the right direction?

Thanks

Matt

[Updated on: Fri, 16 September 2011 10:13]

Report message to a moderator

Re: RTSC XDC Module around SPLINT [message #726603 is a reply to message #725973] Sun, 18 September 2011 23:36 Go to previous messageGo to next message
Dave Russo is currently offline Dave Russo
Messages: 172
Registered: July 2009
Senior Member
On 9/16/2011 3:12 AM, mattyclarkson wrote:

> I really need some guidance or an example of the ITargetFilter
> interface. could you point me in the right direction?
>

Sorry for the long delay in responding. I've created and attached a few
"simple" examples" that I hope will help.

The attached zip contains a package named basic.filter that contains
four examples of ITargetFilters. The two of interest for you are probably:
Echo - echos the parameters each filter method is called with
Time - adds timing output to each compile, link, and archive step

In addition to basic.filter the .zip contains a nested package, named
basic.filter.client, that illustrates how these filters are used when
building packages.

Hopefully the comments in the examples will be sufficient to get you
started. Feel free to ask questions (we'll try to be more responsive).
  • Attachment: examples.zip
    (Size: 13.59KB, Downloaded 177 times)
Re: RTSC XDC Module around SPLINT [message #727454 is a reply to message #726603] Wed, 21 September 2011 10:56 Go to previous messageGo to next message
Matt Clarkson is currently offline Matt Clarkson
Messages: 9
Registered: August 2011
Junior Member
Thanks for the responses guys. Currently crunching for SW release but will look at this soon!
Re: RTSC XDC Module around SPLINT [message #793614 is a reply to message #710167] Wed, 08 February 2012 10:52 Go to previous messageGo to next message
Matt Clarkson is currently offline Matt Clarkson
Messages: 9
Registered: August 2011
Junior Member
Hello, sorry it has been 6 months without any contact.

Hopefully, I'll be back on this soon.

We created a IFilter that changes the compilation flags depending on if the file extension is .cpp or .c.

This was because the ccOpts was -std=c99 and g++ doesn't like that!

I can add the filter as an attachment, to show what we did, if you're interested.

Do you think that it would be useful to make ITarget have separate options for different compilers.

Something like ccOpts and cppcOpts?

I will be in contact about the splint and doxygen modules.

I was thinking the would follow xdc.filters folder structure?
Re: RTSC XDC Module around SPLINT [message #794132 is a reply to message #793614] Wed, 08 February 2012 23:56 Go to previous messageGo to next message
Dave Russo is currently offline Dave Russo
Messages: 172
Registered: July 2009
Senior Member
On 2/8/2012 2:52 AM, Missing name Mising name wrote:
> Hello, sorry it has been 6 months without any contact.
>
> Hopefully, I'll be back on this soon.
>
> We created a IFilter that changes the compilation flags depending on if
> the file extension is .cpp or .c.
>
> This was because the ccOpts was -std=c99 and g++ doesn't like that!
>
> I can add the filter as an attachment, to show what we did, if you're
> interested.
>
> Do you think that it would be useful to make ITarget have separate
> options for different compilers.

So ... you have a package with a mix of C and C++ sources and you've
configured your target(s) to add -std=c99 (for the C code) but you can't
use this for C++ code (because g++ rightly complains), right?

>
> Something like ccOpts and cppcOpts?
>
This might be the best solution. The target certainly knows if the
source file is an asm, C, or C++ source file and it already has separate
asmOpts and ccOpts. So, it makes sense to add options specific to C++.

> I will be in contact about the splint and doxygen modules.
>
> I was thinking the would follow xdc.filters folder structure?

How about xdc.target.filters.[splint|doxygen]?
Re: RTSC XDC Module around SPLINT [message #799789 is a reply to message #794132] Thu, 16 February 2012 10:09 Go to previous messageGo to next message
Matt Clarkson is currently offline Matt Clarkson
Messages: 9
Registered: August 2011
Junior Member
That is correct, some of our modules have a mix of .c files and .cpp files and we get complaints because the two standards we need are different. -std=c99 for C and -std=c++03 (looking to move to *11 when support comes) and obviously if either compiler gets the other standard it throws it's toys out of the pram.

So we added a filter that checks the extension type and adds the correct flags on the fly. A bit hacky but the best we could do without modifying the XDC (which is nice that you have a filter plugin system!)

It would be great if ITarget2 (or ITarget) could be extended to include cppcOpts! I don't mind working that out and providing a patch?

Regarding the xdc.targets.filters namespacing, I'm fine with that.

Also as a note we found the Linux86 needed the following fix:

target.ccOpts.prefix += " -m32"; // Must build for 32 bit

If you use Linux86 on a 64bit Fedora install it builds 64bit stuff which won't link with the prebuilt libraries Sad
Re: RTSC XDC Module around SPLINT [message #802460 is a reply to message #799789] Mon, 20 February 2012 01:27 Go to previous messageGo to next message
Dave Russo is currently offline Dave Russo
Messages: 172
Registered: July 2009
Senior Member
On 2/16/2012 2:09 AM, Missing name Mising name wrote:
> That is correct, some of our modules have a mix of .c files and .cpp
> files and we get complaints because the two standards we need are
> different. -std=c99 for C and -std=c++03 (looking to move to *11 when
> support comes) and obviously if either compiler gets the other standard
> it throws it's toys out of the pram.
>
> So we added a filter that checks the extension type and adds the correct
> flags on the fly. A bit hacky but the best we could do without modifying
> the XDC (which is nice that you have a filter plugin system!)
>
> It would be great if ITarget2 (or ITarget) could be extended to include
> cppcOpts! I don't mind working that out and providing a patch?
If you can write up a bug for this, we can probably address this
quickly. We already have an ITarget3 in the works. Adding this to an
interface is trivial. The real work, and it's not much, is updating the
ITarget.xs files to respect this new configuration parameter.
>
> Regarding the xdc.targets.filters namespacing, I'm fine with that.
>
> Also as a note we found the Linux86 needed the following fix:
>
> target.ccOpts.prefix += " -m32"; // Must build for 32 bit
>
> If you use Linux86 on a 64bit Fedora install it builds 64bit stuff which
> won't link with the prebuilt libraries :(
Humm ... this means we need a separate targets for 32-bit Linux and
64-bit Linux. Code built with a configuration of a target should always
be linkable with code built with a different configuration of the same
target; it's roughly equivalent to an EABI.

Looks like we need a Linux64 target that builds for 64-bit archiectures
and we add -m32 to the Linux86 target's cc.opts (the required options
for all uses of this target).
Re: RTSC XDC Module around SPLINT [message #802552 is a reply to message #799789] Mon, 20 February 2012 05:00 Go to previous messageGo to next message
Dave Russo is currently offline Dave Russo
Messages: 172
Registered: July 2009
Senior Member
On 2/16/2012 2:09 AM, Missing name Mising name wrote:
> Also as a note we found the Linux86 needed the following fix:
>
> target.ccOpts.prefix += " -m32"; // Must build for 32 bit
>
> If you use Linux86 on a 64bit Fedora install it builds 64bit stuff which
> won't link with the prebuilt libraries :(
I should have also mentioned that a workaround, that does not require a
new target, s to simply rebuild the rts libraries using this option.
This is relatively easy to do and is documented here:
http://rtsc.eclipse.org/docs-tip/Working_with_xdc.runtime#Re-building_xdc.runtime_Support_Packages

The "right" solution is, however, to create a separate target so the
tools can support _both_ 32-bit and 64-bit machines. But, for now ...
Re: RTSC XDC Module around SPLINT [message #895966 is a reply to message #802460] Mon, 16 July 2012 16:39 Go to previous message
Matt Clarkson is currently offline Matt Clarkson
Messages: 9
Registered: August 2011
Junior Member
Sorry, for the long silence. I got moved onto another project - back now working with XDC and currently hitting the mixed C++ and C projects again.

The bug report is - create a hello world .cpp file.

Build it with XDC using copts.prefix = -std=c++11 (or 0x, 03, 98) and XDC will fail because it will invoke GCC with -std=c++11 but try to build it's own .c files with -std=c++11, which is obviously not allowed.

Sounds like ITarget3 is the correct solution. The C and C++ options need to be split up just like the C/C++ and ASM options are.

If I can be of any more assistance please ask!
Previous Topic:symbolic links to data not physically present during the release process are ignored in the released
Next Topic:console input during debugging
Goto Forum:
  


Current Time: Fri Sep 19 07:53:54 GMT 2014

Powered by FUDForum. Page generated in 0.02380 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software