[PATCH] D138489: [tsan] Add tsan support for loongarch64
Youling Tang via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 23 18:43:28 PST 2022
tangyouling added inline comments.
================
Comment at: compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cpp:269
val = FIRST_32_SECOND_64(1152, 1776);
+#elif SANITIZER_LOONGARCH64
+ val = 1936;
----------------
MaskRay wrote:
> We should add new code in this fallback function. The generic code handles all new ports.
>
> It's incorrect to assume that sizeof(pthread) stays 1936 as new glibc versions can add more fields.
> We should add new code in this fallback function. The generic code handles all new ports.
>
> It's incorrect to assume that sizeof(pthread) stays 1936 as new glibc versions can add more fields.
By looking at D119007, I can see that the val value obtained from `_thread_db_sizeof_pthread` is 1856 (glibc version 2.36).
Is it correct to change the `ThreadDescriptorSizeFallback` to the following,
```
#elif SANITIZER_LOONGARCH64
val = 1856;
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138489/new/
https://reviews.llvm.org/D138489
More information about the cfe-commits
mailing list