[Buildroot] [PATCH v2 1/1] package/elfutils: enable on musl

Yann E. MORIN yann.morin.1998 at free.fr
Sun Oct 22 16:36:59 UTC 2023


Bernd, All,

A little addition to the review, not directly related to your patch, see
below...

+Fabrice for commit 99ce85cdb80

On 2023-10-22 17:41 +0200, Bernd Kuhls spake thusly:
> Buildroot commit eb60820c0a9b3f938f32516f24df2eee9aac1e26 disabled
> elfutils for musl toolchains in 2015. Current code builds fine with musl
> so remove the exceptions.
> 
> Signed-off-by: Bernd Kuhls <bernd at kuhls.net>
> ---
[--SNIP--]
> diff --git a/package/elfutils/elfutils.mk b/package/elfutils/elfutils.mk
> index 0757851b72..28fcb52eb3 100644
> --- a/package/elfutils/elfutils.mk
> +++ b/package/elfutils/elfutils.mk

As I said in my review, we had a !glibc-related condiitional block; with
this change, it now looks like that:

   52 ifeq ($(BR2_TOOLCHAIN_USES_GLIBC),)
   53 ELFUTILS_DEPENDENCIES += musl-fts argp-standalone
   54 ELFUTILS_LDFLAGS += -lfts
   55 endif

This means we link with fts for all of elfutils.

I was a bit surprised to see the explicit -lfts, but nothing for
argp-sa, and sure the build succeeded anyway.

However, from what I could see, libelf itself does not use fts, as it
does not use fts_open() or other fts-related symbols. So, libelf is
linked to libfts, and this is superfluous.

libdw does use it, though.

So I tried dropping the explicit -lfts from LDFLAGS, libdw is still
properly linked to fts, though (tested both with a uclibc and a musl
toolchain):

    $ readelf -a per-package/elfutils/target/usr/lib/libdw.so |grep fts
     0x00000001 (NEEDED)                     Shared library: [libfts.so.0]
    0007b94c  00003516 R_ARM_JUMP_SLOT   00000000   fts_close
    0007ba7c  00007916 R_ARM_JUMP_SLOT   00000000   fts_set
    0007baec  00009316 R_ARM_JUMP_SLOT   00000000   fts_read
    0007bb4c  0000a916 R_ARM_JUMP_SLOT   00000000   fts_open
        53: 00000000     0 FUNC    GLOBAL DEFAULT  UND fts_close
       121: 00000000     0 FUNC    GLOBAL DEFAULT  UND fts_set
       147: 00000000     0 FUNC    GLOBAL DEFAULT  UND fts_read
       169: 00000000     0 FUNC    GLOBAL DEFAULT  UND fts_open
      3629: 00000000     0 FUNC    GLOBAL DEFAULT  UND fts_close
      3812: 00000000     0 FUNC    GLOBAL DEFAULT  UND fts_set
      3868: 00000000     0 FUNC    GLOBAL DEFAULT  UND fts_read
      3929: 00000000     0 FUNC    GLOBAL DEFAULT  UND fts_open

Fabrice, in commit 99ce85cdb80, you added the explicit -lfts. Do you
remember the details (except for the autobuild failure)?

Bernd, could you check if upstream has changed something around the
handling of fts?

It would be nice if we could drop the explicit -lfts if it is no longer
needed.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'



More information about the buildroot mailing list