From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/3698 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: C++ ABI TODO list Date: Sat, 20 Jul 2013 01:26:14 -0400 Message-ID: <20130720052614.GA17733@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1374297990 11497 80.91.229.3 (20 Jul 2013 05:26:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Jul 2013 05:26:30 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-3702-gllmg-musl=m.gmane.org@lists.openwall.com Sat Jul 20 07:26:29 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1V0Pgb-0006pt-Ff for gllmg-musl@plane.gmane.org; Sat, 20 Jul 2013 07:26:29 +0200 Original-Received: (qmail 7349 invoked by uid 550); 20 Jul 2013 05:26:28 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 7336 invoked from network); 20 Jul 2013 05:26:27 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:3698 Archived-At: Here are the changes I'm aware of that would be needed to bring musl's C++ ABI in line with glibc/LSB, enabling C++ library reuse with musl: Making FILE match is easy: __FILE_s -> _IO_FILE glibc defines mbstate_t as a structure with no tag. As far as I can tell (simple C++ test program), the name mangling then comes fully from the typedef name, so I think we might be okay on mbstate_t already. glibc's fpos_t is defined as _G_fpos_t or _G_fpos64_t depending on _FILE_OFFSET_BITS, so the type name for C++ name mangling should be _G_fpos64_t on 32-bit machines, but I'm uncertain which it should be on 64-bit ones. Does anybody use these horrible fpos functions anyway? Fixing jmp_buf and sigjmp_buf requires making them both the same type, struct __jmp_buf_tag. Instead of storing a whole HURD sigset, the unified jmp_buf should only store _NSIG. The full type with the extra slots for sigsets (not just space for machine regs) should be defined in alltypes.h (since it needs to be aware of the number of signals the arch has, and _NSIG is not visible in setjmp.h). In order to keep the error detection properties of musl's pthread_t, it should be redefined as: #ifdef __cplusplus TYPEDEF unsigned long pthread_t; #else TYPEDEF struct __pthread pthread_t; #endif (We could further add similar conditional definition for timer_t.) Most of the above were taken from the old "Remaining ABI issues" thread (January 2013) and some quick experimentation with glibc. Note that the old issues (in that thread) about timer_t having pointer type are gone; POSIX-2008-TC1 adopted my requested change to remove the requirement that timer_t have arithmetic type. I'm hoping the above list is all... Rich