Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jun 2010 06:23:47 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r209153 - head/lib/clang
Message-ID:  <201006140623.o5E6Nl4w067862@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Mon Jun 14 06:23:47 2010
New Revision: 209153
URL: http://svn.freebsd.org/changeset/base/209153

Log:
  Unbreak Clang on PowerPC.
  
  It seems GCC 4.2.1 on PowerPC miscompiles Clang, causing it to crash
  when building even simple Hello World applications. Switch back to -O1
  for this architecture.
  
  Submitted by:	nwhitehorn

Modified:
  head/lib/clang/clang.build.mk

Modified: head/lib/clang/clang.build.mk
==============================================================================
--- head/lib/clang/clang.build.mk	Mon Jun 14 02:56:45 2010	(r209152)
+++ head/lib/clang/clang.build.mk	Mon Jun 14 06:23:47 2010	(r209153)
@@ -8,11 +8,16 @@ CFLAGS+=-I${LLVM_SRCS}/include -I${CLANG
 	-DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \
 	-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG
 
+# Correct for gcc miscompilation when compiling on PPC with -O2
+.if ${MACHINE_ARCH} == "powerpc"
+CFLAGS+= -O1
+.endif
+
 TARGET_ARCH?=	${MACHINE_ARCH}
 # XXX: 8.0, to keep __FreeBSD_cc_version happy
 CFLAGS+=-DLLVM_HOSTTRIPLE=\"${TARGET_ARCH}-undermydesk-freebsd9.0\" \
 	-DCLANG_VENDOR=\"FreeBSD\ \" -DSVN_REVISION=\"104832\" \
-	-DCLANG_VENDOR_SUFFIX=\"\ 20100613\"
+	-DCLANG_VENDOR_SUFFIX=\"\ 20100614\"
 
 .PATH:	${LLVM_SRCS}/${SRCDIR}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006140623.o5E6Nl4w067862>