From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) by sourceware.org (Postfix) with ESMTPS id 31A043858019 for ; Wed, 13 Dec 2023 16:29:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 31A043858019 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 31A043858019 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4860:4864:20::35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702484969; cv=none; b=IWkeVqaG1NdtK+6rEOj/VoQF/KnXZ8UqV13966hKo/1YcunmRpz/UyCV7YpVGz0wGsa95uwvNrM+69zva4PPF73f9+Isgg+Mpq1U9rFMAc1+cZJlguLZjWaDewCKdg/Dj1X2H05BsXRE9f3WNrbHEpTrGs6WEVR2GTdYpzFur6E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702484969; c=relaxed/simple; bh=Lv3o0HMfimznAwfta1KiyHplAWpyf5IePapgAowEuw0=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=Mv2fBgQe0n/rhRfd3pzhF0G4Av0fEfblrxo2MEinKm6JiJinvvoLvRnVSJ285EYKTAtcNEdXpkqHUhTe7+9PSznX2jDEWaPXYiyhUrTq4weKDX3KNUuUSM7HcncrWFUEBRaukvnUbgTfWCVxCcUSx1AXfZuLuJzmfoKhWfsqo9g= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-20316647099so881741fac.2 for ; Wed, 13 Dec 2023 08:29:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702484967; x=1703089767; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Lv3o0HMfimznAwfta1KiyHplAWpyf5IePapgAowEuw0=; b=SSxFn1frbh/xYERXPiQxCWIoOMX9+TjJzZBJA0lIHAyl57nxj1FTwdFf70Bx5RZNVe nTml6CRaXpEyzHLzAnSrzTLN6pOOVOiczyvLPLBdL7z0HdcpG6BNEoHNA2VpQBp5muZ9 qgMK/j+k+XFpVs/nBwnWRhzM/KBwkYs83C9zS4O0tiluRIVXriatQbzqQdQEd00qhhDy 6vgTxzi4uSaXKFzsPrlW+YvmwUrGaqVGLeAt3UyDRosQoOHVOaDZRUVqOGk78JN0akk/ IPz1fFWp/wZdEbLHWUXLzQrpwqbzQln6U1byNrXNWcPuJ0XMXXthOAsbdj4tsYLOuqmj Q37w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702484967; x=1703089767; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Lv3o0HMfimznAwfta1KiyHplAWpyf5IePapgAowEuw0=; b=Q9rQfBmcniQEUFDaoglHvtmm+UR0mwMsACxHveMzqXCGJF6h2Qsc7U7nCBOIp+Jz69 +CJnpR1yhDnYeFc0eyCQeZH4yeDOGkgpomIC6dvu3KQgJaLodEcOiWiaeF4LQLzWQ/kn C54VxVE2NFL/w93JE5PCOIEgPMgSeta3KlRUaORQQhN71DiiZII0a+Cx28U1TZXw0Og0 8ViMqMZthZtvQLTk+j2L1NuFFrmRGzfUFPJrVCpkykeQ7pJk8mYf2BoaFofVBiGOcR+D lfBSPTMtaBnD4Cy2OlSm+atBKvbnv+RqCIqw2UxfqOTnT7wAQXAVz0RtAiHWoeNtnpty Hbbw== X-Gm-Message-State: AOJu0YzR1BnKg/VZMMreNmfEM1PkcBUHaImmZmyR1tJeD18SpySdE1T4 m1RcFNyMiE3yyTInW6VzX7LEThxPVar4yf6nXzHWUufEcLo= X-Google-Smtp-Source: AGHT+IEOc4dJHNPpdE8ByBOP6flUX18i9MdtvR8D85OtaFo8X5f/7cZixsXSOyy1wdVobhgVsFN++BffzDj8uWRWDTU= X-Received: by 2002:a05:6870:659e:b0:1fb:3741:4dc5 with SMTP id fp30-20020a056870659e00b001fb37414dc5mr10595744oab.34.1702484967175; Wed, 13 Dec 2023 08:29:27 -0800 (PST) MIME-Version: 1.0 References: <20231210202033.151578-1-raj.khem@gmail.com> <94bd77b96d261ebac6bfe62e8de64d3539742133.camel@klomp.org> In-Reply-To: <94bd77b96d261ebac6bfe62e8de64d3539742133.camel@klomp.org> From: Khem Raj Date: Wed, 13 Dec 2023 08:29:01 -0800 Message-ID: Subject: Re: [PATCH] Add helper function for basename To: Mark Wielaard Cc: elfutils-devel@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, Dec 13, 2023 at 7:10=E2=80=AFAM Mark Wielaard wrot= e: > > Hi Khem, > > On Tue, 2023-12-12 at 09:16 -0800, Khem Raj wrote: > > On Tue, Dec 12, 2023 at 5:18=E2=80=AFAM Mark Wielaard = wrote: > > > On Sun, 2023-12-10 at 12:20 -0800, Khem Raj wrote: > > > > musl does not provide GNU version of basename and lately have remov= ed > > > > 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. > > > > > > Thanks, this should work, but wouldn't it be easier to add a configur= e > > > test for having basename defined in string.h and then only define > > > basename in libeu.h (and build basename.c) if it isn't. So that all t= he > > > code can just keep using basename (we just have to make sure libeu.h = is > > > included)? > > > > we could do that but it will not work as expected with older musl relea= ses > > where the prototype in string.h will exist. > > But that is good isn't it? Or did musl define basename in string.h with > different semantics (where the given input string is modified)? basename was declared like this till lately https://git.musl-libc.org/cgit/musl/commit/?id=3D725e17ed6dff4d0cd22487bb64= 470881e86a92e7 > > In the second case various elfutils libraries and tools probably just > segfaulted when build/run against musl. And your patch would indeed fix > both old and new musl versions. Do people using musl already use some > variant of your patch? This is not yet tried widely in distros as the musl patch above is till new and not part of a release yet. > > Thanks, > > Mark