All of lore.kernel.org
 help / color / mirror / Atom feed
* glibc and LDFLAGS
@ 2020-01-18 22:25 Rasmus Villemoes
  2020-01-18 23:32 ` Richard Purdie
  0 siblings, 1 reply; 8+ messages in thread
From: Rasmus Villemoes @ 2020-01-18 22:25 UTC (permalink / raw)
  To: OE Core mailing list

I've added a custom setting to TARGET_LDFLAGS, but then I noticed that
the glibc build ignored that. The glibc do_compile did

 LDFLAGS = ""

for a very long time, with the explanation that "# -Wl,-rpath-link
<staging>/lib in LDFLAGS can cause breakage if another glibc is in
staging". Is that actually still relevant with per-recipe staging?

If that is indeed moot, can we do

         CPPFLAGS="" oe_runconf
 }

+LDFLAGS += "-fuse-ld=bfd"
 do_compile () {
-       # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if
another glibc is in staging
-       LDFLAGS="-fuse-ld=bfd"
        base_do_compile
        echo "Adjust ldd script"
        if [ -n "${RTLDLIST}" ]

?

And if not, at least move the LDFLAGS definition out to recipe level so
"bitbake -e" will show the value actually in effect? (And that would
also allow a .bbappend to tweak glibc's LDFLAGS with my custom setting,
though it's annoying to have to maintain that, so the best is if glibc
can just be built with the global LDFLAGS setting).

Rasmus


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

* Re: glibc and LDFLAGS
  2020-01-18 22:25 glibc and LDFLAGS Rasmus Villemoes
@ 2020-01-18 23:32 ` Richard Purdie
  2020-01-20  7:28   ` [PATCH] glibc: don't ignore global LDFLAGS settings Rasmus Villemoes
  2020-01-20  7:32   ` ✗ patchtest: failure for " Patchwork
  0 siblings, 2 replies; 8+ messages in thread
From: Richard Purdie @ 2020-01-18 23:32 UTC (permalink / raw)
  To: Rasmus Villemoes, OE Core mailing list

On Sat, 2020-01-18 at 22:25 +0000, Rasmus Villemoes wrote:
> I've added a custom setting to TARGET_LDFLAGS, but then I noticed
> that
> the glibc build ignored that. The glibc do_compile did
> 
>  LDFLAGS = ""
> 
> for a very long time, with the explanation that "# -Wl,-rpath-link
> <staging>/lib in LDFLAGS can cause breakage if another glibc is in
> staging". Is that actually still relevant with per-recipe staging?

It is obsolete now, correct.

> If that is indeed moot, can we do
> 
>          CPPFLAGS="" oe_runconf
>  }
> 
> +LDFLAGS += "-fuse-ld=bfd"

Its worth a try...

Cheers,

Richard



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

* [PATCH] glibc: don't ignore global LDFLAGS settings
  2020-01-18 23:32 ` Richard Purdie
@ 2020-01-20  7:28   ` Rasmus Villemoes
  2020-01-20  9:23     ` [PATCH v2] " Rasmus Villemoes
  2020-01-20  7:32   ` ✗ patchtest: failure for " Patchwork
  1 sibling, 1 reply; 8+ messages in thread
From: Rasmus Villemoes @ 2020-01-20  7:28 UTC (permalink / raw)
  To: openembedded-core

Two things: The -Wl,-rpath-link comment is stale (due to per-recipe
staging), so we no longer need to set our own LDFLAGS to avoid
-Wl,-rpath-link being in there. Second, overriding LDFLAGS should be
done at the recipe level so "bitbake -e" can show what is going on.
Otherwise debugging why one's global LDFLAGS tweaks are being ignored
is needlessly painful.

So pull out the LDFLAGS setting from do_compile, and change it to an
append instead of assignment.

For the benefit of future git blame: the -fuse-ld=bfd setting was
added by ac64c3b96b (glibc: always use bfd linker).

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
---
 meta/recipes-core/glibc/glibc_2.30.bb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/meta/recipes-core/glibc/glibc_2.30.bb b/meta/recipes-core/glibc/glibc_2.30.bb
index 7913bc2812..c6dd78ca8b 100644
--- a/meta/recipes-core/glibc/glibc_2.30.bb
+++ b/meta/recipes-core/glibc/glibc_2.30.bb
@@ -93,9 +93,8 @@ do_configure () {
         CPPFLAGS="" oe_runconf
 }
 
