Added clone implementation for MIPS.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
Hi all,
This patch is important for LSan to work on MIPS64. Without this patch child task in LSan is not able to return control to parent task and puts LSan in infinite wait state.
Are there any comments or any changes required to this patch ?
Hi, sorry for the delay.
It may be worth adding a note that we don't have proper CFI info here either (same as in x86_64 version). Clang probably supports all the necessary directives now, but it's a lot of code (at least in the mips case) for very marginal benefits, so probably not worth doing.
Note also that the glibc implementation appears to have a few differences between 32 and 64 bit mips, so please double check those to make sure they don't affect us.
Otherwise lgtm.
- Added note about CFI directives as suggested by @earthdok.
- Added .cprestore directive in assembly which saves gp register across function call.
Hi @earthdok,
Note also that the glibc implementation appears to have a few differences between 32 and 64 bit mips, so please double check those to make sure they don't affect us.
The only difference between 32-bit and 64-bit in glibc implementation I can see is argument passing to clone syscall. This patch was written according to n64 abi of mips. In case of n64 abi we have argument registers a0 to a5 for syscalls. Therefore this patch will work fine for LSan 64-bit on Mips.
If this code is correct only on MIPS64, then please put it under an appropriate #ifdef such as __mips64.
The code is correct only on MIPS64, therefore we put it under #ifdef(__mips64) as suggested by @earthdok.
Added code to make internal_clone work on 32-bit also.
ASan 32-bit on mips requires internal_clone (). Therefore added in this patch only to avoid breaking ASan 32-bit on mips.
Stoptheworld isn't actually used on 32-bit platforms, and that's the only thing you need clone for. But since you already have the implementation, let's land it. rslgtm