* [PATCH RFC] binutils: allow distro to select gold as default cross-linker
@ 2011-06-14 15:30 Phil Blundell
2011-06-14 15:38 ` Koen Kooi
2011-06-15 2:42 ` Khem Raj
0 siblings, 2 replies; 13+ messages in thread
From: Phil Blundell @ 2011-06-14 15:30 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
This is not particularly pretty but I couldn't think of any obviously
better way of doing it. Any suggestions?
Signed-off-by: Phil Blundell <philb@gnu.org>
---
meta/recipes-devtools/binutils/binutils-cross.inc | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/meta/recipes-devtools/binutils/binutils-cross.inc b/meta/recipes-devtools/binutils/binutils-cross.inc
index 4b90972..5a41970 100644
--- a/meta/recipes-devtools/binutils/binutils-cross.inc
+++ b/meta/recipes-devtools/binutils/binutils-cross.inc
@@ -5,7 +5,8 @@ EXTRA_OECONF = "--with-sysroot=${STAGING_DIR_TARGET} \
--program-prefix=${TARGET_PREFIX} \
--disable-install-libbfd \
--disable-werror \
- --enable-poison-system-directories"
+ --enable-poison-system-directories \
+ ${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default', '', d)}"
do_install () {
oe_runmake 'DESTDIR=${D}' install
--
1.7.2.5
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH RFC] binutils: allow distro to select gold as default cross-linker
2011-06-14 15:30 [PATCH RFC] binutils: allow distro to select gold as default cross-linker Phil Blundell
@ 2011-06-14 15:38 ` Koen Kooi
2011-06-15 2:44 ` Khem Raj
2011-06-15 8:04 ` Phil Blundell
2011-06-15 2:42 ` Khem Raj
1 sibling, 2 replies; 13+ messages in thread
From: Koen Kooi @ 2011-06-14 15:38 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
Op 14 jun 2011, om 17:30 heeft Phil Blundell het volgende geschreven:
> This is not particularly pretty but I couldn't think of any obviously
> better way of doing it. Any suggestions?
>
> Signed-off-by: Phil Blundell <philb@gnu.org>
> ---
> meta/recipes-devtools/binutils/binutils-cross.inc | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/meta/recipes-devtools/binutils/binutils-cross.inc b/meta/recipes-devtools/binutils/binutils-cross.inc
> index 4b90972..5a41970 100644
> --- a/meta/recipes-devtools/binutils/binutils-cross.inc
> +++ b/meta/recipes-devtools/binutils/binutils-cross.inc
> @@ -5,7 +5,8 @@ EXTRA_OECONF = "--with-sysroot=${STAGING_DIR_TARGET} \
> --program-prefix=${TARGET_PREFIX} \
> --disable-install-libbfd \
> --disable-werror \
> - --enable-poison-system-directories"
> + --enable-poison-system-directories \
> + ${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default', '', d)}"
Out of curiousity, how well does gold work nowadays? Last I remember hearing of it was in its x86-only days.
regards,
Koen
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH RFC] binutils: allow distro to select gold as default cross-linker
2011-06-14 15:38 ` Koen Kooi
@ 2011-06-15 2:44 ` Khem Raj
2011-06-15 8:04 ` Phil Blundell
1 sibling, 0 replies; 13+ messages in thread
From: Khem Raj @ 2011-06-15 2:44 UTC (permalink / raw)
To: openembedded-core
On 06/14/2011 08:38 AM, Koen Kooi wrote:
>
> Op 14 jun 2011, om 17:30 heeft Phil Blundell het volgende geschreven:
>
>> This is not particularly pretty but I couldn't think of any obviously
>> better way of doing it. Any suggestions?
>>
>> Signed-off-by: Phil Blundell<philb@gnu.org>
>> ---
>> meta/recipes-devtools/binutils/binutils-cross.inc | 3 ++-
>> 1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/meta/recipes-devtools/binutils/binutils-cross.inc b/meta/recipes-devtools/binutils/binutils-cross.inc
>> index 4b90972..5a41970 100644
>> --- a/meta/recipes-devtools/binutils/binutils-cross.inc
>> +++ b/meta/recipes-devtools/binutils/binutils-cross.inc
>> @@ -5,7 +5,8 @@ EXTRA_OECONF = "--with-sysroot=${STAGING_DIR_TARGET} \
>> --program-prefix=${TARGET_PREFIX} \
>> --disable-install-libbfd \
>> --disable-werror \
>> - --enable-poison-system-directories"
>> + --enable-poison-system-directories \
>> + ${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default', '', d)}"
>
> Out of curiousity, how well does gold work nowadays? Last I remember hearing of it was in its x86-only days.
>
it works well on arm in fact link times are way better on some
(especially C++) applications using gold. We can try to use gold for
x86, x86_64 and arm to start with.
> regards,
>
> Koen
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH RFC] binutils: allow distro to select gold as default cross-linker
2011-06-14 15:38 ` Koen Kooi
2011-06-15 2:44 ` Khem Raj
@ 2011-06-15 8:04 ` Phil Blundell
2011-06-15 14:32 ` Phil Blundell
1 sibling, 1 reply; 13+ messages in thread
From: Phil Blundell @ 2011-06-15 8:04 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Tue, 2011-06-14 at 17:38 +0200, Koen Kooi wrote:
> Out of curiousity, how well does gold work nowadays? Last I remember hearing of it was in its x86-only days.
It works for arm, x86 and amd64 which are the only targets that I've
tried for myself. I suspect it doesn't support some of the more obscure
architectures. Obviously it doesn't (and isn't intended to) support non
ELF targets, though I can't think of any such in OE.
One slightly annoying thing is that (e)glibc isn't buildable with gold
because the linker scripts don't work. So a little bit of patching is
going to be needed to have it use ld.bfd there. There might be some
other packages with similar issues but I haven't come across any yet.
p.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH RFC] binutils: allow distro to select gold as default cross-linker
2011-06-15 8:04 ` Phil Blundell
@ 2011-06-15 14:32 ` Phil Blundell
2011-06-15 16:26 ` Khem Raj
0 siblings, 1 reply; 13+ messages in thread
From: Phil Blundell @ 2011-06-15 14:32 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Wed, 2011-06-15 at 09:04 +0100, Phil Blundell wrote:
> One slightly annoying thing is that (e)glibc isn't buildable with gold
> because the linker scripts don't work. So a little bit of patching is
> going to be needed to have it use ld.bfd there. There might be some
> other packages with similar issues but I haven't come across any yet.
I think something like this is probably what's required for that.
From 48eaba1da89086b8edccaa03c27075d78635ab01 Mon Sep 17 00:00:00 2001
From: Phil Blundell <philb@gnu.org>
Date: Wed, 15 Jun 2011 15:22:47 +0100
Subject: [PATCH] gcc-cross-intermediate: use ld.bfd if distro prefers gold
Signed-off-by: Phil Blundell <philb@gnu.org>
---
.../gcc/gcc-cross-intermediate.inc | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc b/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc
index 92c3ce2..05b5dbc 100644
--- a/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc
+++ b/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc
@@ -7,6 +7,10 @@ CROSS_TARGET_SYS_DIR_append = ".${PN}"
# This is intended to be a -very- basic config
# sysroot is needed in case we use libc-initial
+#
+# Glibc won't compile with gold, and building glibc is the whole point of
+# this recipe. So we select ld.bfd explicitly here if gold is the distro's
+# preferred linker.
EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${target_prefix} \
--enable-shared \
--disable-multilib \
@@ -17,7 +21,8 @@ EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${target_prefix} \
--with-sysroot=${STAGING_DIR_TCBOOTSTRAP} \
--with-build-sysroot=${STAGING_DIR_TCBOOTSTRAP} \
${EXTRA_OECONF_INTERMEDIATE} \
- ${@get_gcc_fpu_setting(bb, d)}"
+ ${@get_gcc_fpu_setting(bb, d)} \
+ ${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '--with-ld=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}ld.bfd', '', d)}"
do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_HOST} ${SYSROOT_DESTDIR}/${STAGING_DIR_TARGET}/${target_base_libdir}"
do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_HOST} ${STAGING_DIR_TCBOOTSTRAP}/${target_base_libdir}"
--
1.7.2.5
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH RFC] binutils: allow distro to select gold as default cross-linker
2011-06-15 14:32 ` Phil Blundell
@ 2011-06-15 16:26 ` Khem Raj
2011-06-15 16:31 ` Phil Blundell
0 siblings, 1 reply; 13+ messages in thread
From: Khem Raj @ 2011-06-15 16:26 UTC (permalink / raw)
To: openembedded-core
On 06/15/2011 07:32 AM, Phil Blundell wrote:
> On Wed, 2011-06-15 at 09:04 +0100, Phil Blundell wrote:
>> One slightly annoying thing is that (e)glibc isn't buildable with gold
>> because the linker scripts don't work. So a little bit of patching is
>> going to be needed to have it use ld.bfd there. There might be some
>> other packages with similar issues but I haven't come across any yet.
>
> I think something like this is probably what's required for that.
>
> From 48eaba1da89086b8edccaa03c27075d78635ab01 Mon Sep 17 00:00:00 2001
> From: Phil Blundell<philb@gnu.org>
> Date: Wed, 15 Jun 2011 15:22:47 +0100
> Subject: [PATCH] gcc-cross-intermediate: use ld.bfd if distro prefers gold
>
>
> Signed-off-by: Phil Blundell<philb@gnu.org>
> ---
> .../gcc/gcc-cross-intermediate.inc | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc b/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc
> index 92c3ce2..05b5dbc 100644
> --- a/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc
> +++ b/meta/recipes-devtools/gcc/gcc-cross-intermediate.inc
> @@ -7,6 +7,10 @@ CROSS_TARGET_SYS_DIR_append = ".${PN}"
>
> # This is intended to be a -very- basic config
> # sysroot is needed in case we use libc-initial
> +#
> +# Glibc won't compile with gold, and building glibc is the whole point of
> +# this recipe. So we select ld.bfd explicitly here if gold is the distro's
> +# preferred linker.
> EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${target_prefix} \
> --enable-shared \
> --disable-multilib \
> @@ -17,7 +21,8 @@ EXTRA_OECONF = "--with-local-prefix=${STAGING_DIR_TARGET}${target_prefix} \
> --with-sysroot=${STAGING_DIR_TCBOOTSTRAP} \
> --with-build-sysroot=${STAGING_DIR_TCBOOTSTRAP} \
> ${EXTRA_OECONF_INTERMEDIATE} \
> - ${@get_gcc_fpu_setting(bb, d)}"
> + ${@get_gcc_fpu_setting(bb, d)} \
> + ${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '--with-ld=${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX}ld.bfd', '', d)}"
>
> do_populate_sysroot[sstate-inputdirs] = "${SYSROOT_DESTDIR}/${STAGING_DIR_HOST} ${SYSROOT_DESTDIR}/${STAGING_DIR_TARGET}/${target_base_libdir}"
> do_populate_sysroot[sstate-outputdirs] = "${STAGING_DIR_HOST} ${STAGING_DIR_TCBOOTSTRAP}/${target_base_libdir}"
this might not work second time around when gcc-cross has been staged.
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH RFC] binutils: allow distro to select gold as default cross-linker
2011-06-15 16:26 ` Khem Raj
@ 2011-06-15 16:31 ` Phil Blundell
2011-06-15 16:35 ` Khem Raj
0 siblings, 1 reply; 13+ messages in thread
From: Phil Blundell @ 2011-06-15 16:31 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Wed, 2011-06-15 at 09:26 -0700, Khem Raj wrote:
> this might not work second time around when gcc-cross has been staged.
Oh, I thought that mess was fixed nowadays. Doesn't eglibc always use
the -intermediate compiler from the special tcbootstrap place?
If it's just picking whatever was staged most recently then yeah, this
will lose.
p.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH RFC] binutils: allow distro to select gold as default cross-linker
2011-06-15 16:31 ` Phil Blundell
@ 2011-06-15 16:35 ` Khem Raj
2011-06-15 16:42 ` Phil Blundell
0 siblings, 1 reply; 13+ messages in thread
From: Khem Raj @ 2011-06-15 16:35 UTC (permalink / raw)
To: openembedded-core
On 06/15/2011 09:31 AM, Phil Blundell wrote:
> On Wed, 2011-06-15 at 09:26 -0700, Khem Raj wrote:
>> this might not work second time around when gcc-cross has been staged.
>
> Oh, I thought that mess was fixed nowadays. Doesn't eglibc always use
> the -intermediate compiler from the special tcbootstrap place?
>
> If it's just picking whatever was staged most recently then yeah, this
> will lose.
>
ah I stand corrected.
STAGINGCC = "gcc-cross-intermediate"
PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
so yes it uses gcc-cross-intermediate all the time.
This will work. Do you know what problems eglibc has linking with gold ?
may be we can fix it
> p.
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH RFC] binutils: allow distro to select gold as default cross-linker
2011-06-15 16:35 ` Khem Raj
@ 2011-06-15 16:42 ` Phil Blundell
2011-06-15 16:47 ` Khem Raj
0 siblings, 1 reply; 13+ messages in thread
From: Phil Blundell @ 2011-06-15 16:42 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Wed, 2011-06-15 at 09:35 -0700, Khem Raj wrote:
> This will work. Do you know what problems eglibc has linking with gold ?
> may be we can fix it
If I remember right, it relies on linker script functionality which gold
just doesn't have. I suspect this would be hard to fix and, unless
there is a pressing need to fight that particular battle, I would be
inclined not to bother.
That said, though, I haven't checked recently and it's possible that
recent versions of gold will "just work". If you wanted to give it a
try then I think it'd just be a question of h4x0ring eglibc's configure
script slightly to get it to accept gold as a valid linker version.
p.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH RFC] binutils: allow distro to select gold as default cross-linker
2011-06-15 16:42 ` Phil Blundell
@ 2011-06-15 16:47 ` Khem Raj
2011-06-15 16:50 ` Phil Blundell
0 siblings, 1 reply; 13+ messages in thread
From: Khem Raj @ 2011-06-15 16:47 UTC (permalink / raw)
To: openembedded-core
On 06/15/2011 09:42 AM, Phil Blundell wrote:
> On Wed, 2011-06-15 at 09:35 -0700, Khem Raj wrote:
>> This will work. Do you know what problems eglibc has linking with gold ?
>> may be we can fix it
>
> If I remember right, it relies on linker script functionality which gold
> just doesn't have. I suspect this would be hard to fix and, unless
> there is a pressing need to fight that particular battle, I would be
> inclined not to bother.
>
> That said, though, I haven't checked recently and it's possible that
> recent versions of gold will "just work". If you wanted to give it a
> try then I think it'd just be a question of h4x0ring eglibc's configure
> script slightly to get it to accept gold as a valid linker version.
>
I remember now. Accepting gold would be easier but changing how ld.so is
built where it asks ld to spit out default linker script and then munge
it before reusing it is harder part. I think status is still same. It
reminds me that we probably need ld.bfd for kernel too.
> p.
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH RFC] binutils: allow distro to select gold as default cross-linker
2011-06-14 15:30 [PATCH RFC] binutils: allow distro to select gold as default cross-linker Phil Blundell
2011-06-14 15:38 ` Koen Kooi
@ 2011-06-15 2:42 ` Khem Raj
2011-06-15 11:30 ` Phil Blundell
1 sibling, 1 reply; 13+ messages in thread
From: Khem Raj @ 2011-06-15 2:42 UTC (permalink / raw)
To: openembedded-core
On 06/14/2011 08:30 AM, Phil Blundell wrote:
> This is not particularly pretty but I couldn't think of any obviously
> better way of doing it. Any suggestions?
>
> Signed-off-by: Phil Blundell<philb@gnu.org>
> ---
> meta/recipes-devtools/binutils/binutils-cross.inc | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/meta/recipes-devtools/binutils/binutils-cross.inc b/meta/recipes-devtools/binutils/binutils-cross.inc
> index 4b90972..5a41970 100644
> --- a/meta/recipes-devtools/binutils/binutils-cross.inc
> +++ b/meta/recipes-devtools/binutils/binutils-cross.inc
> @@ -5,7 +5,8 @@ EXTRA_OECONF = "--with-sysroot=${STAGING_DIR_TARGET} \
> --program-prefix=${TARGET_PREFIX} \
> --disable-install-libbfd \
> --disable-werror \
> - --enable-poison-system-directories"
> + --enable-poison-system-directories \
> + ${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default', '', d)}"
>
> do_install () {
> oe_runmake 'DESTDIR=${D}' install
I think we need to document this distro feature somewhere as well. We
need the same for target binutils too.
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH RFC] binutils: allow distro to select gold as default cross-linker
2011-06-15 2:42 ` Khem Raj
@ 2011-06-15 11:30 ` Phil Blundell
0 siblings, 0 replies; 13+ messages in thread
From: Phil Blundell @ 2011-06-15 11:30 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Tue, 2011-06-14 at 19:42 -0700, Khem Raj wrote:
> I think we need to document this distro feature somewhere as well.
Yeah, agreed. Any suggestions for "somewhere"? Traditionally this kind
of thing has been sort-of-documented in local.conf.sample{.extended} but
that doesn't seem like a terribly good model for the future.
If the wiki were ever to become editable then I guess a page there might
be a good place, perhaps.
>We need the same for target binutils too.
Yeah, though it wants slightly different handling in the target case. I
was planning to leave that for someone who actually uses on-target
binutils to sort out :-)
There's also the sdk case which I haven't looked at either. I'm not
sure to what extent that needs special handling.
p.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2011-06-15 16:53 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-14 15:30 [PATCH RFC] binutils: allow distro to select gold as default cross-linker Phil Blundell
2011-06-14 15:38 ` Koen Kooi
2011-06-15 2:44 ` Khem Raj
2011-06-15 8:04 ` Phil Blundell
2011-06-15 14:32 ` Phil Blundell
2011-06-15 16:26 ` Khem Raj
2011-06-15 16:31 ` Phil Blundell
2011-06-15 16:35 ` Khem Raj
2011-06-15 16:42 ` Phil Blundell
2011-06-15 16:47 ` Khem Raj
2011-06-15 16:50 ` Phil Blundell
2011-06-15 2:42 ` Khem Raj
2011-06-15 11:30 ` Phil Blundell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox