This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt][TSan] Add TSan runtime support for Go on linux-aarch64.
ClosedPublic

Authored by aadg on Sep 17 2018, 5:02 AM.

Details

Summary

This patch adds TSan runtime support for Go on linux-aarch64
platforms. This enables people working on golang to implement their
platform/language part of the TSan support.

Basic testing is done with lib/tsan/go/buildgo.sh. Additional testing will be
done as part of the work done in the Go project.

Patch by Fangming Fang <Fangming.Fang@arm.com>.

Diff Detail

Repository
rL LLVM

Event Timeline

aadg created this revision.Sep 17 2018, 5:02 AM

Hi Fangming,

Is there a Go issue for linux/arm64 support? Please CC me on it and/or file it if it does not exist.
Are there already some designated people to do the Go part?

dvyukov added inline comments.Sep 17 2018, 6:45 AM
lib/tsan/go/buildgo.sh
144 ↗(On Diff #165743)

Please don't duplicate all flags, and instead add arm64-specific flags below, like it is done for amd64 and ppc64le.

164 ↗(On Diff #165743)

Please don't duplicate whole command line. If -m64 breaks arm64, create ARCHCFLAGS, populate it with -m64 for amd64 and ppc64le, add ARCHCFLAGS to FLAGS and here.

lib/tsan/rtl/tsan_platform.h
713 ↗(On Diff #165743)

Do we plan to support more vma sizes? If not, then it can make sense to use the generic IsAppMemImpl<Mapping>(mem) version without the switch, because it's still a load and check of the global var per memory access.

aadg added a comment.Sep 18 2018, 4:39 AM

There is a Go issue opened : https://github.com/golang/go/issues/25682

Fangming is working on adding the Go part. I (Arnaud) is helping him with upstreaming the compiler-rt part.

aadg added a comment.Sep 18 2018, 4:45 AM

We will update this patch shortly with your comments addressed.

Thanks for reviewing !

lib/tsan/go/buildgo.sh
144 ↗(On Diff #165743)

Sure, we will fix this.

164 ↗(On Diff #165743)

Yes, will do.

lib/tsan/rtl/tsan_platform.h
713 ↗(On Diff #165743)

39 can not be supported, but supporting other VMA sizes (42) is intended.

aadg updated this revision to Diff 165967.Sep 18 2018, 7:06 AM

Address review comments.

dvyukov accepted this revision.Sep 18 2018, 7:49 AM

Looks good to me

This revision is now accepted and ready to land.Sep 18 2018, 7:49 AM
This revision was automatically updated to reflect the committed changes.