summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-04-16 21:36:55 +0000
committerdim <dim@FreeBSD.org>2012-04-16 21:36:55 +0000
commit0b9f8d0983917f537b2e7566d4e7756a889d7407 (patch)
tree09f419ce639b114c9f5bad0aeb2e8cead0f25e8e
parent97ce6d5fb11b4c08790e829a51412306947c53c0 (diff)
downloadFreeBSD-src-0b9f8d0983917f537b2e7566d4e7756a889d7407.zip
FreeBSD-src-0b9f8d0983917f537b2e7566d4e7756a889d7407.tar.gz
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
-rw-r--r--gnu/lib/csu/Makefile1
-rw-r--r--lib/clang/clang.build.mk6
-rw-r--r--lib/csu/powerpc/Makefile3
3 files changed, 9 insertions, 1 deletions
diff --git a/gnu/lib/csu/Makefile b/gnu/lib/csu/Makefile
index 4999d06..1c31a98 100644
--- a/gnu/lib/csu/Makefile
+++ b/gnu/lib/csu/Makefile
@@ -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
diff --git a/lib/clang/clang.build.mk b/lib/clang/clang.build.mk
index a14918d..7437a1d 100644
--- a/lib/clang/clang.build.mk
+++ b/lib/clang/clang.build.mk
@@ -11,6 +11,12 @@ CFLAGS+=-I${LLVM_SRCS}/include -I${CLANG_SRCS}/include \
# 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\"
diff --git a/lib/csu/powerpc/Makefile b/lib/csu/powerpc/Makefile
index 1e1d1fa..a3e0cab 100644
--- a/lib/csu/powerpc/Makefile
+++ b/lib/csu/powerpc/Makefile
@@ -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}
OpenPOWER on IntegriCloud