Re:Zig cc: A drop-in replacement for GCC/Clang
by saagarjha on Tuesday March 24, 2020 @09:50PM
(#22681250)
You can, but it is not supported. Certain features (NSS, iconv) will not work.
[ Parent
| on HN ]
Re:Zig cc: A drop-in replacement for GCC/Clang
by otabdeveloper2 on Wednesday March 25, 2020 @03:08AM
(#22682570)
> Certain features (NSS, iconv) will not work.
If you're the kind of person who wants static linking then you really don't want these features.
The real problem is that statically linked programs under Linux don't (didn't?) support VDSO, which means that syscalls like gettimeofday() are suddenly orders of magnitude slower.
In the end, we had to do a kind of pseudo-static linking - link everything static except glibc.
Re:Zig cc: A drop-in replacement for GCC/Clang
by saagarjha on Wednesday March 25, 2020 @03:38AM
(#22682680)
I think the vDSO page is mapped into every process regardless of how the program is linked, although you may have difficulty using it.
Re:Zig cc: A drop-in replacement for GCC/Clang
by justincormack on Wednesday March 25, 2020 @03:44AM
(#22682704)
Vdso is supported with static linking in Musl libc at least.