On Wed, May 30, 2018 at 10:46 AM, Andre McCurdy <armccurdy@...> wrote:
On Tue, May 29, 2018 at 7:13 PM, Khem Raj <raj.khem@...> wrote:
On Tue, May 29, 2018 at 2:29 PM, Andre McCurdy <armccurdy@...> wrote:
Previously, ASNEEDED was appended to TARGET_LDFLAGS from as-needed.inc via tcmode-default.inc and so may not have been enabled for external toolchain builds or other configurations which over-ride TCMODE (ie builds which do not include tcmode-default.inc).
Include ASNEEDED in TARGET_LDFLAGS directly from bitbake.conf to ensure that the optimisation is applied to all builds (and for consistency with the way that TARGET_LINK_HASH_STYLE is handled).
We have to be ensure that external toolchains can either override or support --as-needed feature,
External toolchains can easily over-ride ASNEEDED if they need to.
since we may not be able to control what linker they use or version of gnu ld they may deploy.
When was --as-needed first added to gnu ld? Do you know of an external toolchain which might not support it?
If they have new enough binutils it should not be an issue. but I dont know if there are such SDKs out there, thats where external toolchain makers can help. Otherwise we can assume its fine.
From internal toolchains pov this is a good change, but It would be good if some users of external toolchains can chime in.