Date: Sun, 22 May 2011 16:32:45 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r222183 - head/lib/clang Message-ID: <201105221632.p4MGWjUb081825@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Sun May 22 16:32:44 2011 New Revision: 222183 URL: http://svn.freebsd.org/changeset/base/222183 Log: 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. :) Modified: head/lib/clang/clang.build.mk Modified: head/lib/clang/clang.build.mk ============================================================================== --- head/lib/clang/clang.build.mk Sun May 22 15:24:56 2011 (r222182) +++ head/lib/clang/clang.build.mk Sun May 22 16:32:44 2011 (r222183) @@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105221632.p4MGWjUb081825>