Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index 7eb4fb3f3e8886c46ed457de778f4f3ff637838a..95996abcec489f52a20da2d9fb3eb2b7f742179d 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -421,6 +421,13 @@ config("compiler") { |
cflags += [ "-B$binutils_path" ] |
} |
+ if (is_linux) { |
+ cflags += [ "-pthread" ] |
+ # Do not use the -pthread ldflag here since it becomes a no-op |
+ # when using -nodefaultlibs, which would cause an unused argument |
+ # error. "-lpthread" is added in //build/config:default_libs. |
+ } |
+ |
# Clang-specific compiler flags setup. |
# ------------------------------------ |
if (is_clang) { |
@@ -545,16 +552,6 @@ config("compiler") { |
} |
} |
-# This is separate from :compiler (and not even a sub-config there) |
-# so that some targets can remove it from the list with: |
-# configs -= [ "//build/config/compiler:pthread" ] |
Nico
2017/06/02 01:48:12
Huh, I'm surprised nobody seems to do this.
|
-config("pthread") { |
- if (is_linux) { |
- cflags = [ "-pthread" ] |
- ldflags = [ "-pthread" ] |
- } |
-} |
- |
# This provides the basic options to select the target CPU and ABI. |
# It is factored out of "compiler" so that special cases can use this |
# without using everything that "compiler" brings in. Options that |