Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v2 0/5] drop as-needed.inc
@ 2018-05-29 21:29 Andre McCurdy
  2018-05-29 21:29 ` [PATCH v2 1/5] distcc: move ASNEEDED over-ride into the distcc recipe Andre McCurdy
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Andre McCurdy @ 2018-05-29 21:29 UTC (permalink / raw)
  To: openembedded-core

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

-- 
1.9.1



^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v2 1/5] distcc: move ASNEEDED over-ride into the distcc recipe
  2018-05-29 21:29 [PATCH v2 0/5] drop as-needed.inc Andre McCurdy
@ 2018-05-29 21:29 ` Andre McCurdy
  2018-05-29 21:29 ` [PATCH v2 2/5] as-needed.inc: drop ASNEEDED over-ride for openobex Andre McCurdy
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Andre McCurdy @ 2018-05-29 21:29 UTC (permalink / raw)
  To: openembedded-core

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.

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
 meta/conf/distro/include/as-needed.inc     | 1 -
 meta/recipes-devtools/distcc/distcc_3.3.bb | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/conf/distro/include/as-needed.inc b/meta/conf/distro/include/as-needed.inc
index f2e7e7b..9c23564 100644
--- a/meta/conf/distro/include/as-needed.inc
+++ b/meta/conf/distro/include/as-needed.inc
@@ -1,7 +1,6 @@
 
 ASNEEDED = "-Wl,--as-needed"
 
-ASNEEDED_pn-distcc = ""
 ASNEEDED_pn-openobex = ""
 
 TARGET_LDFLAGS += "${ASNEEDED}"
diff --git a/meta/recipes-devtools/distcc/distcc_3.3.bb b/meta/recipes-devtools/distcc/distcc_3.3.bb
index 40648e2..33a64ce 100644
--- a/meta/recipes-devtools/distcc/distcc_3.3.bb
+++ b/meta/recipes-devtools/distcc/distcc_3.3.bb
@@ -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}"
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 2/5] as-needed.inc: drop ASNEEDED over-ride for openobex
  2018-05-29 21:29 [PATCH v2 0/5] drop as-needed.inc Andre McCurdy
  2018-05-29 21:29 ` [PATCH v2 1/5] distcc: move ASNEEDED over-ride into the distcc recipe Andre McCurdy
@ 2018-05-29 21:29 ` Andre McCurdy
  2018-05-29 21:29 ` [PATCH v2 3/5] bitbake.conf: drop obsolete commented out value for TARGET_LDFLAGS Andre McCurdy
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Andre McCurdy @ 2018-05-29 21:29 UTC (permalink / raw)
  To: openembedded-core

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

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

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
 meta/conf/distro/include/as-needed.inc | 2 --
 1 file changed, 2 deletions(-)

diff --git a/meta/conf/distro/include/as-needed.inc b/meta/conf/distro/include/as-needed.inc
index 9c23564..b163fef 100644
--- a/meta/conf/distro/include/as-needed.inc
+++ b/meta/conf/distro/include/as-needed.inc
@@ -1,6 +1,4 @@
 
 ASNEEDED = "-Wl,--as-needed"
 
-ASNEEDED_pn-openobex = ""
-
 TARGET_LDFLAGS += "${ASNEEDED}"
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 3/5] bitbake.conf: drop obsolete commented out value for TARGET_LDFLAGS
  2018-05-29 21:29 [PATCH v2 0/5] drop as-needed.inc Andre McCurdy
  2018-05-29 21:29 ` [PATCH v2 1/5] distcc: move ASNEEDED over-ride into the distcc recipe Andre McCurdy
  2018-05-29 21:29 ` [PATCH v2 2/5] as-needed.inc: drop ASNEEDED over-ride for openobex Andre McCurdy
@ 2018-05-29 21:29 ` Andre McCurdy
  2018-05-29 21:29 ` [PATCH v2 4/5] bitbake.conf: include ASNEEDED in TARGET_LDFLAGS directly Andre McCurdy
  2018-05-29 21:29 ` [PATCH v2 5/5] bitbake.conf: fix minor typo in comments Andre McCurdy
  4 siblings, 0 replies; 9+ messages in thread
From: Andre McCurdy @ 2018-05-29 21:29 UTC (permalink / raw)
  To: openembedded-core

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

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
 meta/conf/bitbake.conf | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 6ecf78b..15f6da7 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -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} "
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 4/5] bitbake.conf: include ASNEEDED in TARGET_LDFLAGS directly
  2018-05-29 21:29 [PATCH v2 0/5] drop as-needed.inc Andre McCurdy
                   ` (2 preceding siblings ...)
  2018-05-29 21:29 ` [PATCH v2 3/5] bitbake.conf: drop obsolete commented out value for TARGET_LDFLAGS Andre McCurdy
@ 2018-05-29 21:29 ` Andre McCurdy
  2018-05-30  2:13   ` Khem Raj
  2018-05-29 21:29 ` [PATCH v2 5/5] bitbake.conf: fix minor typo in comments Andre McCurdy
  4 siblings, 1 reply; 9+ messages in thread