+LDFLAGS += "-fuse-ld=bfd"
 do_compile () {
-	# -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
-	LDFLAGS="-fuse-ld=bfd"
 	base_do_compile
 	echo "Adjust ldd script"
 	if [ -n "${RTLDLIST}" ]
-- 
2.23.0



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

* ✗ patchtest: failure for glibc: don't ignore global LDFLAGS settings
  2020-01-18 23:32 ` Richard Purdie
  2020-01-20  7:28   ` [PATCH] glibc: don't ignore global LDFLAGS settings Rasmus Villemoes
@ 2020-01-20  7:32   ` Patchwork
  1 sibling, 0 replies; 8+ messages in thread
From: Patchwork @ 2020-01-20  7:32 UTC (permalink / raw)
  To: Rasmus Villemoes; +Cc: openembedded-core

== Series Details ==

Series: glibc: don't ignore global LDFLAGS settings
Revision: 1
URL   : https://patchwork.openembedded.org/series/22148/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
  Suggested fix    Rebase your series on top of targeted branch
  Targeted branch  master (currently at 1098fdf360)



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



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

* [PATCH v2] glibc: don't ignore global LDFLAGS settings
  2020-01-20  7:28   ` [PATCH] glibc: don't ignore global LDFLAGS settings Rasmus Villemoes
@ 2020-01-20  9:23     ` Rasmus Villemoes
  2020-01-20 15:42       ` Khem Raj
  0 siblings, 1 reply; 8+ messages in thread
From: Rasmus Villemoes @ 2020-01-20  9:23 UTC (permalink / raw)
  To: openembedded-core

Two things: The -Wl,-rpath-link comment is stale (due to per-recipe
staging), so we no longer need to set our own LDFLAGS to avoid
-Wl,-rpath-link being in there. Second, overriding LDFLAGS should be
done at the recipe level so "bitbake -e" can show what is going on.
Otherwise debugging why one's global LDFLAGS tweaks are being ignored
is needlessly painful.

So pull out the LDFLAGS setting from do_compile, and change it to an
append instead of assignment.

For the benefit of future git blame: the -fuse-ld=bfd setting was
added by ac64c3b96b (glibc: always use bfd linker).

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
---
v2: Rebase to real upstream master. Note to self: "git pull" before rebasing to master.

 meta/recipes-core/glibc/glibc_2.31.bb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/meta/recipes-core/glibc/glibc_2.31.bb b/meta/recipes-core/glibc/glibc_2.31.bb
index b8c570db52..cfba4de49b 100644
--- a/meta/recipes-core/glibc/glibc_2.31.bb
+++ b/meta/recipes-core/glibc/glibc_2.31.bb
@@ -93,9 +93,8 @@ do_configure () {
         CPPFLAGS="" oe_runconf
 }
 
+LDFLAGS += "-fuse-ld=bfd"
 do_compile () {
-	# -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
-	LDFLAGS="-fuse-ld=bfd"
 	base_do_compile
 	echo "Adjust ldd script"
 	if [ -n "${RTLDLIST}" ]
-- 
2.23.0



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

* Re: [PATCH v2] glibc: don't ignore global LDFLAGS settings
  2020-01-20  9:23     ` [PATCH v2] " Rasmus Villemoes
@ 2020-01-20 15:42       ` Khem Raj
  2020-01-20 15:53         ` Rasmus Villemoes
  2020-02-03 18:55         ` Rasmus Villemoes
  0 siblings, 2 replies; 8+ messages in thread
From: Khem Raj @ 2020-01-20 15:42 UTC (permalink / raw)
  To: Rasmus Villemoes; +Cc: openembedded-core

this patch is ok but I have reservations since  += now means global
ldflags will be applied
so it would need some testing to ensure it works well.

On Mon, Jan 20, 2020 at 1:23 AM Rasmus Villemoes
<rasmus.villemoes@prevas.dk> wrote:
>
> Two things: The -Wl,-rpath-link comment is stale (due to per-recipe
> staging), so we no longer need to set our own LDFLAGS to avoid
> -Wl,-rpath-link being in there. Second, overriding LDFLAGS should be
> done at the recipe level so "bitbake -e" can show what is going on.
> Otherwise debugging why one's global LDFLAGS tweaks are being ignored
> is needlessly painful.
>
> So pull out the LDFLAGS setting from do_compile, and change it to an
> append instead of assignment.
>
> For the benefit of future git blame: the -fuse-ld=bfd setting was
> added by ac64c3b96b (glibc: always use bfd linker).
>
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
> ---
> v2: Rebase to real upstream master. Note to self: "git pull" before rebasing to master.
>
>  meta/recipes-core/glibc/glibc_2.31.bb | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/meta/recipes-core/glibc/glibc_2.31.bb b/meta/recipes-core/glibc/glibc_2.31.bb
> index b8c570db52..cfba4de49b 100644
> --- a/meta/recipes-core/glibc/glibc_2.31.bb
> +++ b/meta/recipes-core/glibc/glibc_2.31.bb
> @@ -93,9 +93,8 @@ do_configure () {
>          CPPFLAGS="" oe_runconf
>  }
>
> +LDFLAGS += "-fuse-ld=bfd"
>  do_compile () {
> -       # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
> -       LDFLAGS="-fuse-ld=bfd"
>         base_do_compile
>         echo "Adjust ldd script"
>         if [ -n "${RTLDLIST}" ]
> --
> 2.23.0
>


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

* Re: [PATCH v2] glibc: don't ignore global LDFLAGS settings
  2020-01-20 15:42       ` Khem Raj
@ 2020-01-20 15:53         ` Rasmus Villemoes
  2020-02-03 18:55         ` Rasmus Villemoes
  1 sibling, 0 replies; 8+ messages in thread
From: Rasmus Villemoes @ 2020-01-20 15:53 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-core

On 20/01/2020 16.42, Khem Raj wrote:
> this patch is ok but I have reservations since  += now means global
> ldflags will be applied

Indeed, that's half the point of the patch.

> so it would need some testing to ensure it works well.

Yes, but I don't think there's any way to figure out if it breaks
something other than trying it. If it does, I can certainly make it just
LDFLAGS = "..." outside do_compile, and then I'll have to .bbappend or
_pn-glibc_append my custom LDFLAGS, which is ok for a single rather
special recipe, but would be a hassle to maintain if this was a common
thing.

Rasmus

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

* Re: [PATCH v2] glibc: don't ignore global LDFLAGS settings
  2020-01-20 15:42       ` Khem Raj
  2020-01-20 15:53         ` Rasmus Villemoes
@ 2020-02-03 18:55         ` Rasmus Villemoes
  1 sibling, 0 replies; 8+ messages in thread
From: Rasmus Villemoes @ 2020-02-03 18:55 UTC (permalink / raw)
  To: Khem Raj; +Cc: openembedded-core

ping

On 20/01/2020 16.42, Khem Raj wrote:
> this patch is ok but I have reservations since  += now means global
> ldflags will be applied
> so it would need some testing to ensure it works well.
> 
> On Mon, Jan 20, 2020 at 1:23 AM Rasmus Villemoes
> <rasmus.villemoes@prevas.dk> wrote:
>>
>> Two things: The -Wl,-rpath-link comment is stale (due to per-recipe
>> staging), so we no longer need to set our own LDFLAGS to avoid
>> -Wl,-rpath-link being in there. Second, overriding LDFLAGS should be
>> done at the recipe level so "bitbake -e" can show what is going on.
>> Otherwise debugging why one's global LDFLAGS tweaks are being ignored
>> is needlessly painful.
>>
>> So pull out the LDFLAGS setting from do_compile, and change it to an
>> append instead of assignment.
>>
>> For the benefit of future git blame: the -fuse-ld=bfd setting was
>> added by ac64c3b96b (glibc: always use bfd linker).
>>
>> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
>> ---
>> v2: Rebase to real upstream master. Note to self: "git pull" before rebasing to master.
>>
>>  meta/recipes-core/glibc/glibc_2.31.bb | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/meta/recipes-core/glibc/glibc_2.31.bb b/meta/recipes-core/glibc/glibc_2.31.bb
>> index b8c570db52..cfba4de49b 100644
>> --- a/meta/recipes-core/glibc/glibc_2.31.bb
>> +++ b/meta/recipes-core/glibc/glibc_2.31.bb
>> @@ -93,9 +93,8 @@ do_configure () {
>>          CPPFLAGS="" oe_runconf
>>  }
>>
>> +LDFLAGS += "-fuse-ld=bfd"
>>  do_compile () {
>> -       # -Wl,-rpath-link <staging>/lib in LDFLAGS can cause breakage if another glibc is in staging
>> -       LDFLAGS="-fuse-ld=bfd"
>>         base_do_compile
>>         echo "Adjust ldd script"
>>         if [ -n "${RTLDLIST}" ]
>> --
>> 2.23.0
>>


-- 
Rasmus Villemoes
Software Developer
Prevas A/S
Hedeager 3
DK-8200 Aarhus N
+45 51210274
rasmus.villemoes@prevas.dk
www.prevas.dk

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

end of thread, other threads:[~2020-02-03 18:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-18 22:25 glibc and LDFLAGS Rasmus Villemoes
2020-01-18 23:32 ` Richard Purdie
2020-01-20  7:28   ` [PATCH] glibc: don't ignore global LDFLAGS settings Rasmus Villemoes
2020-01-20  9:23     ` [PATCH v2] " Rasmus Villemoes
2020-01-20 15:42       ` Khem Raj
2020-01-20 15:53         ` Rasmus Villemoes
2020-02-03 18:55         ` Rasmus Villemoes
2020-01-20  7:32   ` ✗ patchtest: failure for " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.