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.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8287 invoked from network); 29 Jul 2020 01:16:23 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 29 Jul 2020 01:16:23 -0000 Received: (qmail 29829 invoked by uid 550); 29 Jul 2020 01:16:20 -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 29808 invoked from network); 29 Jul 2020 01:16:19 -0000 Date: Tue, 28 Jul 2020 21:16:07 -0400 From: Rich Felker To: Florian Weimer Cc: musl@lists.openwall.com Message-ID: <20200729011606.GR6949@brightrain.aerifal.cx> References: <1667998.jfqktxE8f0@localhost> <20200727160326.GN6949@brightrain.aerifal.cx> <2983406.IqFZyr3sfq@localhost> <20200727215001.GO6949@brightrain.aerifal.cx> <871rkwuj5o.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <871rkwuj5o.fsf@mid.deneb.enyo.de> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] friendly errors for ABI mismatch On Tue, Jul 28, 2020 at 10:40:35AM +0200, Florian Weimer wrote: > * Rich Felker: > > > Symbol versioning, if used, changes this somewhat by binding to a > > particular version string (which by convention usually contains a > > library name too) *if* the library used to resolve it at runtime has > > versioning, but for very good reasons we have not used and do not want > > to use symbol versioning. (In short, like here it's an "approximate > > solution" for most things people want to use it for, doesn't actually > > achieve those things precisely, messes other things up in the process, > > and has really really bad tooling support.) > > I think you should look at this from a different angle. You could use > it just to produce an error message in case there is an ABI change, > but not for backwards compatibility with old binaries or enabling > otherwise ABI-incompatible changes without rebuilding the world. The only ABI change here is in the ABI defined between libc consumers using the time_t-derived libc types. From the standpoint of musl's ABI surface, the change here was similar to any other instance of adding new interfaces for new functionality except that the new symbols get used implicitly via redirection rather than only when directly referenced by the application. > With this approach, all symbols would have a single, default version. > New releases do not add new symbol version strings in general, except > when there is something like time64_t, in which the default (and only > version) for those symbols changes. Over time, you will end up with a > few symbol versions, but at a much slower pace than what glibc does. I didn't want to get into a detailed discussion of how symbol versioning is broken, but it is broken, and using it in place of symbol redirection for time64 would not have meet the needs here. In particular, without hacking on nonstandard semantics for version resolution, the following would not work: - Mixing old object files (static libraries) in code built with new musl and time64, or vice versa. - Supporting call-intercepting interposition libraries like fakeroot in a way that's safe for both time32 and time64 binaries. I suspect there are others that I'm not recalling right off. At least dlsym would have needed to be handled differently but I suspect it would still be possible to make it work. Rich