>>Could I simply add race.go to gofrontend then link the target programs by
the TSAN shared library to make the race detector enabled?

The race detector implementation also includes a compiler component (look
for flag_race in the cmd/compile source code), so that would have to be
ported to gccgo as well, since gccgo uses an entirely different compiler
implementation. There are probably other things as well that would have to
be pulled in.

Than

On Tue, Aug 11, 2020 at 5:02 AM Ting Yuan <[email protected]> wrote:

> Thanks for your reply,
>
> If I'm not confused, the implementation of Go race detector is written in
> go/src/runtime/race <https://goto.google.com/src/runtime/race>.go and its
> TSAN implementation (in C/C++) is dynamic linked to target programs by a
> shared library. Could I simply add race.go to gofrontend then link the
> target programs by the TSAN shared library to make the race detector
> enabled? I know integrating the race detector to gccgo/gollvm can't be done
> as easily as the aforementioned method, but what problems will I encounter
> when I do this.
>
> Thanks, Ting
>
> On Saturday, August 8, 2020 at 12:36:54 AM UTC+8, Ian Lance Taylor wrote:
>>
>> On Thu, Aug 6, 2020 at 11:33 PM Yuan Ting <[email protected]> wrote:
>> >
>> > I know from README that gollvm does not support race detector. Is there
>> any technical problem? Is it possible to use ThreadSanitizer in LLVM to
>> implement a workaround race detector in gollvm?
>>
>> ThreadSanitizer knows a great deal about the behavior of C library
>> functions.  In order to use it with GoLLVM, it would be necessary to
>> teach it about the behavior of Go library functions.  This is not
>> impossible--the same work was done for the Go race detector--but
>> somebody would have to do the work.
>>
>> Ian
>>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/c6d696b5-4918-4926-9068-ff3cd2ae1118o%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/c6d696b5-4918-4926-9068-ff3cd2ae1118o%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2BUr55GM1qvs6yaNFHqzGXSLYudFGxhRQusuO2X9jxwfo9T5Kw%40mail.gmail.com.

Reply via email to