When you’re on Linux and target an older version of glibc, such as 2.18, how exactly does Zig ensure the binary doesn’t use newer symbols? Where does the implementation for those functions come from? Is it linking in code from musl, or is it statically linking parts of glibc newer than 2.18? I’m trying to understand the mechanism here to determine if there are any GPL concerns with using this feature.
Zig generates code that links dynamically with glibc symbols (allowed by LGPL). There is static linking of the gcc runtime library (allowed by the GPL license exception).
To get the entire picture see:
- glibc LGPL license: The GNU C Library - GNU Project - Free Software Foundation
- license exception for gcc runtime: GCC Runtime Library Exception - GNU Project - Free Software Foundation
- Specifying glibc version: Specify target glibc at command line - #2 by dimdin
- Zig glibc stubs: zig/lib/libc/glibc at master · ziglang/zig · GitHub
- static gcc runtime: zig/lib/libc/glibc at master · ziglang/zig · GitHub
2 Likes