Commit c2fd6061 authored by Mats Wichmann's avatar Mats Wichmann Committed by Phil Coval

build: make linux shared libs with as-needed flag

The shared libraries in the Linux build sometimes link with other shared
libraries they don't actually use.  It's "cleaner" if the dependencies
are only real ones.  Adding the linker flag only for shared library builds
(SHLINKFLAGS) improves this situation, and leads to the changes documented
in the referenced bug (IOT-2354).

The scons scripts which build these libraries should presumably
be examined, to stop them listing dependencies they don't use,
but that is currently a separate topic.

Change-Id: I0b55c2048af36a28ae26829aa934cfadc4665651
Bug: IOT-2354
Signed-off-by: default avatarMats Wichmann <mats@linux.com>
parent 3b21b046
......@@ -28,6 +28,7 @@ if not env.get('RELEASE'):
env.AppendUnique(CPPDEFINES=['WITH_POSIX', '__linux__'])
env.AppendUnique(CFLAGS=['-std=gnu99'])
env.AppendUnique(CCFLAGS=['-Wall', '-Wextra', '-fPIC'])
env.AppendUnique(SHLINKFLAGS=['-Wl,--as-needed'])
env.AppendUnique(LIBS=['dl', 'pthread', 'uuid'])
# The -Wno-error=missing-field-initializers is used due to a bug in versions
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment