Skip to content

Commit 77af47d

Browse files
committed
cmd/racebuild: add linux/loong64 support
LLVM has linux/loong64 ThreadSanitizer support now [1], this patch add support for building race_linux_loong64.syso from it. [1] llvm/llvm-project#72819 Change-Id: I87ec06b6ab4f1e1226ba2fcfb57459431a11faa1 Reviewed-on: https://go-review.googlesource.com/c/build/+/655775 Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Cherry Mui <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Meidan Li <[email protected]>
1 parent 60e4f5a commit 77af47d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

cmd/racebuild/racebuild.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,35 @@ mkdir outdir
390390
cp llvm-project-${REV}/compiler-rt/lib/tsan/go/race_linux_s390x.syso outdir/race_linux_s390x.syso
391391
# free some disk space
392392
rm -r llvm.zip llvm-project-${REV}
393+
(cd go/src && ./race.bash)
394+
`,
395+
},
396+
{
397+
OS: "linux",
398+
Arch: "loong64",
399+
Type: "gotip-linux-loong64",
400+
Script: `#!/usr/bin/env bash
401+
set -e
402+
cat /etc/os-release
403+
# Because LUCI builder is not run as root, these dependencies have been manually installed
404+
# yum install -y gcc-c++ git golang-bin unzip
405+
git clone https://go.googlesource.com/go
406+
pushd go
407+
git checkout $GOREV
408+
if [ "$GOGITOP" != "" ]; then
409+
git fetch https://go.googlesource.com/go "$GOSRCREF"
410+
git $GOGITOP FETCH_HEAD
411+
fi
412+
popd
413+
curl -L -o llvm.zip https://github.com/llvm/llvm-project/archive/${REV}.zip
414+
unzip -q llvm.zip llvm-project-${REV}/compiler-rt/*
415+
(cd llvm-project-${REV}/compiler-rt/lib/tsan/go && ./buildgo.sh)
416+
cp llvm-project-${REV}/compiler-rt/lib/tsan/go/race_linux_loong64.syso go/src/runtime/race
417+
# work around gomote gettar issue #64195
418+
mkdir outdir
419+
cp llvm-project-${REV}/compiler-rt/lib/tsan/go/race_linux_loong64.syso outdir/race_linux_loong64.syso
420+
# free some disk space
421+
rm -r llvm.zip llvm-project-${REV}
393422
(cd go/src && ./race.bash)
394423
`,
395424
},

0 commit comments

Comments
 (0)