From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 55B763858CD1 for ; Thu, 21 Dec 2023 01:02:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 55B763858CD1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 55B763858CD1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=45.83.234.184 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703120556; cv=none; b=ju/R3ZZhwOBT8sp/j4xuaWPlP0w0RSGc1acldz/mn8FyiBvNOAfvMHcpehgvEaSBo+edAVGWAmVJXUfLhm3E+nv8PspKL8zzKSdC85axEImAXbOuwHUic4qbsk9UfzeJpP9z9JxpDYMKi4pieqv61cAZw9blGcy2ccyikLmipLE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1703120556; c=relaxed/simple; bh=4iKEPfxyqySF/Hr71Qfyfy4106pKCp1vlLZHOgwILbc=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=PcX3YrlemJiI/XA3JZwo9yFKu7P/1CQhR2uMNXrf5EaZDcNkX1iX/VIhQWd3RgUHoqWqHRfQNYyudYw+4q8DRInj5pSvhJfydhJ5n70y/u7kvnECYJR53rLf8poQrQLOhuyqDFUoAfHN9xhXaqc/Dm0hxf1d4h+5mfzbppaIaHs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by gnu.wildebeest.org (Postfix, from userid 1000) id 6447D302BB42; Thu, 21 Dec 2023 02:02:33 +0100 (CET) Date: Thu, 21 Dec 2023 02:02:33 +0100 From: Mark Wielaard To: Khem Raj Cc: elfutils-devel@sourceware.org Subject: Re: [PATCH] Add helper function for basename Message-ID: <20231221010233.GE30440@gnu.wildebeest.org> References: <20231210202033.151578-1-raj.khem@gmail.com> <20231214192219.GB12145@gnu.wildebeest.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 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 Signed-off-by: Mark Wielaard 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