* [PATCH 0/2] Use alternatives for all of binutils instead of -symlinks
@ 2013-10-10 20:06 Peter Seebach
2013-10-10 20:06 ` [PATCH 1/2] Use alternatives for the binutils-symlinks package Peter Seebach
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Peter Seebach @ 2013-10-10 20:06 UTC (permalink / raw)
To: OE-core
The original complaint that got me started on this was that someone
was using binutils on a target, and didn't have an ld command, so they
asked for it. We added binutils-symlinks, and that seemed to work, but
eventually we ran into a problem because "ar" and "strings" weren't
showing up.
After some asking about as to why ar and strings might be omitted from
binutils, we concluded that it was probably because they were using
the alternatives mechanism. In a local branch, we experimented for a while
with just using that instead of the -symlinks package, and found that
it was overall better-behaved; in particular, it produces the desireable
result that you don't have to know about or add a "-symlinks" package
to use the utilities in the common case where you just install a package
and expect its binaries to show up. It also eliminates the odd special
case difference between ar/strings (which can be provided by busybox)
and the other utilities.
This is implemented as two patches. The first switches to using the
alternatives mechanism, but leaves the alternatives in the -symlinks
package rather than in the base package. The second moves them into
the base package, and adds an RPROVIDES for the -symlinks name in
case anyone is using it.
One caveat: This can produce warnings because the "embedspu" and "ld.gold"
binaries don't always exist, but they sometimes exist. I'm not sure whether
there's a good way to fix that...
The following changes since commit 1149b1fef8912f77d971242dfec151fff5a3aa51:
build-appliance: Update SRCREV for release (2013-10-08 16:33:25 +0100)
are available in the git repository at:
git://git.yoctoproject.org/poky-contrib seebs/binutils-alternatives
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=seebs/binutils-alternatives
Peter Seebach (2):
Use alternatives for the binutils-symlinks package.
Drop binutils-symlinks
meta/recipes-devtools/binutils/binutils.inc | 68 ++++++++++++++++-----------
1 files changed, 40 insertions(+), 28 deletions(-)
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH 1/2] Use alternatives for the binutils-symlinks package. 2013-10-10 20:06 [PATCH 0/2] Use alternatives for all of binutils instead of -symlinks Peter Seebach @ 2013-10-10 20:06 ` Peter Seebach 2013-10-10 20:06 ` [PATCH 2/2] Drop binutils-symlinks Peter Seebach 2013-10-16 16:48 ` [PATCH 0/2] Use alternatives for all of binutils instead of -symlinks Saul Wold 2 siblings, 0 replies; 11+ messages in thread From: Peter Seebach @ 2013-10-10 20:06 UTC (permalink / raw) To: OE-core The ar and strings utilities are provided as alternatives, but the rest of binutils is being done with binutils-symlinks. This has the side effect that if you want "as", and you install binutils-symlinks to get it, you don't get "ar" from it, because it's not in the symlinks package. Solution: Use the same mechanisms for everything, putting everything in ALTERNATIVES, so installing binutils on a target produces the expected behavior of having the various utilities in place. Issues: The "embedspu" and "ld.gold" binaries may or may not exist, but the determination of whether to list them as alternatives is being made before the point at which we can easily check for them, so that can produce warnings. Signed-off-by: Peter Seebach <peter.seebach@windriver.com> --- meta/recipes-devtools/binutils/binutils.inc | 69 +++++++++++++++++---------- 1 files changed, 43 insertions(+), 26 deletions(-) diff --git a/meta/recipes-devtools/binutils/binutils.inc b/meta/recipes-devtools/binutils/binutils.inc index 5e78dc0..1c7ffcf 100644 --- a/meta/recipes-devtools/binutils/binutils.inc +++ b/meta/recipes-devtools/binutils/binutils.inc @@ -22,31 +22,51 @@ FILES_${PN} = " \ ${libdir}/lib*-*.so \ ${prefix}/${TARGET_SYS}/bin/*" +# Use alternatives rather than actual symlinks. +FILES_${PN}-symlinks = "" + +ALLOW_EMPTY_${PN}-symlinks = "1" + FILES_${PN}-dev = " \ ${includedir} \ ${libdir}/*.la \ ${libdir}/libbfd.so \ ${libdir}/libopcodes.so" -FILES_${PN}-symlinks = " \ - ${bindir}/addr2line \ - ${bindir}/as \ - ${bindir}/c++filt \ - ${bindir}/embedspu \ - ${bindir}/gprof \ - ${bindir}/ld \ - ${bindir}/ld.bfd \ - ${bindir}/ld.gold \ - ${bindir}/nm \ - ${bindir}/objcopy \ - ${bindir}/objdump \ - ${bindir}/ranlib \ - ${bindir}/readelf \ - ${bindir}/elfedit \ - ${bindir}/size \ - ${bindir}/strip" - -FILES_${PN}-dbg += "${prefix}/${TARGET_SYS}/bin/.debug" +# Rather than duplicating multiple entries for these, make one +# list and reuse it. + +USE_ALTERNATIVES_FOR = " \ + addr2line \ + ar \ + as \ + c++filt \ + elfedit \ + embedspu \ + gprof \ + ld \ + ld.bfd \ + ld.gold \ + nm \ + objcopy \ + objdump \ + ranlib \ + readelf \ + size \ + strings \ + strip \ +" + +python do_package_prepend() { + make_alts = d.getVar("USE_ALTERNATIVES_FOR", True) or "" + prefix = d.getVar("TARGET_PREFIX", True) + bindir = d.getVar("bindir", True) + for alt in make_alts.split(): + d.setVarFlag('ALTERNATIVE_TARGET', alt, bindir + "/" + prefix + alt) + d.setVarFlag('ALTERNATIVE_LINK_NAME', alt, bindir + "/" + alt) +} + +# FILES_${PN}-dbg = "${prefix}/${TARGET_SYS}/bin/.debug ${prefix}/${libdir}/.debug" B = "${S}/build.${HOST_SYS}.${TARGET_SYS}" @@ -120,7 +140,9 @@ do_install () { ln -sf $p `echo $p | sed -e s,${TARGET_PREFIX},,` done - rm -f ${D}${bindir}/ar ${D}${bindir}/strings + for alt in ${USE_ALTERNATIVES_FOR}; do + rm -f ${D}${bindir}/$alt + done oe_multilib_header bfd.h } @@ -129,10 +151,5 @@ inherit update-alternatives ALTERNATIVE_PRIORITY = "100" -ALTERNATIVE_${PN}-symlinks = "ar strings" - -ALTERNATIVE_LINK_NAME[ar] = "${bindir}/ar" -ALTERNATIVE_TARGET[ar] = "${bindir}/${TARGET_PREFIX}ar" +ALTERNATIVE_${PN}-symlinks = "${USE_ALTERNATIVES_FOR}" -ALTERNATIVE_LINK_NAME[strings] = "${bindir}/strings" -ALTERNATIVE_TARGET[strings] = "${bindir}/${TARGET_PREFIX}strings" -- 1.7.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH 2/2] Drop binutils-symlinks 2013-10-10 20:06 [PATCH 0/2] Use alternatives for all of binutils instead of -symlinks Peter Seebach 2013-10-10 20:06 ` [PATCH 1/2] Use alternatives for the binutils-symlinks package Peter Seebach @ 2013-10-10 20:06 ` Peter Seebach 2013-10-16 16:48 ` [PATCH 0/2] Use alternatives for all of binutils instead of -symlinks Saul Wold 2 siblings, 0 replies; 11+ messages in thread From: Peter Seebach @ 2013-10-10 20:06 UTC (permalink / raw) To: OE-core The -symlinks package doesn't really add any value if we're using update-alternatives. Drop it, leaving a spare RPROVIDES in case anyone thought they needed it. Signed-off-by: Peter Seebach <peter.seebach@windriver.com> --- meta/recipes-devtools/binutils/binutils.inc | 9 ++------- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/meta/recipes-devtools/binutils/binutils.inc b/meta/recipes-devtools/binutils/binutils.inc index 1c7ffcf..7657a87 100644 --- a/meta/recipes-devtools/binutils/binutils.inc +++ b/meta/recipes-devtools/binutils/binutils.inc @@ -15,17 +15,12 @@ DEPENDS = "flex-native bison-native zlib-native" inherit autotools gettext multilib_header -PACKAGES += "${PN}-symlinks" - FILES_${PN} = " \ ${bindir}/${TARGET_PREFIX}* \ ${libdir}/lib*-*.so \ ${prefix}/${TARGET_SYS}/bin/*" -# Use alternatives rather than actual symlinks. -FILES_${PN}-symlinks = "" - -ALLOW_EMPTY_${PN}-symlinks = "1" +RPROVIDES_${PN} += "${PN}-symlinks" FILES_${PN}-dev = " \ ${includedir} \ @@ -151,5 +146,5 @@ inherit update-alternatives ALTERNATIVE_PRIORITY = "100" -ALTERNATIVE_${PN}-symlinks = "${USE_ALTERNATIVES_FOR}" +ALTERNATIVE_${PN} = "${USE_ALTERNATIVES_FOR}" -- 1.7.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 0/2] Use alternatives for all of binutils instead of -symlinks 2013-10-10 20:06 [PATCH 0/2] Use alternatives for all of binutils instead of -symlinks Peter Seebach 2013-10-10 20:06 ` [PATCH 1/2] Use alternatives for the binutils-symlinks package Peter Seebach 2013-10-10 20:06 ` [PATCH 2/2] Drop binutils-symlinks Peter Seebach @ 2013-10-16 16:48 ` Saul Wold 2013-10-16 19:18 ` Mark Hatle 2013-10-18 23:24 ` [PATCH 0/2] v2: Use alternatives for binutils Peter Seebach 2 siblings, 2 replies; 11+ messages in thread From: Saul Wold @ 2013-10-16 16:48 UTC (permalink / raw) To: Peter Seebach; +Cc: OE-core During MUT builds, we saw a failure with the toolchain | Computing transaction...error: Can't install binutils-cross-canadian-arm-2.23.2-r4@i686_nativesdk: no package provides update-alternatives-cworth | Can be seen all architectures. Sau! On 10/10/2013 01:06 PM, Peter Seebach wrote: > The original complaint that got me started on this was that someone > was using binutils on a target, and didn't have an ld command, so they > asked for it. We added binutils-symlinks, and that seemed to work, but > eventually we ran into a problem because "ar" and "strings" weren't > showing up. > > After some asking about as to why ar and strings might be omitted from > binutils, we concluded that it was probably because they were using > the alternatives mechanism. In a local branch, we experimented for a while > with just using that instead of the -symlinks package, and found that > it was overall better-behaved; in particular, it produces the desireable > result that you don't have to know about or add a "-symlinks" package > to use the utilities in the common case where you just install a package > and expect its binaries to show up. It also eliminates the odd special > case difference between ar/strings (which can be provided by busybox) > and the other utilities. > > This is implemented as two patches. The first switches to using the > alternatives mechanism, but leaves the alternatives in the -symlinks > package rather than in the base package. The second moves them into > the base package, and adds an RPROVIDES for the -symlinks name in > case anyone is using it. > > One caveat: This can produce warnings because the "embedspu" and "ld.gold" > binaries don't always exist, but they sometimes exist. I'm not sure whether > there's a good way to fix that... > > The following changes since commit 1149b1fef8912f77d971242dfec151fff5a3aa51: > > build-appliance: Update SRCREV for release (2013-10-08 16:33:25 +0100) > > are available in the git repository at: > git://git.yoctoproject.org/poky-contrib seebs/binutils-alternatives > http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=seebs/binutils-alternatives > > Peter Seebach (2): > Use alternatives for the binutils-symlinks package. > Drop binutils-symlinks > > meta/recipes-devtools/binutils/binutils.inc | 68 ++++++++++++++++----------- > 1 files changed, 40 insertions(+), 28 deletions(-) > > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core > > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 0/2] Use alternatives for all of binutils instead of -symlinks 2013-10-16 16:48 ` [PATCH 0/2] Use alternatives for all of binutils instead of -symlinks Saul Wold @ 2013-10-16 19:18 ` Mark Hatle 2013-10-18 23:24 ` [PATCH 0/2] v2: Use alternatives for binutils Peter Seebach 1 sibling, 0 replies; 11+ messages in thread From: Mark Hatle @ 2013-10-16 19:18 UTC (permalink / raw) To: openembedded-core, Seebach, Peter On 10/16/13 11:48 AM, Saul Wold wrote: > > During MUT builds, we saw a failure with the toolchain > > > | Computing transaction...error: Can't install > binutils-cross-canadian-arm-2.23.2-r4@i686_nativesdk: no package > provides update-alternatives-cworth > | > > Can be seen all architectures. Sounds like the new code needs to be restricted to 'class-target'. --Mark > > Sau! > > > > On 10/10/2013 01:06 PM, Peter Seebach wrote: >> The original complaint that got me started on this was that someone >> was using binutils on a target, and didn't have an ld command, so they >> asked for it. We added binutils-symlinks, and that seemed to work, but >> eventually we ran into a problem because "ar" and "strings" weren't >> showing up. >> >> After some asking about as to why ar and strings might be omitted from >> binutils, we concluded that it was probably because they were using >> the alternatives mechanism. In a local branch, we experimented for a while >> with just using that instead of the -symlinks package, and found that >> it was overall better-behaved; in particular, it produces the desireable >> result that you don't have to know about or add a "-symlinks" package >> to use the utilities in the common case where you just install a package >> and expect its binaries to show up. It also eliminates the odd special >> case difference between ar/strings (which can be provided by busybox) >> and the other utilities. >> >> This is implemented as two patches. The first switches to using the >> alternatives mechanism, but leaves the alternatives in the -symlinks >> package rather than in the base package. The second moves them into >> the base package, and adds an RPROVIDES for the -symlinks name in >> case anyone is using it. >> >> One caveat: This can produce warnings because the "embedspu" and "ld.gold" >> binaries don't always exist, but they sometimes exist. I'm not sure whether >> there's a good way to fix that... >> >> The following changes since commit 1149b1fef8912f77d971242dfec151fff5a3aa51: >> >> build-appliance: Update SRCREV for release (2013-10-08 16:33:25 +0100) >> >> are available in the git repository at: >> git://git.yoctoproject.org/poky-contrib seebs/binutils-alternatives >> http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=seebs/binutils-alternatives >> >> Peter Seebach (2): >> Use alternatives for the binutils-symlinks package. >> Drop binutils-symlinks >> >> meta/recipes-devtools/binutils/binutils.inc | 68 ++++++++++++++++----------- >> 1 files changed, 40 insertions(+), 28 deletions(-) >> >> _______________________________________________ >> Openembedded-core mailing list >> Openembedded-core@lists.openembedded.org >> http://lists.openembedded.org/mailman/listinfo/openembedded-core >> >> > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > http://lists.openembedded.org/mailman/listinfo/openembedded-core > ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 0/2] v2: Use alternatives for binutils 2013-10-16 16:48 ` [PATCH 0/2] Use alternatives for all of binutils instead of -symlinks Saul Wold 2013-10-16 19:18 ` Mark Hatle @ 2013-10-18 23:24 ` Peter Seebach 2013-10-18 23:24 ` [PATCH 1/2] Use alternatives for the binutils-symlinks package Peter Seebach 2013-10-18 23:24 ` [PATCH 2/2] Drop binutils-symlinks Peter Seebach 1 sibling, 2 replies; 11+ messages in thread From: Peter Seebach @ 2013-10-18 23:24 UTC (permalink / raw) To: OE-core This is a rework of a previous patch to use alternatives consistently for all of binutils instead of relying on symlinks for most things, and alternatives for ar and strings. Changes: 1. Dropped embedspu compltely from the alternatives list. If anyone's actually using Cell processors with oe-core, or something else that needs the ability to embed SPU binaries as ELF objects in binaries for other CPUs, I'm willing to revisit that. 2. Make the selection of ld.bfd or ld.gold contingent on the presence of ld-is-gold in DISTRO_FEATURES. 3. Set the alternatives only for class-target, because otherwise we don't want or need them. This should address failures with cross-canadian builds ("error: Can't install binutils-cross-canadian-arm-2.23.2-r4@i686_nativesdk: no package provides update-alternatives-cworth"), and warnings for the absent embedspu and ld.gold binaries, but should work for people using ld.gold. As before, the purpose of this is mostly a cleanup, because people don't find an "as" binary, so they end up looking around and finding binutils-symlinks, then they notice that binutils-symlinks doesn't have "ar" and "strings". Confusion ensues. The following changes since commit 24a6b1324965080fef6c363edcb37768090eebea: wic: add pseudo to the populate-extfs step (2013-10-18 16:03:36 +0100) are available in the git repository at: git://git.yoctoproject.org/poky-contrib seebs/binutils-alternatives http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=seebs/binutils-alternatives Peter Seebach (2): Use alternatives for the binutils-symlinks package. Drop binutils-symlinks meta/recipes-devtools/binutils/binutils.inc | 67 +++++++++++++++------------ 1 files changed, 38 insertions(+), 29 deletions(-) ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 1/2] Use alternatives for the binutils-symlinks package. 2013-10-18 23:24 ` [PATCH 0/2] v2: Use alternatives for binutils Peter Seebach @ 2013-10-18 23:24 ` Peter Seebach 2013-10-19 5:22 ` Saul Wold 2013-10-18 23:24 ` [PATCH 2/2] Drop binutils-symlinks Peter Seebach 1 sibling, 1 reply; 11+ messages in thread From: Peter Seebach @ 2013-10-18 23:24 UTC (permalink / raw) To: OE-core The ar and strings utilities are provided as alternatives, but the rest of binutils is being done with binutils-symlinks. This has the side effect that if you want "as", and you install binutils-symlinks to get it, you don't get "ar" from it, because it's not in the symlinks package. Solution: Use the same mechanisms for everything, putting everything in ALTERNATIVES, so installing binutils on a target produces the expected behavior of having the various utilities in place. (We do this only for class-target, though.) Issues: The "embedspu" and "ld.gold" binaries may or may not exist, but the determination of whether to list them as alternatives is being made before the point at which we can easily check for them, so that can produce warnings. Signed-off-by: Peter Seebach <peter.seebach@windriver.com> --- meta/recipes-devtools/binutils/binutils.inc | 67 ++++++++++++++++---------- 1 files changed, 41 insertions(+), 26 deletions(-) diff --git a/meta/recipes-devtools/binutils/binutils.inc b/meta/recipes-devtools/binutils/binutils.inc index 5e78dc0..eaf20bf 100644 --- a/meta/recipes-devtools/binutils/binutils.inc +++ b/meta/recipes-devtools/binutils/binutils.inc @@ -22,31 +22,49 @@ FILES_${PN} = " \ ${libdir}/lib*-*.so \ ${prefix}/${TARGET_SYS}/bin/*" +# Use alternatives rather than actual symlinks. +FILES_${PN}-symlinks = "" + +ALLOW_EMPTY_${PN}-symlinks = "1" + FILES_${PN}-dev = " \ ${includedir} \ ${libdir}/*.la \ ${libdir}/libbfd.so \ ${libdir}/libopcodes.so" -FILES_${PN}-symlinks = " \ - ${bindir}/addr2line \ - ${bindir}/as \ - ${bindir}/c++filt \ - ${bindir}/embedspu \ - ${bindir}/gprof \ - ${bindir}/ld \ - ${bindir}/ld.bfd \ - ${bindir}/ld.gold \ - ${bindir}/nm \ - ${bindir}/objcopy \ - ${bindir}/objdump \ - ${bindir}/ranlib \ - ${bindir}/readelf \ - ${bindir}/elfedit \ - ${bindir}/size \ - ${bindir}/strip" - -FILES_${PN}-dbg += "${prefix}/${TARGET_SYS}/bin/.debug" +# Rather than duplicating multiple entries for these, make one +# list and reuse it. + +USE_ALTERNATIVES_FOR = " \ + addr2line \ + ar \ + as \ + c++filt \ + elfedit \ + gprof \ + ld \ + ${@base_contains('DISTRO_FEATURES', 'ld-is-gold', 'ld.gold', 'ld.bfd', d)} \ + nm \ + objcopy \ + objdump \ + ranlib \ + readelf \ + size \ + strings \ + strip \ +" + +python do_package_prepend() { + make_alts = d.getVar("USE_ALTERNATIVES_FOR", True) or "" + prefix = d.getVar("TARGET_PREFIX", True) + bindir = d.getVar("bindir", True) + for alt in make_alts.split(): + d.setVarFlag('ALTERNATIVE_TARGET', alt, bindir + "/" + prefix + alt) + d.setVarFlag('ALTERNATIVE_LINK_NAME', alt, bindir + "/" + alt) +} + +# FILES_${PN}-dbg = "${prefix}/${TARGET_SYS}/bin/.debug ${prefix}/${libdir}/.debug" B = "${S}/build.${HOST_SYS}.${TARGET_SYS}" @@ -120,7 +138,9 @@ do_install () { ln -sf $p `echo $p | sed -e s,${TARGET_PREFIX},,` done - rm -f ${D}${bindir}/ar ${D}${bindir}/strings + for alt in ${USE_ALTERNATIVES_FOR}; do + rm -f ${D}${bindir}/$alt + done oe_multilib_header bfd.h } @@ -129,10 +149,5 @@ inherit update-alternatives ALTERNATIVE_PRIORITY = "100" -ALTERNATIVE_${PN}-symlinks = "ar strings" - -ALTERNATIVE_LINK_NAME[ar] = "${bindir}/ar" -ALTERNATIVE_TARGET[ar] = "${bindir}/${TARGET_PREFIX}ar" +ALTERNATIVE_${PN}-symlinks_class-target = "${USE_ALTERNATIVES_FOR}" -ALTERNATIVE_LINK_NAME[strings] = "${bindir}/strings" -ALTERNATIVE_TARGET[strings] = "${bindir}/${TARGET_PREFIX}strings" -- 1.7.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] Use alternatives for the binutils-symlinks package. 2013-10-18 23:24 ` [PATCH 1/2] Use alternatives for the binutils-symlinks package Peter Seebach @ 2013-10-19 5:22 ` Saul Wold 2013-10-21 3:46 ` Peter Seebach 2013-11-04 18:40 ` Peter Seebach 0 siblings, 2 replies; 11+ messages in thread From: Saul Wold @ 2013-10-19 5:22 UTC (permalink / raw) To: Peter Seebach, OE-core Peter, The commit short message needs to be corrected to the binutils: ... format please. I will test this version in MUT. Thanks Sau! On 10/18/2013 04:24 PM, Peter Seebach wrote: > The ar and strings utilities are provided as alternatives, but > the rest of binutils is being done with binutils-symlinks. This > has the side effect that if you want "as", and you install > binutils-symlinks to get it, you don't get "ar" from it, because > it's not in the symlinks package. > > Solution: Use the same mechanisms for everything, putting > everything in ALTERNATIVES, so installing binutils on a target > produces the expected behavior of having the various utilities in place. > (We do this only for class-target, though.) > > Issues: The "embedspu" and "ld.gold" binaries may or may not exist, > but the determination of whether to list them as alternatives is > being made before the point at which we can easily check for them, > so that can produce warnings. > > Signed-off-by: Peter Seebach <peter.seebach@windriver.com> > --- > meta/recipes-devtools/binutils/binutils.inc | 67 ++++++++++++++++---------- > 1 files changed, 41 insertions(+), 26 deletions(-) > > diff --git a/meta/recipes-devtools/binutils/binutils.inc b/meta/recipes-devtools/binutils/binutils.inc > index 5e78dc0..eaf20bf 100644 > --- a/meta/recipes-devtools/binutils/binutils.inc > +++ b/meta/recipes-devtools/binutils/binutils.inc > @@ -22,31 +22,49 @@ FILES_${PN} = " \ > ${libdir}/lib*-*.so \ > ${prefix}/${TARGET_SYS}/bin/*" > > +# Use alternatives rather than actual symlinks. > +FILES_${PN}-symlinks = "" > + > +ALLOW_EMPTY_${PN}-symlinks = "1" > + > FILES_${PN}-dev = " \ > ${includedir} \ > ${libdir}/*.la \ > ${libdir}/libbfd.so \ > ${libdir}/libopcodes.so" > > -FILES_${PN}-symlinks = " \ > - ${bindir}/addr2line \ > - ${bindir}/as \ > - ${bindir}/c++filt \ > - ${bindir}/embedspu \ > - ${bindir}/gprof \ > - ${bindir}/ld \ > - ${bindir}/ld.bfd \ > - ${bindir}/ld.gold \ > - ${bindir}/nm \ > - ${bindir}/objcopy \ > - ${bindir}/objdump \ > - ${bindir}/ranlib \ > - ${bindir}/readelf \ > - ${bindir}/elfedit \ > - ${bindir}/size \ > - ${bindir}/strip" > - > -FILES_${PN}-dbg += "${prefix}/${TARGET_SYS}/bin/.debug" > +# Rather than duplicating multiple entries for these, make one > +# list and reuse it. > + > +USE_ALTERNATIVES_FOR = " \ > + addr2line \ > + ar \ > + as \ > + c++filt \ > + elfedit \ > + gprof \ > + ld \ > + ${@base_contains('DISTRO_FEATURES', 'ld-is-gold', 'ld.gold', 'ld.bfd', d)} \ > + nm \ > + objcopy \ > + objdump \ > + ranlib \ > + readelf \ > + size \ > + strings \ > + strip \ > +" > + > +python do_package_prepend() { > + make_alts = d.getVar("USE_ALTERNATIVES_FOR", True) or "" > + prefix = d.getVar("TARGET_PREFIX", True) > + bindir = d.getVar("bindir", True) > + for alt in make_alts.split(): > + d.setVarFlag('ALTERNATIVE_TARGET', alt, bindir + "/" + prefix + alt) > + d.setVarFlag('ALTERNATIVE_LINK_NAME', alt, bindir + "/" + alt) > +} > + > +# FILES_${PN}-dbg = "${prefix}/${TARGET_SYS}/bin/.debug ${prefix}/${libdir}/.debug" > > B = "${S}/build.${HOST_SYS}.${TARGET_SYS}" > > @@ -120,7 +138,9 @@ do_install () { > ln -sf $p `echo $p | sed -e s,${TARGET_PREFIX},,` > done > > - rm -f ${D}${bindir}/ar ${D}${bindir}/strings > + for alt in ${USE_ALTERNATIVES_FOR}; do > + rm -f ${D}${bindir}/$alt > + done > > oe_multilib_header bfd.h > } > @@ -129,10 +149,5 @@ inherit update-alternatives > > ALTERNATIVE_PRIORITY = "100" > > -ALTERNATIVE_${PN}-symlinks = "ar strings" > - > -ALTERNATIVE_LINK_NAME[ar] = "${bindir}/ar" > -ALTERNATIVE_TARGET[ar] = "${bindir}/${TARGET_PREFIX}ar" > +ALTERNATIVE_${PN}-symlinks_class-target = "${USE_ALTERNATIVES_FOR}" > > -ALTERNATIVE_LINK_NAME[strings] = "${bindir}/strings" > -ALTERNATIVE_TARGET[strings] = "${bindir}/${TARGET_PREFIX}strings" > ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] Use alternatives for the binutils-symlinks package. 2013-10-19 5:22 ` Saul Wold @ 2013-10-21 3:46 ` Peter Seebach 2013-11-04 18:40 ` Peter Seebach 1 sibling, 0 replies; 11+ messages in thread From: Peter Seebach @ 2013-10-21 3:46 UTC (permalink / raw) To: Saul Wold; +Cc: OE-core On Fri, 18 Oct 2013 22:22:40 -0700 Saul Wold <sgw@linux.intel.com> wrote: > The commit short message needs to be corrected to the binutils: ... > format please. Okay. Also, fray points out that I appear to have converted tabs to spaces in some shell code. I'll try to fix this in the next day or so. -s -- Listen, get this. Nobody with a good compiler needs to be justified. ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 1/2] Use alternatives for the binutils-symlinks package. 2013-10-19 5:22 ` Saul Wold 2013-10-21 3:46 ` Peter Seebach @ 2013-11-04 18:40 ` Peter Seebach 1 sibling, 0 replies; 11+ messages in thread From: Peter Seebach @ 2013-11-04 18:40 UTC (permalink / raw) To: Saul Wold; +Cc: OE-core On Fri, 18 Oct 2013 22:22:40 -0700 Saul Wold <sgw@linux.intel.com> wrote: > The commit short message needs to be corrected to the binutils: ... > format please. Okay, corrected the commit message, also fixed a space/tab issue in the binutils.inc patch. -s -- Listen, get this. Nobody with a good compiler needs to be justified. ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH 2/2] Drop binutils-symlinks 2013-10-18 23:24 ` [PATCH 0/2] v2: Use alternatives for binutils Peter Seebach 2013-10-18 23:24 ` [PATCH 1/2] Use alternatives for the binutils-symlinks package Peter Seebach @ 2013-10-18 23:24 ` Peter Seebach 1 sibling, 0 replies; 11+ messages in thread From: Peter Seebach @ 2013-10-18 23:24 UTC (permalink / raw) To: OE-core The -symlinks package doesn't really add any value if we're using update-alternatives. Drop it, leaving a spare RPROVIDES in case anyone thought they needed it. Signed-off-by: Peter Seebach <peter.seebach@windriver.com> --- meta/recipes-devtools/binutils/binutils.inc | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/meta/recipes-devtools/binutils/binutils.inc b/meta/recipes-devtools/binutils/binutils.inc index eaf20bf..d38c3fe 100644 --- a/meta/recipes-devtools/binutils/binutils.inc +++ b/meta/recipes-devtools/binutils/binutils.inc @@ -15,17 +15,12 @@ DEPENDS = "flex-native bison-native zlib-native" inherit autotools gettext multilib_header -PACKAGES += "${PN}-symlinks" - FILES_${PN} = " \ ${bindir}/${TARGET_PREFIX}* \ ${libdir}/lib*-*.so \ ${prefix}/${TARGET_SYS}/bin/*" -# Use alternatives rather than actual symlinks. -FILES_${PN}-symlinks = "" - -ALLOW_EMPTY_${PN}-symlinks = "1" +RPROVIDES_${PN} += "${PN}-symlinks" FILES_${PN}-dev = " \ ${includedir} \ @@ -149,5 +144,4 @@ inherit update-alternatives ALTERNATIVE_PRIORITY = "100" -ALTERNATIVE_${PN}-symlinks_class-target = "${USE_ALTERNATIVES_FOR}" - +ALTERNATIVE_${PN}_class-target = "${USE_ALTERNATIVES_FOR}" -- 1.7.1 ^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2013-11-04 18:40 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-10-10 20:06 [PATCH 0/2] Use alternatives for all of binutils instead of -symlinks Peter Seebach 2013-10-10 20:06 ` [PATCH 1/2] Use alternatives for the binutils-symlinks package Peter Seebach 2013-10-10 20:06 ` [PATCH 2/2] Drop binutils-symlinks Peter Seebach 2013-10-16 16:48 ` [PATCH 0/2] Use alternatives for all of binutils instead of -symlinks Saul Wold 2013-10-16 19:18 ` Mark Hatle 2013-10-18 23:24 ` [PATCH 0/2] v2: Use alternatives for binutils Peter Seebach 2013-10-18 23:24 ` [PATCH 1/2] Use alternatives for the binutils-symlinks package Peter Seebach 2013-10-19 5:22 ` Saul Wold 2013-10-21 3:46 ` Peter Seebach 2013-11-04 18:40 ` Peter Seebach 2013-10-18 23:24 ` [PATCH 2/2] Drop binutils-symlinks Peter Seebach
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox