waf compiling environment

Chris Johns chrisj at rtems.org
Sat May 20 03:48:52 UTC 2017


On 20/5/17 12:52 pm, Pham, Phong wrote:
>  
> 
> Hi,
> 
>  
> 
> Another dumb question with regard to the build environment in
> rtems-libbsd.  Enclosed is the screenshot of compiling a given file. 
> The compiler options where highlighted can be edited in the
> libbsd_waf.py (even though it is an autogenerated file but I edited it
> anyway and it works).  What about the options before the highlighted
> text?  It seems like the options are taken from the <toolchain
> path>/lib/pkgconfig directory after BSP installation.  If I remove the
> file, waf complains.  (Looks good).  Now if I instead of removing the
> file, I remove all the content of the file (essentially have a file of 0
> bytes), compile with waf again and it actually compiles.  (Confused)  So
> where exactly does it get all the options from?  <bsp>/make/target.cfg
> is another file filled with confusion…
> 
>  
> 
> Absolutely confused,
> 

I am not sure what you are wanting to do so it is difficult to
specifically answer this question, I will take a guess.

The BSP defines the compiler machine options. The BSP developer selects
those flags based on the target hardware, ABI, performance and other
settings that are important.

Users building applications *must* make sure any library code and
application code is built with matching options or you potentially risk
building a non-compliant executable which may not link, may crash or may
appear to work yet is wrong in subtle and difficult to figure out ways.
Things that can go wrong range from differing instruction sets,
differing executable ABIs, or incorrect multilib selection when linking.

Libbsd uses rtems_waf as a package. The rtems_waf package knows how to
find a BSP's set of flags from the installed BSP. We build libbsd with
the same options the kernel and BSP is built with because it is the
simplest way to do this.

You can always decide on different flags but this requires you know all
the detail and have a clear understanding of how they work and interact.

Also if you touch any installed file as you are doing the outcome is
undefined.

>           Notice: This e-mail and any files transmitted with it may
>           contain Data Device Corporation's privileged and proprietary
>           information. It is intended solely for the use of the
>           individual or entity to whom it is addressed. If you are not
>           the named recipient of this transmission, any disclosure,
>           copying, distribution or reliance on the contents of this
>           message is prohibited. If you received this e-mail in error,
>           please destroy it and any attached files and notify me
>           immediately.

Please do not spam the list with these signatures. This is the second
time you have been asked. Please find another way to mail the list.

Thanks
Chris


More information about the users mailing list