mailing list of musl libc
 help / color / mirror / code / Atom feed
* C++ ABI TODO list
@ 2013-07-20  5:26 Rich Felker
  2013-07-22 15:45 ` Rich Felker
  0 siblings, 1 reply; 3+ messages in thread
From: Rich Felker @ 2013-07-20  5:26 UTC (permalink / raw)
  To: musl

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-22 18:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-20  5:26 C++ ABI TODO list Rich Felker
2013-07-22 15:45 ` Rich Felker
2013-07-22 18:20   ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).