[PATCH] D75849: [compiler-rt] Allow golang race detector to run on musl-c

Tomas Volf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 26 07:01:04 PDT 2020


graywolf-at-work marked 2 inline comments as done.
graywolf-at-work added inline comments.


================
Comment at: compiler-rt/lib/tsan/go/buildgo.sh:172
+# Verify that no glibc specific code is present
+if nm race_$SUFFIX.syso | grep -q __libc_; then
+	printf -- '%s seems to link to libc\n' "race_$SUFFIX.syso"
----------------
dyung wrote:
> I believe this should be $DIR/race_$SUFFIX.syso otherwise it won't find the file.
That is correct, I'm sorry for missing that:

```
>From b518ffeb8e2d4e71809304a3e926db4daa0dda1b Mon Sep 17 00:00:00 2001
From: Tomas Volf <tomas.volf at showmax.com>
Date: Thu, 26 Mar 2020 14:56:38 +0100
Subject: [PATCH] [compiler-rt][tsan][go] Fix check for linking against libc

---
 compiler-rt/lib/tsan/go/buildgo.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler-rt/lib/tsan/go/buildgo.sh b/compiler-rt/lib/tsan/go/buildgo.sh
index 5156bd6f67d..72627324ae4 100755
--- a/compiler-rt/lib/tsan/go/buildgo.sh
+++ b/compiler-rt/lib/tsan/go/buildgo.sh
@@ -169,7 +169,7 @@ $CC $DIR/gotsan.cpp -c -o $DIR/race_$SUFFIX.syso $FLAGS $CFLAGS
 $CC $OSCFLAGS $ARCHCFLAGS test.c $DIR/race_$SUFFIX.syso -g -o $DIR/test $OSLDFLAGS $LDFLAGS

 # Verify that no glibc specific code is present
-if nm race_$SUFFIX.syso | grep -q __libc_; then
+if nm $DIR/race_$SUFFIX.syso | grep -q __libc_; then
        printf -- '%s seems to link to libc\n' "race_$SUFFIX.syso"
        exit 1
 fi
--
2.25.1
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75849/new/

https://reviews.llvm.org/D75849





More information about the llvm-commits mailing list