From 1246576216e94191d5e4c3c22bc8a291a2ebbf1e Mon Sep 17 00:00:00 2001 From: Vaclav Slavik Date: Wed, 26 Jun 2013 08:51:49 +0200 Subject: [PATCH] Don't pass -pthread to the linker on OS X. The -pthread option is noop with GCC on Darwin, because the necessary runtime is included in libSystem; GCC silently accepts it for cross-platform compatibility. Unfortunately, Clang does not and issues a warning: clang: warning: argument unused during compilation: '-pthread' This is arguably a bug in Clang -- see http://llvm.org/bugs/show_bug.cgi?id=7798. But since the bug was filed almost three years ago and nobody got around to fixing it yet, it seems prudent to just tweak the gnu-osx toolset accordingly. Fortunately, gcc still works just fine without -pthread, so the fix is simple enough. --- src/bkl/plugins/gnu.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bkl/plugins/gnu.py b/src/bkl/plugins/gnu.py index 6f6db633..0d61e259 100644 --- a/src/bkl/plugins/gnu.py +++ b/src/bkl/plugins/gnu.py @@ -200,7 +200,7 @@ def _linker_flags(self, toolset, target): cmd += target.type.get_link_options(target) if toolset.extra_link_flags: cmd.append(LiteralExpr(toolset.extra_link_flags)) - if target["multithreading"]: + if toolset.pthread_ld_flags and target["multithreading"]: cmd.append(LiteralExpr(toolset.pthread_ld_flags)) return cmd @@ -436,6 +436,7 @@ class OSXGnuToolset(GnuToolset): pic_flags = None soname_flags = None + pthread_ld_flags = None def on_footer(self, file, module): for t in module.targets.itervalues():