This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Using compiler.opt flags

Other Parts Discussed in Thread: SYSBIOS

Hi,

Looking at configuro documentation (I am using xdctools_3_23_03_53), there is a note about compiler.opt

*********

outdir/compiler.opt

A file containing C compiler command-line flags. These flags must included on the compiler command line for any C source file that directly accesses the RTSC content. The flags define the header file include paths, and machine-mode compiler flags to ensure object code compatibility between all included content.

***********

My question is about which files need to use this. It says that all RTSC content should use this. Does this mean code which uses packages like xdc/runtime or sysbios should use these flags.

I have a few libraries in our system which use these packages. For example, I have a little profiling module which uses xdc/runtime/Timestamp. I am not using CCS to put together and build our projects. Just old fashioned editor and make is how the libraries are built. When these libraries are built, there is no config file and linker.cmd getting generated and things like that.

So, is it important that compiler.opt generated flags be included for building these libraries as well or if I include the correct packages, I should be good to go.

I am hoping that it is fine to just have manual definition of compile flags as long as I am pointing at the right packages. 

I do see compiler.opt generate things like

-Dxdc_target_types__="ti/targets/elf/std.h" -Dxdc_target_name__=C674 -Dxdc_cfg__header__=

I am not sure how or where these are used. Other than these, I see standard flags.

Cheers,

-raja.

  • Raja,
    if you are referencing RTSC modules in your sources, you need to include at least some options defined in compiler.opt. As soon as you start using RTSC content, you are using RTSC types listed here. The actual C standard types equivalent to RTSC types differ from target to target, so you have to use the options -Dxdc_target_types__ and -Dxdc_target_name__ to get the right C standard types. Also, these options include some predefined macros described on the previously linked Web page. Even though you probably don't use these macros, the header files you are including might be relying on them, so they have to  be defined.

    When building libraries, you don't need -Dxdc_cfg__header__ because that one declares extern symbols defined in a CFG script, and you don't use such scripts when building libraries.

    The standard flags have to match for obvious reason, and it seems that you already ensured that they match.

  • Thank you very much Sasha for the explanation.

    I also found this useful documentation http://rtsc.eclipse.org/docs-tip/Integrating_RTSC_Modules

    Cheers,

    -raja.