This is an archive of the discontinued LLVM Phabricator instance.

[tsan, go] fix Go windows build
ClosedPublic

Authored by randall77 on Oct 7 2019, 2:59 PM.

Details

Summary

Don't use weak exports when building tsan into a shared library for Go. gcc can't handle the pragmas used to make the weak references.

Include files that have been added since the last update to build.bat. (We should really find a better way to list all the files needed.)

Add windows version defines (WINVER and _WIN32_WINNT) to get AcquireSRWLockExclusive and ReleaseSRWLockExclusive defined.

Define GetProcessMemoryInfo to use the kernel32 version. This is kind of a hack, the windows header files should do this translation for us. I think we're not in the right family partition (we're using Desktop, but that translation only happens for App and System partitions???), but hacking the family partition seems equally gross and I have no idea what the consequences of that might be.

Patch by Keith Randall.

Diff Detail

Event Timeline

randall77 created this revision.Oct 7 2019, 2:59 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 7 2019, 2:59 PM
Herald added subscribers: llvm-commits, Restricted Project, delcypher. · View Herald Transcript
randall77 edited the summary of this revision. (Show Details)
randall77 updated this revision to Diff 223668.Oct 7 2019, 3:05 PM

Missing two -D options

randall77 updated this revision to Diff 223670.Oct 7 2019, 3:07 PM

rebasing attempt 1

vitalybuka accepted this revision.Oct 7 2019, 3:11 PM
vitalybuka added inline comments.
lib/tsan/go/build.bat
52 ↗(On Diff #223670)

For consistency could you split these 1-per-line?

This revision is now accepted and ready to land.Oct 7 2019, 3:11 PM
vitalybuka added inline comments.Oct 7 2019, 3:37 PM
lib/tsan/go/build.bat
52 ↗(On Diff #223670)

Ah, don't bother
You likely have no commiter access, so someone else will have to land it.
I'll reformat and land.

vitalybuka edited the summary of this revision. (Show Details)Oct 7 2019, 3:40 PM
vitalybuka retitled this revision from fix Go windows build to [tsan, go] fix Go windows build.Oct 7 2019, 4:07 PM

Vitaly, thanks for all your help!

Harbormaster completed remote builds in B39110: Diff 223668.
Harbormaster completed remote builds in B39111: Diff 223670.
This revision was automatically updated to reflect the committed changes.