[PATCH] [TSan][MIPS64] Fix go build for MIPS64

Sagar Thakur Sagar.Thakur at imgtec.com
Mon Feb 16 02:38:46 PST 2015


REPOSITORY
  rL LLVM

================
Comment at: lib/tsan/go/buildgo.sh:54
@@ -49,2 +53,3 @@
 		../../sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
+		../rtl/tsan_platform_linux.cc
 	"
----------------
I have shifed ../rtl/tsan_platform_linux.h down in the list because :

The file asm/stat is included in sanitizer_linux.cc file only for mips.
And sys/stat is included in ../rtl/tsan_platform_linux.h, which includes bits/stat.
Therefore when the structure stat defined in asm/stat.h included from sanitizer_linux.cc is compiled, `st_atime` in struct stat is interpreted as the macro defined in bits/stat.h, where as it is only the variable name. Because of this reason we were getting the following error in Go runtime check :

```In file included from ./gotsan.cc:9678:
/usr/include/mips64el-linux-gnuabi64/asm/stat.h:113:16: error: expected ';' at end of declaration list
        unsigned int            st_atime;
                                ^
/usr/include/mips64el-linux-gnuabi64/bits/stat.h:166:26: note: expanded from macro 'st_atime'
# define st_atime st_atim.tv_sec        /* Backward compatibility.  */```

I have also tested this patch on x86_64.

http://reviews.llvm.org/D7582

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list