From 4efa075cf3b7d772bcb1b82d175dd6ddb0cd29c5 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 6 Aug 2004 16:11:43 +0000 Subject: Joakim Tjernlund writes: This patch makes -fpic work for PCC and optimzes the relcation by moving the cache flushing stuff to JMP relocs only. Actually PPCs ldso can only handle small GOT tables(<=8192 entries)anyhow, so it makes little sense to compile PPC with -fPIC. libuClibc shrunk from 340724 to 330780 bytes with -fpic. --- Rules.mak | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Rules.mak') diff --git a/Rules.mak b/Rules.mak index 1dbd392b2..9d408d364 100644 --- a/Rules.mak +++ b/Rules.mak @@ -88,7 +88,15 @@ export RUNTIME_PREFIX DEVEL_PREFIX ARFLAGS:=r OPTIMIZATION:= -PICFLAG:=-fPIC + +# PowerPC can hold 8192 entries in its GOT with -fpic which is more than enough. Therefore use +# -fpic which will reduce code size and generates faster code. +ifeq ($(strip $(TARGET_ARCH)),powerpc) + PICFLAG:=-fpic +else + PICFLAG:=-fPIC +endif + # Some nice CPU specific optimizations ifeq ($(strip $(TARGET_ARCH)),i386) OPTIMIZATION+=$(call check_gcc,-mpreferred-stack-boundary=2,) -- cgit v1.2.3