This is an archive of the discontinued LLVM Phabricator instance.

[safestack] Enable loongarch64
ClosedPublic

Authored by tangyouling on Dec 6 2022, 6:19 PM.

Details

Summary

Enable safestack on loongarch64.

Some test cases will fail on loongarch, it will be fixed in glibc,
Links: https://sourceware.org/pipermail/libc-alpha/2022-November/143641.html

Diff Detail

Event Timeline

tangyouling created this revision.Dec 6 2022, 6:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 6 2022, 6:19 PM
tangyouling requested review of this revision.Dec 6 2022, 6:19 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 6 2022, 6:19 PM
$ make check-safestack
Testing Time: 1.48s
  Unsupported: 1
  Passed     : 8

2 warning(s) in tests
[100%] Built target check-safestack
vitalybuka added inline comments.
compiler-rt/lib/safestack/safestack_platform.h
100

I can be too early for libc call, syscall should be used here

tangyouling added inline comments.Dec 7 2022, 12:11 AM
compiler-rt/lib/safestack/safestack_platform.h
100

I can be too early for libc call, syscall should be used here

Under the current glibc, if syscall is used, the test will fail on loongarch.
It is of course possible to wait for the glibc fix patch to be merged in and just enable safestack without making this change.

xen0n added inline comments.Dec 7 2022, 12:34 AM
compiler-rt/lib/safestack/safestack_platform.h
100

I can be too early for libc call, syscall should be used here

Under the current glibc, if syscall is used, the test will fail on loongarch.
It is of course possible to wait for the glibc fix patch to be merged in and just enable safestack without making this change.

Or just patch the glibc in your builder instance so we can continue invoking the raw syscall wrapper here? The glibc change eventually will appear upstream so at that point code here won't need to be changed again.

tangyouling added inline comments.Dec 7 2022, 1:00 AM
compiler-rt/lib/safestack/safestack_platform.h
100

I can be too early for libc call, syscall should be used here

Under the current glibc, if syscall is used, the test will fail on loongarch.
It is of course possible to wait for the glibc fix patch to be merged in and just enable safestack without making this change.

Or just patch the glibc in your builder instance so we can continue invoking the raw syscall wrapper here? The glibc change eventually will appear upstream so at that point code here won't need to be changed again.

Yes, then I will remove this change.

Use the syscall method and remove the relevant changes.

tangyouling edited the summary of this revision. (Show Details)Dec 7 2022, 5:44 PM
tangyouling added a reviewer: vitalybuka.
This revision is now accepted and ready to land.Dec 7 2022, 5:47 PM
vitalybuka accepted this revision.Dec 7 2022, 5:56 PM
This revision was landed with ongoing or failed builds.Dec 9 2022, 7:49 PM
Closed by commit rG97f370a0a3dc: [safestack] Enable loongarch64 (authored by tangyouling, committed by SixWeining). · Explain Why
This revision was automatically updated to reflect the committed changes.