Skip to contentSkip to conversation

drop as-needed.inc

PATCH In review Andre McCurdy 2 participants 9 messages May 29, 2018 – May 30, 2018

lore
Share & tools
lore
#0 lore raw

v2 cover drop as-needed.inc

v2: Rebase to latest master (where the previous ASNEEDED patch for
distcc has been reverted to avoid conflicts with a distcc version update) + add new patch to fix bitbake.conf typo.

Andre McCurdy (5):
distcc: move ASNEEDED over-ride into the distcc recipe as-needed.inc: drop ASNEEDED over-ride for openobex bitbake.conf: drop obsolete commented out value for TARGET_LDFLAGS bitbake.conf: include ASNEEDED in TARGET_LDFLAGS directly bitbake.conf: fix minor typo in comments

 meta/conf/bitbake.conf                      | 9 ++++-----
 meta/conf/distro/include/as-needed.inc      | 7 -------
 meta/conf/distro/include/tcmode-default.inc | 3 ---
 meta/recipes-devtools/distcc/distcc_3.3.bb  | 2 ++
 4 files changed, 6 insertions(+), 15 deletions(-)
 delete mode 100644 meta/conf/distro/include/as-needed.inc
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/5 distcc: move ASNEEDED over-ride into the distcc recipe

Move the recipe specific over-ride for ASNEEDED into the recipe to make it more apparent that the over-ride is being applied (and that it should be re-checked on version updates, etc).

Re-apply change, which was previously merged and then reverted to avoid conflicts with a distcc version update.

---
 meta/conf/distro/include/as-needed.inc     | 1 -
 meta/recipes-devtools/distcc/distcc_3.3.bb | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)
meta/conf/distro/include/as-needed.inc +0 -1
index f2e7e7b..9c23564 100644
@@ -1,7 +1,6 @@
 
 ASNEEDED = "-Wl,--as-needed"
 
-ASNEEDED_pn-distcc = ""
 ASNEEDED_pn-openobex = ""
 
 TARGET_LDFLAGS += "${ASNEEDED}"
meta/recipes-devtools/distcc/distcc_3.3.bb +2 -0
index 40648e2..33a64ce 100644
@@ -25,6 +25,8 @@ S = "${WORKDIR}/git"
 
 inherit autotools pkgconfig update-rc.d useradd systemd
 
+ASNEEDED = ""
+
 EXTRA_OECONF += "--disable-Werror PYTHON='' --disable-pump-mode"
 
 USERADD_PACKAGES = "${PN}"
Signature · 1 line
1.9.1
#2 lore raw

PATCH v2 2/5 as-needed.inc: drop ASNEEDED over-ride for openobex

In reply to Andre McCurdy

The over-ride has been merged into the openobex recipe in meta-oe:

http://git.openembedded.org/meta-openembedded/commit/?id=e59a9738c24ccaeac91740d1f67c607d4ee2a217

---
 meta/conf/distro/include/as-needed.inc | 2 --
 1 file changed, 2 deletions(-)
meta/conf/distro/include/as-needed.inc +0 -2
index 9c23564..b163fef 100644
@@ -1,6 +1,4 @@
 
 ASNEEDED = "-Wl,--as-needed"
 
-ASNEEDED_pn-openobex = ""
-
 TARGET_LDFLAGS += "${ASNEEDED}"
Signature · 1 line
1.9.1
#3 lore raw

PATCH v2 3/5 bitbake.conf: drop obsolete commented out value for TARGET_LDFLAGS

In reply to Andre McCurdy

The commented out value for TARGET_LDFLAGS dates back to the switch to sysroot enabled toolchains in 2007 and is now obsolete.

http://git.openembedded.org/openembedded-core/commit/?id=ba2e1f4d933c37b372d6749d64614f2510ee9d7b

---
 meta/conf/bitbake.conf | 3 ---
 1 file changed, 3 deletions(-)
