Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Because those Bazel toolchains don’t come with a glibc? How could they?


This one does, we use it with great success: https://github.com/cerisier/toolchains_llvm_bootstrapped


What? Of course they can, how is that hard?


You need that glibc on the target system, and glibc doesn’t like static linking. How do you ship the built binary?


You include the target glibc as part of your toolchain

And, I always prefer to actually pick my glibc independently from the host os and ship it with the binary (generally in an OCI image). This way you can patch/update the host without breaking the service.


Right, so you need to end up creating a container to package the glibc with the binary. Which is not very different from having sysroots.

But what about any tools compiled from source and used during the build? Those can also suffer from these issues.


Yeah, ideally you could build your toolchain from source on any platform. But, in some cases that’s not possible


Does that result in working NSS?


I normally statically link as much as possible and avoid nss, but you can make that work as well, just include it along with glibc.


Is musl not an option? It's best to avoid glibc altogether if possible.


no, you just need a compatible starlit/glibc. you pick an old version (e.g. RHEL8) or otherwise compile with multiple tool chains if you need newer glibc features




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: