]> code.ossystems Code Review - openembedded-core.git/commitdiff
bitbake.conf: include ASNEEDED in TARGET_LDFLAGS directly
authorAndre McCurdy <armccurdy@gmail.com>
Tue, 29 May 2018 21:29:47 +0000 (14:29 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 3 Jun 2018 15:54:22 +0000 (16:54 +0100)
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@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/conf/bitbake.conf
meta/conf/distro/include/as-needed.inc [deleted file]
meta/conf/distro/include/tcmode-default.inc

index 15f6da71cc567003dc2e8dc91adc130969d5dd8b..fab3dcccba168f132f08352e61ba130e588639be 100644 (file)
@@ -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 (file)
index b163fef..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-
-ASNEEDED = "-Wl,--as-needed"
-
-TARGET_LDFLAGS += "${ASNEEDED}"
index 4b58df0459bbf8a0deb273b238353d2df322d628..d85fd1e921d7ef8b042f075aabfc500d98da55e1 100644 (file)
@@ -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}"