summaryrefslogtreecommitdiffstats
path: root/lib/clang
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2011-05-22 16:32:44 +0000
committerdim <dim@FreeBSD.org>2011-05-22 16:32:44 +0000
commitf098bbfef2f55c1a337f9c31e1831d60dd1545af (patch)
tree22629d17f5c5b02c8536635d3b6787972b7dc8d1 /lib/clang
parentf22e5fb539159ae883cb36fc064eee6191f0319d (diff)
downloadFreeBSD-src-f098bbfef2f55c1a337f9c31e1831d60dd1545af.zip
FreeBSD-src-f098bbfef2f55c1a337f9c31e1831d60dd1545af.tar.gz
On amd64, change clang's default triple to 'x86_64-unknown-freebsd9.0',
similar to what we do for binutils. When clang's default triple starts with 'amd64-', it does not pass a proper -target-cpu option to its first stage. This can lead to problems, for example when structs are memcpy'd, and clang erroneously assumes they are 16-byte aligned. It will then use the 'movaps' SSE instruction to implement the copy, which results in a bus error if the struct is really 8-byte aligned. I encountered this issue when gcc's /usr/libexec/cc1 started crashing with SIGBUS, after rebuilding world with clang ToT, but it also affects the version of clang that we have in the tree. We were just lucky until now, apparently. :)
Diffstat (limited to 'lib/clang')
-rw-r--r--lib/clang/clang.build.mk2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/clang/clang.build.mk b/lib/clang/clang.build.mk
index da53455..f443f1d 100644
--- a/lib/clang/clang.build.mk
+++ b/lib/clang/clang.build.mk
@@ -15,7 +15,7 @@ CFLAGS+= -O1
TARGET_ARCH?= ${MACHINE_ARCH}
# XXX: 8.0, to keep __FreeBSD_cc_version happy
-CFLAGS+=-DLLVM_HOSTTRIPLE=\"${TARGET_ARCH}-undermydesk-freebsd9.0\"
+CFLAGS+=-DLLVM_HOSTTRIPLE=\"${TARGET_ARCH:C/amd64/x86_64/}-unknown-freebsd9.0\"
.ifndef LLVM_REQUIRES_EH
CXXFLAGS+=-fno-exceptions
OpenPOWER on IntegriCloud