Author: dim
Date: Mon Apr 16 21:36:55 2012
New Revision: 234356
URL: http://svn.freebsd.org/changeset/base/234356

Log:
  Work around an issue on 32-bit PowerPC, where clang executable can get
  too big, causing 'relocation truncated to fit' errors at link time.
  
  Reviewed by:  nwhitehorn

Modified:
  head/gnu/lib/csu/Makefile
  head/lib/clang/clang.build.mk
  head/lib/csu/powerpc/Makefile

Modified: head/gnu/lib/csu/Makefile
==============================================================================
--- head/gnu/lib/csu/Makefile   Mon Apr 16 21:28:04 2012        (r234355)
+++ head/gnu/lib/csu/Makefile   Mon Apr 16 21:36:55 2012        (r234356)
@@ -34,6 +34,7 @@ CFLAGS+=      -include osreldate.h
 .if ${MACHINE_CPUARCH} == "powerpc"
 TGTOBJS=       crtsavres.o
 SRCS+=         crtsavres.asm
+CFLAGS+=       -mlongcall
 .endif
 .if ${MACHINE_CPUARCH} == "sparc64"
 TGTOBJS=       crtfastmath.o

Modified: head/lib/clang/clang.build.mk
==============================================================================
--- head/lib/clang/clang.build.mk       Mon Apr 16 21:28:04 2012        
(r234355)
+++ head/lib/clang/clang.build.mk       Mon Apr 16 21:36:55 2012        
(r234356)
@@ -11,6 +11,12 @@ CFLAGS+=-I${LLVM_SRCS}/include -I${CLANG
 # LLVM is not strict aliasing safe as of 12/31/2011
 CFLAGS+= -fno-strict-aliasing
 
+# Work around an issue on 32-bit PowerPC, where the clang executable can get
+# too big, causing 'relocation truncated to fit' errors at link time.
+.if ${MACHINE_ARCH} == "powerpc"
+CFLAGS+=-mlongcall
+.endif
+
 TARGET_ARCH?=  ${MACHINE_ARCH}
 
CFLAGS+=-DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_ARCH:C/amd64/x86_64/}-unknown-freebsd10.0\"
 

Modified: head/lib/csu/powerpc/Makefile
==============================================================================
--- head/lib/csu/powerpc/Makefile       Mon Apr 16 21:28:04 2012        
(r234355)
+++ head/lib/csu/powerpc/Makefile       Mon Apr 16 21:36:55 2012        
(r234356)
@@ -6,7 +6,8 @@ SRCS=           crt1.c crti.S crtn.S
 OBJS=          ${SRCS:N*.h:R:S/$/.o/g}
 OBJS+=         Scrt1.o gcrt1.o
 CFLAGS+=       -I${.CURDIR}/../common \
-               -I${.CURDIR}/../../libc/include
+               -I${.CURDIR}/../../libc/include \
+               -mlongcall
 
 all: ${OBJS}
 
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to