scons: CheckLinkFlag() only adds to flags if test succeeds

Previously, did not check the return of TryLink() before appending, so
unsupported flags can be used when building shared libraries. This
patch adds checking.

Jira Issue:

Change-Id: Ief62be15009cae9e02aaaa81b4d9c2d7b26e0223
Reviewed-by: Jason Lowe-Power <>
Reviewed-by: Gabe Black <>
Maintainer: Jason Lowe-Power <>
Maintainer: Gabe Black <>
Tested-by: kokoro <>
1 file changed