On 05/09/2018 05:09 AM, Raveendranath Kondrakunta wrote:
> Some findings on the same.
> 
> On PC, linux, build with RELEASE=1, the compilation is done with *'-Os' -
> Optimize for Size.*
> 
> For Yocto, even with RELEASE=1, there are no Optimization flags and is
> build with '-g' to allow bitbake pick up the debug symbols. Adding '-Os' to
> yocto builds along with -g, the sizes are comparable. Any undesired effect
> because of this?
> 
> -Ravee

This is due to the odd way the yocto build happens: it temporarily
pretends to be a unique build, during which time it fishes a lot of
information about the toolchain and sets it in the scons environment,
since scons normally ignores the shell environment.  Then it flips
personality to behave like the linux build:

    '''
    Now reset TARGET_OS to linux so that all linux specific build
configurations
    hereupon apply for the entirety of the build process.
    '''
    env['TARGET_OS'] = 'linux'

but part of that comment is actually a lie, as the linux-specific build
script (build_common/linux/SConscript) is quite explicitly not called,
as that happens in the else clause of the "if yocto" test.

In other words, this stanza is never executed:

# Set release/debug flags
if env.get('RELEASE'):
    env.AppendUnique(CCFLAGS=['-Os'])
else:
    env.AppendUnique(CCFLAGS=['-g'])

I don't see why the "add -Os if RELEASE is true" logic can't be added to
the yocto case here, if we can confirm nothing breaks. This isn't one of
the targets that is built for by the CI system (aka Jenkins), so it will
have to be a more manual confirmation.

It's possible there are other flags that have been missed as there's
been a bit of an effort to move flags to target-specific configs rather
than scattering all around the codebase (that work isn't done yet, and
several pending patches have stalled out).  Because yocto isn't a full
target...






_______________________________________________
iotivity-dev mailing list
iotivity-dev@lists.iotivity.org
https://lists.iotivity.org/mailman/listinfo/iotivity-dev

Reply via email to