Remix.run Logo
jprotopopov 2 days ago

I am going to hijack this comment for a little rant about libc and independent compilers. Existing libc implementations have varying levels of hostility towards non-gcc/clang compilers. Glibc is probably the worst offender here, musl is the most compliant (but even there are some assumptions).

I am in no way accusing any of libc developers, they got much higher priority things to do than supporting obscure compilers, and this is my problem as a compiler developer, but nevertheless. For instance, glibc may simply override __attribute__ keyword with an empty macro, or omit packed attributes for non GNU C compilers (breaking epoll ABI along the way). Of course, strictly standard-compliant compiler may not have attributes at all, but in my opinion #warning/#error directive would have been more appropriate than silently producing ABI breakage.

Although, I have not engaged with glibc developers on these topics, and mostly documented encountered challenges as patches in my own test suite.

1718627440 2 hours ago | parent [-]

The libc is part of the C implementation, i.e. part of the compiler. It's not a bunch of helpful utils like in other languages. The compiler is allowed to optimize based on ever behaviour it knows its libc has. It's nice that you sometimes can swap out the libc, but its a hack.