diff --git a/llvm/utils/gn/build/libs/pthread/BUILD.gn b/llvm/utils/gn/build/libs/pthread/BUILD.gn --- a/llvm/utils/gn/build/libs/pthread/BUILD.gn +++ b/llvm/utils/gn/build/libs/pthread/BUILD.gn @@ -2,12 +2,11 @@ config("pthread_config") { visibility = [ ":pthread" ] - libs = [ "pthread" ] + ldflags = [ "-pthread" ] } group("pthread") { - # On Android, bionic has built-in support for pthreads. - if (llvm_enable_threads && current_os != "win" && current_os != "android") { - public_configs = [ ":pthread_config" ] + if (llvm_enable_threads && current_os != "win") { + all_dependent_configs = [ ":pthread_config" ] } } diff --git a/llvm/utils/gn/build/toolchain/BUILD.gn b/llvm/utils/gn/build/toolchain/BUILD.gn --- a/llvm/utils/gn/build/toolchain/BUILD.gn +++ b/llvm/utils/gn/build/toolchain/BUILD.gn @@ -88,7 +88,7 @@ if (current_os == "mac") { command = "$ld {{ldflags}} -o $outfile {{libs}} {{inputs}}" } else { - command = "$ld {{ldflags}} -o $outfile {{libs}} -Wl,--start-group {{inputs}} -Wl,--end-group" + command = "$ld {{ldflags}} -o $outfile -Wl,--start-group {{libs}} {{inputs}} -Wl,--end-group" } description = "LINK $outfile" outputs = [ outfile ]