summaryrefslogtreecommitdiff
path: root/src/quietgcc.bash
diff options
context:
space:
mode:
Diffstat (limited to 'src/quietgcc.bash')
-rwxr-xr-xsrc/quietgcc.bash11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/quietgcc.bash b/src/quietgcc.bash
index dd3db3642..748fc593e 100755
--- a/src/quietgcc.bash
+++ b/src/quietgcc.bash
@@ -4,7 +4,7 @@
# license that can be found in the LICENSE file.
# The master for this file is $GOROOT/src/quietgcc.bash
-# Changes made to $HOME/bin/quietgcc will be overridden.
+# Changes made to $GOBIN/quietgcc will be overridden.
# Gcc output that we don't care to see.
ignore=': error: .Each undeclared identifier'
@@ -22,14 +22,15 @@ if test "$gcc" = "@C""C@"; then
gcc=gcc
fi
-# If this is a 64-bit machine, compile 64-bit versions of
-# the host tools, to match the native ptrace.
-case "`uname -m -p`" in
+# Build 64-bit binaries on 64-bit systems, unless GOHOSTARCH=386.
+case "$(uname -m -p)-$GOHOSTARCH" in
+*x86_64*-386 | *amd64*-386)
+ gcc="$gcc -m32"
+ ;;
*x86_64* | *amd64*)
gcc="$gcc -m64"
esac
-
# Run gcc, save error status, redisplay output without noise, exit with gcc status.
tmp=/tmp/qcc.$$.$USER.out
$gcc -Wall -Wno-sign-compare -Wno-missing-braces \