meta/conf/bitbake.conf +0 -3
index 6ecf78b..15f6da7 100644
@@ -587,9 +587,6 @@ TARGET_LINK_HASH_STYLE ?= "${@['-Wl,--hash-style=gnu',''][d.getVar('LINKER_HASH_
 
 export LDFLAGS = "${TARGET_LDFLAGS}"
 export TARGET_LDFLAGS = "-Wl,-O1 ${TARGET_LINK_HASH_STYLE}"
-#export TARGET_LDFLAGS = "-L${STAGING_DIR_TARGET}${libdir} \
-#                         -Wl,-rpath-link,${STAGING_DIR_TARGET}${libdir} \
-#                         -Wl,-O1"
 
 # Pass parallel make options to the compile task
 EXTRA_OEMAKE_prepend_task-compile = "${PARALLEL_MAKE} "
Signature · 1 line
1.9.1
#4 lore raw

PATCH v2 4/5 bitbake.conf: include ASNEEDED in TARGET_LDFLAGS directly

In reply to 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).

---
 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
meta/conf/bitbake.conf +3 -1
index 15f6da7..fab3dcc 100644
@@ -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} "
meta/conf/distro/include/as-needed.inc deleted +0 -4
deleted file mode 100644
index b163fef..0000000
@@ -1,4 +0,0 @@
-
-ASNEEDED = "-Wl,--as-needed"
-
-TARGET_LDFLAGS += "${ASNEEDED}"
meta/conf/distro/include/tcmode-default.inc +0 -3
index 4b58df0..d85fd1e 100644
@@ -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}"
Signature · 1 line
1.9.1
#5 lore raw

Re: [PATCH v2 4/5] bitbake.conf: include ASNEEDED in TARGET_LDFLAGS directly

Quoted 8 lines · 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).

We 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.

Quoted 60 lines
---
 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
meta/conf/bitbake.conf +3 -1
index 15f6da7..fab3dcc 100644
@@ -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} "
meta/conf/distro/include/as-needed.inc deleted +0 -4
deleted file mode 100644
index b163fef..0000000
@@ -1,4 +0,0 @@
-
-ASNEEDED = "-Wl,--as-needed"
-
-TARGET_LDFLAGS += "${ASNEEDED}"
meta/conf/distro/include/tcmode-default.inc +0 -4
index 4b58df0..d85fd1e 100644
@@ -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

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#6 lore raw

Re: [PATCH v2 4/5] bitbake.conf: include ASNEEDED in TARGET_LDFLAGS directly

Quoted 6 lines · Khem Raj
Quoted 5 lines · 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).

Quoted 6 lines
Quoted 3 lines

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.

Quoted 2 lines

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?

Quoted 3 lines

From internal toolchains pov
this is a good change, but It would be good if some users of external toolchains can chime in.

#7 lore raw

Re: [PATCH v2 4/5] bitbake.conf: include ASNEEDED in TARGET_LDFLAGS directly

Quoted 14 lines · Andre McCurdy
Quoted 6 lines · Khem Raj
Quoted 5 lines · 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).

Quoted 6 lines
Quoted 3 lines

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,

Quoted 8 lines

External toolchains can easily over-ride ASNEEDED if they need to.

Quoted 2 lines

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.

Quoted 3 lines
Quoted 3 lines

From internal toolchains pov
this is a good change, but It would be good if some users of external toolchains can chime in.

#8 lore raw

PATCH v2 5/5 bitbake.conf: fix minor typo in comments

In reply to Andre McCurdy
---
 meta/conf/bitbake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/bitbake.conf +1 -1
index fab3dcc..3f63a25 100644
@@ -93,7 +93,7 @@ VOLATILE_LOG_DIR ?= "yes"
 # Architecture-dependent build variables.
 ##################################################################
 
-# Immediate expansion since there is no point in reapeatedly calling
+# Immediate expansion since there is no point in repeatedly calling
 # os.uname() throughout parsing
 BUILD_ARCH := "${@os.uname()[4]}"
 BUILD_OS := "${@os.uname()[0].lower()}"
Signature · 1 line
1.9.1