From 139e1875d3b3dc31a6ea964f6ff3912fed32c4a2 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Thu, 22 Dec 2011 04:29:41 +0000 Subject: PPC: fix "Warning: FOO uses hard float, BAR uses soft float". It appears that with recent versions of GCC the explicit "-mhard-float" command line option takes precedence over the ``asm(".gnu_attribute 4, 2");'' in the source file, so this no longer helps to avoid the warnings we get when linking code that uses FP instructions with other code that was built using soft-float. We can remove the ".gnu_attribute" (which appears to carry no other information, at least so far) from the object files, but we also have to make sure we don't pull in the __gcc_qsub() and __gcc_qmul() functions from the standard libgcc, as these would again "infect" our linking. We copy this code from: gcc-4.2.2/gcc/config/rs6000/darwin-ldouble.c This old version was chosen because it was still available under a compatible license (GCC v2+). The file was stripped down to the needed parts, and reformatted so it passes checkpatch with only one warning (do not add new typedefs). Signed-off-by: Wolfgang Denk Cc: Kumar Gala Cc: Stefan Roese Cc: Andy Fleming Cc: Kim Phillips Tested-by: Stefan Roese Tested-by: Anatolij Gustschin --- post/lib_powerpc/fpu/Makefile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'post/lib_powerpc/fpu/Makefile') diff --git a/post/lib_powerpc/fpu/Makefile b/post/lib_powerpc/fpu/Makefile index b97ad6fbc8..5d0e52dc31 100644 --- a/post/lib_powerpc/fpu/Makefile +++ b/post/lib_powerpc/fpu/Makefile @@ -24,10 +24,23 @@ include $(TOPDIR)/config.mk LIB = libpost$(ARCH)fpu.o -COBJS-$(CONFIG_HAS_POST) += fpu.o 20001122-1.o 20010114-2.o 20010226-1.o 980619-1.o -COBJS-$(CONFIG_HAS_POST) += acc1.o compare-fp-1.o mul-subnormal-single-1.o +COBJS-$(CONFIG_HAS_POST) += 20001122-1.o +COBJS-$(CONFIG_HAS_POST) += 20010114-2.o +COBJS-$(CONFIG_HAS_POST) += 20010226-1.o +COBJS-$(CONFIG_HAS_POST) += 980619-1.o +COBJS-$(CONFIG_HAS_POST) += acc1.o +COBJS-$(CONFIG_HAS_POST) += compare-fp-1.o +COBJS-$(CONFIG_HAS_POST) += fpu.o +COBJS-$(CONFIG_HAS_POST) += mul-subnormal-single-1.o + +COBJS-$(CONFIG_HAS_POST) += darwin-ldouble.o include $(TOPDIR)/post/rules.mk CFLAGS := $(shell echo $(CFLAGS) | sed s/-msoft-float//) CFLAGS += -mhard-float -fkeep-inline-functions + +$(obj)%.o: %.c + $(CC) $(ALL_CFLAGS) -o $@.fp $< -c + $(OBJCOPY) -R .gnu.attributes $@.fp $@ + rm -f $@.fp -- cgit v1.2.1