From 0d275db1433dec9bc7b4fcf5fcd28b42da3b6166 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 6 Sep 2018 19:20:01 +0200 Subject: Fix issues with interaction between binless logic and Windows DLLs --- build2/cc/link-rule.cxx | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'build2/cc/link-rule.cxx') diff --git a/build2/cc/link-rule.cxx b/build2/cc/link-rule.cxx index a2f2381..138ae9d 100644 --- a/build2/cc/link-rule.cxx +++ b/build2/cc/link-rule.cxx @@ -1238,6 +1238,12 @@ namespace build2 // Linking a library to a shared library or executable. // + // Note: on Windows shared library could be the DLL with unknown + // location (empty path). See search_library() for details. + // + if (l->path ().empty () && l->member != nullptr) // Binless. + return; + // On Windows a shared library is a DLL with the import library as // a first ad hoc group member. MinGW though can link directly to // DLLs (see search_library() for details). @@ -1247,9 +1253,6 @@ namespace build2 tclass == "windows") l = &l->member->as (); - if (l->path ().empty ()) // Binless. - return; - string p (relative (l->path ()).string ()); if (f & lflag_whole) @@ -1349,6 +1352,16 @@ namespace build2 if (d.li.type == otype::a && !lu) return; + // Note: on Windows shared library could be the DLL with unknown + // location (empty path). See search_library() for details. + // + if (l->path ().empty () && l->member != nullptr) // Binless. + return; + + // Check if this library renders us out of date. + // + d.update = d.update || l->newer (d.mt); + // On Windows a shared library is a DLL with the import library as a // first ad hoc group member. MinGW though can link directly to DLLs // (see search_library() for details). @@ -1358,13 +1371,6 @@ namespace build2 tclass == "windows") l = &l->member->as (); - if (l->path ().empty ()) // Binless. - return; - - // Check if this library renders us out of date. - // - d.update = d.update || l->newer (d.mt); - d.cs.append (f); hash_path (d.cs, l->path (), d.out_root); } -- cgit v1.1