From 996bcb143cb8755cadb986e084b5f24e3ffdb03b Mon Sep 17 00:00:00 2001 From: Andre McCurdy Date: Tue, 29 May 2018 14:29:47 -0700 Subject: bitbake.conf: include ASNEEDED in TARGET_LDFLAGS directly 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). Signed-off-by: Andre McCurdy Signed-off-by: Richard Purdie --- meta/conf/bitbake.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'meta/conf/bitbake.conf') diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 15f6da71cc..fab3dcccba 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -585,8 +585,10 @@ LINKER_HASH_STYLE_mipsarch = "sysv" TARGET_LINK_HASH_STYLE ?= "${@['-Wl,--hash-style=gnu',''][d.getVar('LINKER_HASH_STYLE') != 'gnu']}" +ASNEEDED ?= "-Wl,--as-needed" + export LDFLAGS = "${TARGET_LDFLAGS}" -export TARGET_LDFLAGS = "-Wl,-O1 ${TARGET_LINK_HASH_STYLE}" +export TARGET_LDFLAGS = "-Wl,-O1 ${TARGET_LINK_HASH_STYLE} ${ASNEEDED}" # Pass parallel make options to the compile task EXTRA_OEMAKE_prepend_task-compile = "${PARALLEL_MAKE} " -- cgit 1.2.3-korg