From ac127b132a7a5f356e3a9b7bf7c3b74f9469bf6e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 5 May 2022 10:56:53 +0200 Subject: Recognize -pthread as king of -l in *.libs --- libbuild2/cc/link-rule.cxx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'libbuild2/cc/link-rule.cxx') diff --git a/libbuild2/cc/link-rule.cxx b/libbuild2/cc/link-rule.cxx index f8414c9..0c7c0c2 100644 --- a/libbuild2/cc/link-rule.cxx +++ b/libbuild2/cc/link-rule.cxx @@ -156,7 +156,7 @@ namespace build2 { if (s[0] == '-') { - // -l, -l + // -l, -l (Note: not -pthread, which is system) // if (s[1] == 'l') { @@ -1288,7 +1288,7 @@ namespace build2 } // Another thing we must check is for the presence of any simple - // libraries (-lpthread, shell32.lib, etc) in *.export.libs. See + // libraries (-lm, shell32.lib, etc) in *.export.libs. See // process_libraries() for details. // if (rec_binless) @@ -1522,6 +1522,16 @@ namespace build2 // represent it as an exe{} member to make sure it gets installed // next to the main .js file. // + // @@ Note that our recommendation is to pass -pthread in *.libs + // but checking that is not straightforward (it could come from + // one of the libraries that we are linking). We could have called + // append_libraries() (similar to $x.lib_libs()) and then looked + // there. But this is quite heavy handed and it's not clear this + // is worth the trouble since the -pthread support in Emscripten + // is quite high-touch (i.e., it's not like we can write a library + // that starts some threads and then run its test as on any other + // POSIX platform). + // if (find_option ("-pthread", cmode) || find_option ("-pthread", t, c_loptions) || find_option ("-pthread", t, x_loptions)) -- cgit v1.1