We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a959e98 commit 9b02cabCopy full SHA for 9b02cab
src/codegen.cpp
@@ -8375,7 +8375,9 @@ static bool detect_dynamic_link(CodeGen *g) {
8375
return true;
8376
if (g->zig_target->os == OsFreestanding)
8377
return false;
8378
- // If there are no dynamic libraries then we can disable PIC
+ if (g->libc_link_lib != nullptr && target_is_glibc(g->zig_target))
8379
+ return true;
8380
+ // If there are no dynamic libraries then we can disable dynamic linking.
8381
for (size_t i = 0; i < g->link_libs_list.length; i += 1) {
8382
LinkLib *link_lib = g->link_libs_list.at(i);
8383
if (target_is_libc_lib_name(g->zig_target, buf_ptr(link_lib->name)))
0 commit comments