From 82df40bd1fc82958ef90e7c917ce3eec382d4309 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 7 Jan 2018 05:13:30 +0100 Subject: Add 'ldl' linking flag on linux This enabled the use of dynamic lib functions such as dlopen, dlclose. Should there be a flag to disable this? --- backend/ninja/Ninja.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'backend/ninja') diff --git a/backend/ninja/Ninja.cpp b/backend/ninja/Ninja.cpp index 7c1de91..4e94fcf 100644 --- a/backend/ninja/Ninja.cpp +++ b/backend/ninja/Ninja.cpp @@ -663,7 +663,8 @@ namespace backend { case Compiler::GCC: { - result += " LINK_ARGS = '-Wl,--no-undefined,--as-needed' "; + // TODO: Add flag to disable -ldl (dlopen, dlclose...) + result += " LINK_ARGS = '-Wl,--no-undefined,--as-needed' -ldl "; break; } case Compiler::MSVC: @@ -720,7 +721,7 @@ namespace backend result += ".so: " + buildJob + " "; result += join(objectNames, " "); result += "\n"; - result += " LINK_ARGS = '-Wl,--no-undefined,--as-needed' "; + result += " LINK_ARGS = '-Wl,--no-undefined,--as-needed' -ldl "; projectGeneratedBinary += "lib" + config.getPackageName() + ".so"; break; } -- cgit v1.2.3