[PATCH] D77111: Fix buildgo.sh script because of recent changes causing build failures with gcc on linux

Douglas Yung via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 30 18:35:48 PDT 2020


dyung created this revision.
dyung added reviewers: dvyukov, vitalybuka.

A recent commit ad1466f8cbc520b2f03e1f6daa78f035bccf21df <https://reviews.llvm.org/rGad1466f8cbc520b2f03e1f6daa78f035bccf21df> to sanitizer_linux.cpp added code that gcc in C++11 mode cannot handle. Specifically, it added code that included binary literals that gcc in c++11 mode gives an error on. For example, here is the error I get on my local machine:

gotsan.cpp:14071:16: error: missing terminating ' character [-Werror]

  case 0b10'010:  // c.lwsp (rd != x0)
           ^

Clang does not give an error on the same code. I found that changing the compiler standard used to c++14 where this is officially supported passes with both gcc and clang, so this should hopefully fix the issue.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D77111

Files:
  compiler-rt/lib/tsan/go/buildgo.sh


Index: compiler-rt/lib/tsan/go/buildgo.sh
===================================================================
--- compiler-rt/lib/tsan/go/buildgo.sh
+++ compiler-rt/lib/tsan/go/buildgo.sh
@@ -149,7 +149,7 @@
 	cat $F >> $DIR/gotsan.cpp
 done
 
-FLAGS=" -I../rtl -I../.. -I../../sanitizer_common -I../../../include -std=c++11 -Wall -fno-exceptions -fno-rtti -DSANITIZER_GO=1 -DSANITIZER_DEADLOCK_DETECTOR_VERSION=2 $OSCFLAGS $ARCHCFLAGS"
+FLAGS=" -I../rtl -I../.. -I../../sanitizer_common -I../../../include -std=c++14 -Wall -fno-exceptions -fno-rtti -DSANITIZER_GO=1 -DSANITIZER_DEADLOCK_DETECTOR_VERSION=2 $OSCFLAGS $ARCHCFLAGS"
 DEBUG_FLAGS="$FLAGS -DSANITIZER_DEBUG=1 -g"
 FLAGS="$FLAGS -DSANITIZER_DEBUG=0 -O3 -fomit-frame-pointer"
 if [ "$SUFFIX" = "linux_ppc64le" ]; then


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77111.253759.patch
Type: text/x-patch
Size: 778 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200331/0ad58675/attachment-0001.bin>


More information about the llvm-commits mailing list