From: Andre McCurdy @ 2018-05-29 21:29 UTC (permalink / raw)
  To: openembedded-core

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



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v2 5/5] bitbake.conf: fix minor typo in comments
  2018-05-29 21:29 [PATCH v2 0/5] drop as-needed.inc Andre McCurdy
                   ` (3 preceding siblings ...)
  2018-05-29 21:29 ` [PATCH v2 4/5] bitbake.conf: include ASNEEDED in TARGET_LDFLAGS directly Andre McCurdy
@ 2018-05-29 21:29 ` Andre McCurdy
  4 siblings, 0 replies; 9+ messages in thread
From: Andre McCurdy @ 2018-05-29 21:29 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
---
 meta/conf/bitbake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index fab3dcc..3f63a25 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -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()}"
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 4/5] bitbake.conf: include ASNEEDED in TARGET_LDFLAGS directly
  2018-05-29 21:29 ` [PATCH v2 4/5] bitbake.conf: include ASNEEDED in TARGET_LDFLAGS directly Andre McCurdy
@ 2018-05-30  2:13   ` Khem Raj
  2018-05-30 17:46     ` Andre McCurdy
  0 siblings, 1 reply; 9+ messages in thread
From: Khem Raj @ 2018-05-30  2:13 UTC (permalink / raw)
  To: Andre McCurdy; +Cc: Patches and discussions about the oe-core layer

On Tue, May 29, 2018 at 2:29 PM, Andre McCurdy <armccurdy@gmail.com> 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, 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.

>
> Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
> ---
>  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
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 4/5] bitbake.conf: include ASNEEDED in TARGET_LDFLAGS directly
  2018-05-30  2:13   ` Khem Raj
@ 2018-05-30 17:46     ` Andre McCurdy
  2018-05-30 19:11       ` Khem Raj
  0 siblings, 1 reply; 9+ messages in thread
From: Andre McCurdy @ 2018-05-30 17:46 UTC (permalink / raw)
  To: Khem Raj; +Cc: Patches and discussions about the oe-core layer

On Tue, May 29, 2018 at 7:13 PM, Khem Raj <raj.khem@gmail.com> wrote:
> On Tue, May 29, 2018 at 2:29 PM, Andre McCurdy <armccurdy@gmail.com> 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?

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v2 4/5] bitbake.conf: include ASNEEDED in TARGET_LDFLAGS directly
  2018-05-30 17:46     ` Andre McCurdy
@ 2018-05-30 19:11       ` Khem Raj
  0 siblings, 0 replies; 9+ messages in thread
From: Khem Raj @ 2018-05-30 19:11 UTC (permalink / raw)
  To: Andre McCurdy; +Cc: Patches and discussions about the oe-core layer

On Wed, May 30, 2018 at 10:46 AM, Andre McCurdy <armccurdy@gmail.com> wrote:
> On Tue, May 29, 2018 at 7:13 PM, Khem Raj <raj.khem@gmail.com> wrote:
>> On Tue, May 29, 2018 at 2:29 PM, Andre McCurdy <armccurdy@gmail.com> 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.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-05-30 19:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-29 21:29 [PATCH v2 0/5] drop as-needed.inc Andre McCurdy
2018-05-29 21:29 ` [PATCH v2 1/5] distcc: move ASNEEDED over-ride into the distcc recipe Andre McCurdy
2018-05-29 21:29 ` [PATCH v2 2/5] as-needed.inc: drop ASNEEDED over-ride for openobex Andre McCurdy
2018-05-29 21:29 ` [PATCH v2 3/5] bitbake.conf: drop obsolete commented out value for TARGET_LDFLAGS Andre McCurdy
2018-05-29 21:29 ` [PATCH v2 4/5] bitbake.conf: include ASNEEDED in TARGET_LDFLAGS directly Andre McCurdy
2018-05-30  2:13   ` Khem Raj
2018-05-30 17:46     ` Andre McCurdy
2018-05-30 19:11       ` Khem Raj
2018-05-29 21:29 ` [PATCH v2 5/5] bitbake.conf: fix minor typo in comments Andre McCurdy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox