Date
1 - 4 of 4
[PATCH v2 4/5] bitbake.conf: include ASNEEDED in TARGET_LDFLAGS directly
Andre McCurdy
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 <armccurdy@...> --- meta/conf/bitbake.conf | 4 +++- meta/conf/distro/include/as-needed.inc | 4 ---- meta/conf/distro/include/tcmode-default.inc | 3 --- 3 files changed, 3 insertions(+), 8 deletions(-) delete mode 100644 meta/conf/distro/include/as-needed.inc diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 15f6da7..fab3dcc 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} " diff --git a/meta/conf/distro/include/as-needed.inc b/meta/conf/distro/include/as-needed.inc deleted file mode 100644 index b163fef..0000000 --- a/meta/conf/distro/include/as-needed.inc +++ /dev/null @@ -1,4 +0,0 @@ - -ASNEEDED = "-Wl,--as-needed" - -TARGET_LDFLAGS += "${ASNEEDED}" diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc index 4b58df0..d85fd1e 100644 --- a/meta/conf/distro/include/tcmode-default.inc +++ b/meta/conf/distro/include/tcmode-default.inc @@ -65,12 +65,9 @@ PREFERRED_VERSION_glibc-initial ?= "${GLIBCVERSION}" PREFERRED_VERSION_nativesdk-glibc-initial ?= "${GLIBCVERSION}" PREFERRED_VERSION_cross-localedef-native ?= "${GLIBCVERSION}" - PREFERRED_VERSION_qemu ?= "${QEMUVERSION}" PREFERRED_VERSION_qemu-native ?= "${QEMUVERSION}" PREFERRED_VERSION_nativesdk-qemu ?= "${QEMUVERSION}" -# Setup suitable toolchain flags -require conf/distro/include/as-needed.inc GOVERSION ?= "1.9%" PREFERRED_VERSION_virtual/${TARGET_PREFIX}go ?= "${GOVERSION}" -- 1.9.1 |
|
On Tue, May 29, 2018 at 2:29 PM, Andre McCurdy <armccurdy@...> wrote:
Previously, ASNEEDED was appended to TARGET_LDFLAGS fromWe have to be ensure that external toolchains can either override or support --as-needed feature, since we may not be able to control what linker they use or version of gnu ld they may deploy. From internal toolchains pov this is a good change, but It would be good if some users of external toolchains can chime in.
|
|
Andre McCurdy
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:External toolchains can easily over-ride ASNEEDED if they need to.Previously, ASNEEDED was appended to TARGET_LDFLAGS fromWe have to be ensure that external toolchains can either override or support since we may not be able to control what linker they useWhen was --as-needed first added to gnu ld? Do you know of an external toolchain which might not support it? From internal toolchains pov |
|
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:If they have new enough binutils it should not be an issue. but I dont knowOn Tue, May 29, 2018 at 2:29 PM, Andre McCurdy <armccurdy@...> wrote:External toolchains can easily over-ride ASNEEDED if they need to.Previously, ASNEEDED was appended to TARGET_LDFLAGS fromWe have to be ensure that external toolchains can either override or support if there are such SDKs out there, thats where external toolchain makers can help. Otherwise we can assume its fine. From internal toolchains pov |
|