News for hackers. Stuff that matters.
Re:Tbox: A GLib-like cross-platform C library by AndyKelley on Thursday April 11, 2019 @11:09PM (#19641606)
To solve the problem in a robust way, the C library has to be part of the target. For example on Debian Linux, glibc is the native libc. On Alpine Linux, musl is the native libc. In LLVM terminology, this is the "C ABI environment" part of the "target triple".

If your compiler supports cross compiling, you might look into the strategies that Zig does[1]. If it only supports native builds, you probably want to detect the native libc. Again here it might be useful to look at what Zig does[2].

[1]: https://ziglang.org/download/0.4.0/release-notes.html#Zig-sh... [2]: https://ziglang.org/download/0.4.0/release-notes.html#Libc-D...

Re:Tbox: A GLib-like cross-platform C library by waruqi on Thursday April 11, 2019 @11:11PM (#19641617)
That is the standard library, TBOX is just a third-party library, providing some easy-to-use cross-platform modules.
Re:Tbox: A GLib-like cross-platform C library by sansnomme on Friday April 12, 2019 @02:28AM (#19642483)
Any plans to do a Libc too? A lot of embedded systems like ESP32 could really use a good Libc without having to pull in Linux.
Re:Tbox: A GLib-like cross-platform C library by waruqi on Friday April 12, 2019 @02:33AM (#19642502)
I haven't got this plan yet., but the tbox has a lightweight and compact libc implementation built in. The interface name looks like this: tb_snprintf, tb_strlcpy, ...

You can see https://github.com/tboox/tbox/tree/master/src/tbox/libc