summaryrefslogtreecommitdiff
path: root/arch/powerpc/lib/Makefile
diff options
context:
space:
mode:
authorKyle Moffett <Kyle.D.Moffett@boeing.com>2011-02-23 06:40:38 +0000
committerWolfgang Denk <wd@denx.de>2011-12-07 23:04:32 +0100
commit01baa05643001638b6d7d6a26123ce04f6c7154c (patch)
tree569c3ace5a9a75f7ac0941aee10b73ae136321cb /arch/powerpc/lib/Makefile
parent1086c5d6f8541460f0f10e4a302d8aac27e0e6e0 (diff)
downloadu-boot-imx-01baa05643001638b6d7d6a26123ce04f6c7154c.zip
u-boot-imx-01baa05643001638b6d7d6a26123ce04f6c7154c.tar.gz
u-boot-imx-01baa05643001638b6d7d6a26123ce04f6c7154c.tar.bz2
powerpc: Minimal private libgcc to build on Debian
Standard Debian powerpc and powerpcspe systems only include hard-float libgcc in their native compilers, which causes scary build warnings when building U-Boot. Debian and other PowerPC-supporting distributions used to provide libgcc and other libraries in a "nof" (soft-float) form in the "multilib" packages. As they were completely unused by the distribution and therefore tended to be very buggy it was decided to save some time on the part of the maintainers and build-servers by removing them. Admittedly, right now the linker warnings do not indicate any problems, as the included routines do not use any floating point at all. The concern is that if floating-point code were ever added it might cause hard-float code to be unexpectedly included in U-Boot without generating a hard error. This would cause unexplained crashes or indeterminate results at runtime. The easiest way to resolve this is to borrow the routines that U-Boot needs from the Linux kernel, which has the same issue. Specifically, the routines are: _ashldi3(), _ashrdi3(), and _lshrdi3(). They were borrowed from arch/powerpc/kernel/misc_32.S as of v2.6.38-rc5, commit 85e2efbb1db9a18d218006706d6e4fbeb0216213, and are GPLv2+. The Makefile framework was copied from the U-Boot ARM port. Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com> Cc: Wolfgang Denk <wd@denx.de> Cc: Kim Phillips <kim.phillips@freescale.com> Cc: Andy Fleming <afleming@gmail.com> Cc: Kumar Gala <kumar.gala@freescale.com> Cc: Stefan Roese <sr@denx.de>
Diffstat (limited to 'arch/powerpc/lib/Makefile')
-rw-r--r--arch/powerpc/lib/Makefile23
1 files changed, 22 insertions, 1 deletions
diff --git a/arch/powerpc/lib/Makefile b/arch/powerpc/lib/Makefile
index 724d8ee..cdd62a2 100644
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -23,6 +23,19 @@
include $(TOPDIR)/config.mk
+## Build a couple of necessary functions into a private libgcc
+LIBGCC = $(obj)libgcc.o
+GLSOBJS += _ashldi3.o
+GLSOBJS += _ashrdi3.o
+GLSOBJS += _lshrdi3.o
+LGOBJS := $(addprefix $(obj),$(GLSOBJS)) \
+ $(addprefix $(obj),$(GLCOBJS))
+
+## But only build it if the user asked for it
+ifdef USE_PRIVATE_LIBGCC
+TARGETS += $(LIBGCC)
+endif
+
LIB = $(obj)lib$(ARCH).o
SOBJS-y += ppccache.o
@@ -53,9 +66,14 @@ endif
COBJS += $(sort $(COBJS-y))
-SRCS := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+SRCS := $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
+ $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
+TARGETS += $(LIB)
+
+all: $(TARGETS)
+
$(LIB): $(obj).depend $(OBJS)
@if ! $(CROSS_COMPILE)readelf -S $(OBJS) | grep -q '\.fixup.*PROGBITS';\
then \
@@ -65,6 +83,9 @@ $(LIB): $(obj).depend $(OBJS)
fi;
$(call cmd_link_o_target, $(OBJS))
+$(LIBGCC): $(obj).depend $(LGOBJS)
+ $(call cmd_link_o_target, $(LGOBJS))
+
#########################################################################
# defines $(obj).depend target