]> Cypherpunks repositories - gostls13.git/commitdiff
build: diagnose Ubuntu's buggy copy of gold
authorRuss Cox <rsc@golang.org>
Fri, 18 Mar 2011 22:23:00 +0000 (18:23 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 18 Mar 2011 22:23:00 +0000 (18:23 -0400)
R=iant, dsymonds
CC=golang-dev
https://golang.org/cl/4300041

src/make.bash

index d9ca40d4272d9a7fb8954a3364c02c501312965d..79e368cb50f13bf2cf5a693a12ef82f59a6c09cf 100755 (executable)
@@ -10,6 +10,17 @@ if [ ! -f env.bash ]; then
 fi
 . ./env.bash
 
+if ld --version 2>&1 | grep 'gold.*2\.20' >/dev/null; then
+       echo 'ERROR: Your system has gold 2.20 installed.'
+       echo 'This version is shipped by Ubuntu even though'
+       echo 'it is known not to work on Ubuntu.'
+       echo 'Binaries built with this linker are likely to fail in mysterious ways.'
+       echo
+       echo 'Run sudo apt-get remove binutils-gold.'
+       echo
+       exit 1
+fi
+
 # Create target directories
 if [ "$GOBIN" = "$GOROOT/bin" ]; then
        mkdir -p "$GOROOT/bin"