Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] outdated libiberty and prelink-cross support
@ 2022-11-02 13:05 Romain Naour
  2023-02-08 15:53 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 3+ messages in thread
From: Romain Naour @ 2022-11-02 13:05 UTC (permalink / raw)
  To: buildroot@buildroot.org

Hello

I was looking at host-binutils-2.38 issue in the autobuilder [1].
The issue appear only when host-libiberty is built before host-binutils
(Binutils 2.38 only).

It seems that libiberty package is still based on binutils 2.32 release and
seems to be updated.

host-libiberty is currently used by host-gdb and host-prelink-cross packages.

About the prelink-cross package, it come from the Yocto project [2] but the
support seems halted. Also the Glibc project will remove prelink support for the
upcoming 2.37 release [3].

The annoying part is "Prelink-cross emulates a runtime linker for a given
sysroot. This is necessary to allow gobject-introspection to build its typelib
files during cross-compiling." [4]

host-prelink-cross is currently used by dracut and gobject-introspection packages.

Contributions are welcome!

[1] http://autobuild.buildroot.org/?reason=host-binutils-2.38
[2] https://git.yoctoproject.org/prelink-cross
[3] https://lists.gnu.org/archive/html/info-gnu/2022-08/msg00000.html
[4]
https://gitlab.com/buildroot.org/buildroot/-/commit/8af40358e3885440248aa783490096bdd1b7a90c

Best regards,
Romain
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] outdated libiberty and prelink-cross support
  2022-11-02 13:05 [Buildroot] outdated libiberty and prelink-cross support Romain Naour
@ 2023-02-08 15:53 ` Thomas Petazzoni via buildroot
  2023-02-08 16:10   ` Romain Naour
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-02-08 15:53 UTC (permalink / raw)
  To: Romain Naour; +Cc: Yann E. MORIN, Adam Duskett, buildroot@buildroot.org

Hello,

+Yann and Adam, with questions/help needed below :)

On Wed, 2 Nov 2022 14:05:26 +0100
Romain Naour <romain.naour@smile.fr> wrote:

> I was looking at host-binutils-2.38 issue in the autobuilder [1].
> The issue appear only when host-libiberty is built before host-binutils
> (Binutils 2.38 only).
> 
> It seems that libiberty package is still based on binutils 2.32 release and
> seems to be updated.
> 
> host-libiberty is currently used by host-gdb and host-prelink-cross packages.
> 
> About the prelink-cross package, it come from the Yocto project [2] but the
> support seems halted. Also the Glibc project will remove prelink support for the
> upcoming 2.37 release [3].
> 
> The annoying part is "Prelink-cross emulates a runtime linker for a given
> sysroot. This is necessary to allow gobject-introspection to build its typelib
> files during cross-compiling." [4]
> 
> host-prelink-cross is currently used by dracut and gobject-introspection packages.

I had a look, and there are things at two different levels that can be
done.

First, we need to remove the package/libiberty/ package. libiberty is
currently used by host-gdb and host-prelink-cross:

* For host-gdb, the commit log says that the host libiberty might be
  picked up so we need to build our own. This is weird because
  libiberty is shipped in the gdb tarball. Yann, when you applied
  f0a583ddc4c2cab121330284e316f54229dee492, do you remember if you
  looked at why GDB wasn't picking up its own libiberty? Also, there is
  no autobuilder failure, so we don't really know under what conditions
  the problem can be reproduced.

* For host-prelink-cross, it in fact doesn't need host-libiberty. It
  links against it, but apparently, the only functions it uses from
  libiberty are htab_find_slot() and htab_try_create(), and both are
  provided by src/hashtab.c in prelink-cross, which was copy/pasted
  from libiberty, most likely to avoid the dependency. So with a bit of
  effort in host-prelink-cross, the dependency on host-libiberty could
  be removed.

Then, the second level is about host-prelink-cross itself. It is used
by only two packages, so let's have a look:

* For gobject-instrospection, it is no longer needed: openembedded-core
  stopped using it in
  https://github.com/openembedded/openembedded-core/commit/767e0880d4d729e659e859dd99c1cdb084b8ba51.
  It simply uses "objdump -p" instead. It also allows to remove a patch
  from gobject-introspection, so overall it seems like a good thing.

* For dracut, the usage is pretty much the same, and a small wrapper
  around objdump -p would most likely be able to emulate the behavior
  lf prelink-rtld to list the libraries that a binary depends on.

So there's a bit of work for sure, but this work would allow to remove
both host-libiberty and host-prelink-cross, which are both weird
packages that will inevitably cause problems.

My main concerns are:

(1) How to reproduce the host-gdb issue that caused the addition of the
    host-liberty dependency

