diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2024-02-14 18:35:48 +0100 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2024-02-15 13:11:33 +0100 |
commit | 09f90fac9092de13a71723f849794474831fd678 (patch) | |
tree | 2b300d76bb1ad7133fddb2fe72face269bbaeec6 /src/buildtool/execution_api/execution_service/TARGETS | |
parent | bda3dabe37fdde648f90ce5aa4b20d7336570cf0 (diff) | |
download | justbuild-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/TARGETS | 3 |
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"] |