fix glibc not forcing dynamic link

This commit is contained in:
Andrew Kelley 2020-02-17 16:37:22 -05:00
parent a959e98273
commit 9b02cab3da
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -8375,7 +8375,9 @@ static bool detect_dynamic_link(CodeGen *g) {
return true;
if (g->zig_target->os == OsFreestanding)
return false;
// If there are no dynamic libraries then we can disable PIC
if (g->libc_link_lib != nullptr && target_is_glibc(g->zig_target))
return true;
// If there are no dynamic libraries then we can disable dynamic linking.
for (size_t i = 0; i < g->link_libs_list.length; i += 1) {
LinkLib *link_lib = g->link_libs_list.at(i);
if (target_is_libc_lib_name(g->zig_target, buf_ptr(link_lib->name)))