#Does zig cc and zig c++ -target x86_64-linux-gnu link all static except glibc?

1 messages · Page 1 of 1 (latest)

misty schooner
#

From my tests, it seems that zig build and links everything statically except glibc and the glibc runtime. Inspecting the executable, these are the only thinks linked as dynamic libs. So am I correct in assuming everything else was linked statically? Including LLVM's libcxx that ships with zig? Thanks! :)

#

the tools being used are:

CC=zig cc -target x86_64-linux-gnu
CXX=zig c++ -target x86_64-linux-gnu
LINK=zig c++ -target x86_64-linux-gnu
AS=zig c++ -target x86_64-linux-gnu
AR=zig ar
RANLIB=zig ranlib
golden ocean
#

if you pass a static lib to link it will be linked statically, if you pass a dynamic lib to link it will be linked dynamically

#

where -musl is static libc and -gnu is dynamic libc