public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: Khem Raj <raj.khem@gmail.com>
Cc: elfutils-devel@sourceware.org
Subject: Re: [PATCH] Add helper function for basename
Date: Thu, 21 Dec 2023 02:02:33 +0100	[thread overview]
Message-ID: <20231221010233.GE30440@gnu.wildebeest.org> (raw)
In-Reply-To: <CAMKF1sq2yYQc6+fdqwf6NPTHAb54h8y7tsbt8dyR5hPDv3NurA@mail.gmail.com>

Hi Khem,

On Wed, Dec 20, 2023 at 08:43:57AM -0800, Khem Raj wrote:
> This patch seem to work fine

Thanks for double checking. I pushed it as:

commit a2194f6b305bf0d0b9dd49dccd0a5c21994c8eea
Author: Khem Raj <raj.khem@gmail.com>
Date:   Sun Dec 10 12:20:33 2023 -0800

    Add helper function for basename
    
    musl does not provide GNU version of basename and lately have removed
    the definiton from string.h [1] which exposes this problem. It can be
    made to work by providing a local implementation of basename which
    implements the GNU basename behavior, this makes it work across C
    libraries which have POSIX implementation only.
    
    [1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
    
        * lib/system.h (xbasename): New static inline functions.
        Poison basename.
        * libdw/dwarf_getsrc_file.c (dwarf_getsrc_file): Use xbasename.
        * libdwfl/core-file.c (dwfl_core_file_report): Likewise.
        * libdwfl/dwfl_module_getsrc_file.c (dwfl_module_getsrc_file):
        Likewise.
        * libdwfl/dwfl_segment_report_module.c (dwfl_segment_report_module):
        Likewise.
        * libdwfl/find-debuginfo.c (find_debuginfo_in_path): Likewise.
        * libdwfl/link_map.c (report_r_debug): Likewise.
        * libdwfl/linux-kernel-modules.c (try_kernel_name): Likewise.
        * src/addr2line.c (print_dwarf_function): Likewise.
        (print_src): Likewise.
        * src/ar.c (do_oper_insert): Likewise.
        And cast away const in entry.key assignment.
        * src/nm.c (show_symbols): Use xbasename.
        * src/stack.c (module_callback): Likewise.
        * src/strip.c (handle_elf): Likewise.
        * tests/show-die-info.c: Include system.h.
        (dwarf_tag_string): Use xbasename.
        * tests/varlocs.c: Likewise.
        * debuginfod/debuginfod.cxx: Move include system.h to the end.
        (register_file_name): Rename basename to filename.
    
    Signed-off-by: Khem Raj <raj.khem@gmail.com>
    Signed-off-by: Mark Wielaard <mark@klomp.org>

BTW. There is a musl tracking bug:
https://sourceware.org/bugzilla/show_bug.cgi?id=21002

Could you take a peek at that and say if there are still patches
needed either in elfutils or musl?

Thanks,

Mark

      reply	other threads:[~2023-12-21  1:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-10 20:20 Khem Raj
2023-12-12 13:18 ` Mark Wielaard
2023-12-12 17:16   ` Khem Raj
2023-12-13 15:10     ` Mark Wielaard
2023-12-13 16:29       ` Khem Raj
2023-12-13 22:33         ` Mark Wielaard
2023-12-14 18:07 ` Mark Wielaard
2023-12-14 18:15   ` Khem Raj
2023-12-14 19:22     ` Mark Wielaard
2023-12-14 19:28       ` Khem Raj
2023-12-20 16:43         ` Khem Raj
2023-12-21  1:02           ` Mark Wielaard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231221010233.GE30440@gnu.wildebeest.org \
    --to=mark@klomp.org \
    --cc=elfutils-devel@sourceware.org \
    --cc=raj.khem@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).