From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21474 invoked from network); 7 Jul 2023 14:18:39 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 7 Jul 2023 14:18:39 -0000 Received: (qmail 13858 invoked by uid 550); 7 Jul 2023 14:18:37 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 13826 invoked from network); 7 Jul 2023 14:18:36 -0000 X-Proofpoint-GUID: aQasShe2sBWT3mRTpEjdbyHSYRNdiiRV X-Proofpoint-ORIG-GUID: aQasShe2sBWT3mRTpEjdbyHSYRNdiiRV X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.591,18.0.957 definitions=2023-07-07_10:2023-07-06,2023-07-07 signatures=0 X-Proofpoint-Spam-Details: rule=interactive_user_notspam policy=interactive_user score=0 mlxscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307070131 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=20180706; bh=B8nIkX8Wzx7ZiMZw2dMsyAfyjpe+NDM4/EFwa1uRUcQ=; b=evqfB8DvrhRCmSTQ7/M49kEl89zvTcJBxm6/5M2Wt5G6KXQ5pZ0qS230oru0Go3XBdwT 7A4rLlH8BQ8ABeiPk1ShyZYPByVVyHgfCO9JFI3VkzU/vId/nLzXfbjF/5Q8IdYLG/WB 3AsO09nJhwjxvyOMb7mEEVGZ8uuBhvvSxshS4g3Ss4WvSsB76tDPv/IWwX3Pqr/HRllV QT9M8QKLvUEJqELtkEAkDMz32po0cIV5+fFUsnWWxkpW9peezTAs2hmCmrMwr3KfxszF WBSNG/JG506djgZcdLTp++3Z18syTr1J/HFhoEPMfaUvGyrnOZt+Qp1RrGACqaBEy75R aQ== X-Va-A: X-Va-T-CD: ee50c839d80393d0679506f9ba71f6b0 X-Va-E-CD: 56ab0e176e6e23b7c0c7f8bb71e3663a X-Va-R-CD: d86870e6d2b7150a65f5397c4f4f694c X-Va-ID: b3c3a7c2-cdb8-48e7-b6b6-2bdb7c80649c X-Va-CD: 0 X-V-A: X-V-T-CD: ee50c839d80393d0679506f9ba71f6b0 X-V-E-CD: 56ab0e176e6e23b7c0c7f8bb71e3663a X-V-R-CD: d86870e6d2b7150a65f5397c4f4f694c X-V-ID: 040b945a-beb1-40c5-b669-794f56aabc24 X-V-CD: 0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.591,18.0.957 definitions=2023-07-07_10:2023-07-06,2023-07-07 signatures=0 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 16.0 \(3767.100.2\)) From: Alastair Houghton In-reply-to: <20230707135302.GF4163@brightrain.aerifal.cx> Date: Fri, 07 Jul 2023 15:18:13 +0100 Cc: musl@lists.openwall.com Content-transfer-encoding: quoted-printable Message-id: <1C9950BE-7581-4BFC-B05F-E0320C2C7058@apple.com> References: <309EDCC9-2402-46B5-BDBD-B96677E470DD@apple.com> <168864586814.64499.13397704850676744237@alexps.local> <20230707135302.GF4163@brightrain.aerifal.cx> To: Rich Felker X-Mailer: Apple Mail (2.3767.100.2) Subject: Re: [musl] __MUSL__ macro On 7 Jul 2023, at 14:53, Rich Felker wrote: >=20 > On Fri, Jul 07, 2023 at 08:14:11AM +0100, Alastair Houghton wrote: >=20 >> Arguing about the details of individual issues is an unnecessary >> distraction, honestly. >=20 > Except here it's really not, because the example you brought up where > you couldn't do detection was where your code was doing something very > wrong. In point of fact, I didn=E2=80=99t even try to detect musl in that case = and instead changed the code to work differently. So it really is = irrelevant and again, I wish I hadn=E2=80=99t mentioned it because now = we=E2=80=99re spending time on that rather than talking about the actual = issue. > That dladdr is a no-op rather than always returning the single > static-linked object is a bug that would be worth reporting. Having > someone leave it unreported and instead hard-coding "musl dladdr > doesn't work" is not in our interests. The bug report instructions appear to say that an email to this list is = sufficient. Does this need to be a separate message? I=E2=80=99m quite = happy to report it as a bug however you please. >> There are two situations where the lack of macros is absolutely a >> problem and there isn=E2=80=99t a sane workaround. >>=20 >> 1. You=E2=80=99re cross compiling... [snip] >>=20 >> 2. You=E2=80=99re in a header-only library, ... [snip] > In neither of these cases do you want to know "this is musl", which > would at best help you make wrong platform-specific assumptions that > might have been true at the time you wrote the code, but which aren't > true later when someone is using it. Nevertheless, =E2=80=9Cthis is musl=E2=80=9D (or better, =E2=80=9Cthis = is musl version x.y=E2=80=9D) is a reasonable proxy in the absence of = the availability of any finer grained information. I entirely agree = that it isn=E2=80=99t perfect, and adding such a test potentially = necessitates future maintenance when musl is updated - but that future = maintenance is on the owner of the project that added such a test, not = on you. Many projects have already made a conscious choice to accept = those kinds of tests and the associated maintenance overhead in the = context of other libraries and environments. This is definitely a = balancing act; explicitly testing for particular functionality is = better, on that we agree, but it does have overheads and problems of its = own and sometimes it makes sense to try to do things in the preprocessor = or with compile-time tests instead of having a complex and often slow = configuration step. Without these kinds of macros being available, it=E2=80=99s difficult to = make perfectly reasonable tests (like =E2=80=9Cdon=E2=80=99t use this = function when building for musl 1.1.7 because it has a known bug=E2=80=9D,= or =E2=80=9Cdon=E2=80=99t use this function because it isn=E2=80=99t = supported on musl (yet)=E2=80=9D), and people will just do what various = posts suggest on Stack Overflow, which is far worse because they=E2=80=99r= e relying on hacky methods of detecting musl that are totally outside of = your control. If it is your position that you are not going to add this, ever, then = fine. I=E2=80=99ve made my argument and I think that=E2=80=99s the = wrong decision but it=E2=80=99s your choice to make. Kind regards, Alastair.