(2) How to test gobject-introspection in a simple way. There is no
    runtime test for it, I have no idea what is the simplest test that one
    can do to verify the proper functionality of gobject-introspection
    after we do the above changes.

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] outdated libiberty and prelink-cross support
  2023-02-08 15:53 ` Thomas Petazzoni via buildroot
@ 2023-02-08 16:10   ` Romain Naour
  0 siblings, 0 replies; 3+ messages in thread
From: Romain Naour @ 2023-02-08 16:10 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Yann E. MORIN, Adam Duskett, buildroot@buildroot.org

Hello,

Le 08/02/2023 à 16:53, Thomas Petazzoni a écrit :
> Hello,
> 
> +Yann and Adam, with questions/help needed below :)
> 
> On Wed, 2 Nov 2022 14:05:26 +0100
> Romain Naour <romain.naour@smile.fr> wrote:
> 
>> I was looking at host-binutils-2.38 issue in the autobuilder [1].
>> The issue appear only when host-libiberty is built before host-binutils
>> (Binutils 2.38 only).
>>
>> It seems that libiberty package is still based on binutils 2.32 release and
>> seems to be updated.
>>
>> host-libiberty is currently used by host-gdb and host-prelink-cross packages.
>>
>> About the prelink-cross package, it come from the Yocto project [2] but the
>> support seems halted. Also the Glibc project will remove prelink support for the
>> upcoming 2.37 release [3].
>>
>> The annoying part is "Prelink-cross emulates a runtime linker for a given
>> sysroot. This is necessary to allow gobject-introspection to build its typelib
>> files during cross-compiling." [4]
>>
>> host-prelink-cross is currently used by dracut and gobject-introspection packages.
> 
> I had a look, and there are things at two different levels that can be
> done.

Thanks!

> 
> First, we need to remove the package/libiberty/ package. libiberty is
> currently used by host-gdb and host-prelink-cross:
> 
> * For host-gdb, the commit log says that the host libiberty might be
>   picked up so we need to build our own. This is weird because
>   libiberty is shipped in the gdb tarball. Yann, when you applied
>   f0a583ddc4c2cab121330284e316f54229dee492, do you remember if you
>   looked at why GDB wasn't picking up its own libiberty? Also, there is
>   no autobuilder failure, so we don't really know under what conditions
>   the problem can be reproduced.

I had a look before writing this email and I was not sure about libiberty
dependency. For me gdb build its own version. I wasn't able to prove that it can
use libiberty from the host if available.

> 
> * For host-prelink-cross, it in fact doesn't need host-libiberty. It
>   links against it, but apparently, the only functions it uses from
>   libiberty are htab_find_slot() and htab_try_create(), and both are
>   provided by src/hashtab.c in prelink-cross, which was copy/pasted
>   from libiberty, most likely to avoid the dependency. So with a bit of
>   effort in host-prelink-cross, the dependency on host-libiberty could
>   be removed.
> 
> Then, the second level is about host-prelink-cross itself. It is used
> by only two packages, so let's have a look:
> 
> * For gobject-instrospection, it is no longer needed: openembedded-core
>   stopped using it in
>   https://github.com/openembedded/openembedded-core/commit/767e0880d4d729e659e859dd99c1cdb084b8ba51.
>   It simply uses "objdump -p" instead. It also allows to remove a patch
>   from gobject-introspection, so overall it seems like a good thing.
> 
> * For dracut, the usage is pretty much the same, and a small wrapper
>   around objdump -p would most likely be able to emulate the behavior
>   lf prelink-rtld to list the libraries that a binary depends on.
> 
> So there's a bit of work for sure, but this work would allow to remove
> both host-libiberty and host-prelink-cross, which are both weird
> packages that will inevitably cause problems.
> 
> My main concerns are:
> 
> (1) How to reproduce the host-gdb issue that caused the addition of the
>     host-liberty dependency

Looking at distribution packaging, the gdb package use a bundled libiberty library:

https://src.fedoraproject.org/rpms/gdb/blob/rawhide/f/gdb.spec#_122

> 
> (2) How to test gobject-introspection in a simple way. There is no
>     runtime test for it, I have no idea what is the simplest test that one
>     can do to verify the proper functionality of gobject-introspection
>     after we do the above changes.

Sorry I don't know.

Best regards,
Romain


> 
> Best regards,
> 
> Thomas Petazzoni

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2023-02-08 16:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-02 13:05 [Buildroot] outdated libiberty and prelink-cross support Romain Naour
2023-02-08 15:53 ` Thomas Petazzoni via buildroot
2023-02-08 16:10   ` Romain Naour

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