From 9b02cab3dacc40fdda2b0bd493f33bc7d17b326d Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 17 Feb 2020 16:37:22 -0500 Subject: fix glibc not forcing dynamic link --- src/codegen.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/codegen.cpp b/src/codegen.cpp index b959d03549..12b49ab2ae 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -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))) -- cgit v1.2.3