summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/execution_service/TARGETS
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2024-02-14 18:35:48 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2024-02-15 13:11:33 +0100
commit09f90fac9092de13a71723f849794474831fd678 (patch)
tree2b300d76bb1ad7133fddb2fe72face269bbaeec6 /src/buildtool/execution_api/execution_service/TARGETS
parentbda3dabe37fdde648f90ce5aa4b20d7336570cf0 (diff)
downloadjustbuild-09f90fac9092de13a71723f849794474831fd678.tar.gz
Replace glibc sync stubs when linking pthreads
... glibc provides synchronization stubs for single-threaded environments as weak symobls. When linking pthreads, these weak symbols must be replaced by the strong symbols provided by the pthread library. For dynamically linking pthreads, this is done automatically. However, to support this for static linking, we must ensure to link the whole archive.
Diffstat (limited to 'src/buildtool/execution_api/execution_service/TARGETS')
-rw-r--r--src/buildtool/execution_api/execution_service/TARGETS3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/buildtool/execution_api/execution_service/TARGETS b/src/buildtool/execution_api/execution_service/TARGETS
index 2d8492c6..6dfb45c2 100644
--- a/src/buildtool/execution_api/execution_service/TARGETS
+++ b/src/buildtool/execution_api/execution_service/TARGETS
@@ -19,7 +19,8 @@
, "operation_cache"
, ["src/utils/cpp", "verify_hash"]
]
- , "private-ldflags": ["-pthread"]
+ , "private-ldflags":
+ ["-pthread", "-Wl,--whole-archive,-lpthread,--no-whole-archive"]
}
, "ac_server":
{ "type": ["@", "rules", "CC", "library"]