Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sh: Remove compressed kernel libgcc dependency.

SH-2A is unable to combine the kernel and libgcc objects due to
fundamental disagreements over FDPIC settings. As the kernel already
contains all of the libgcc bits broken out, there's not much need to
bother with the linking anymore, as everything can already be derived
from the lib dir.

This simply plugs in the necessary bits to ensure that everything is
built uniformly, enabling us to wean the compressed build off of explicit
libgcc linking.

Reported-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+19 -3
+19 -3
arch/sh/boot/compressed/Makefile
··· 27 27 $(CONFIG_BOOT_LINK_OFFSET)]') 28 28 endif 29 29 30 - LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) 31 - 32 30 ifeq ($(CONFIG_MCOUNT),y) 33 31 ORIG_CFLAGS := $(KBUILD_CFLAGS) 34 32 KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) ··· 35 37 LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \ 36 38 -T $(obj)/../../kernel/vmlinux.lds 37 39 38 - $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE 40 + # 41 + # Pull in the necessary libgcc bits from the in-kernel implementation. 42 + # 43 + lib1funcs-$(CONFIG_SUPERH32) := ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S \ 44 + lshrsi3.S 45 + lib1funcs-obj := \ 46 + $(addsuffix .o, $(basename $(addprefix $(obj)/, $(lib1funcs-y)))) 47 + 48 + lib1funcs-dir := $(srctree)/arch/$(SRCARCH)/lib 49 + ifeq ($(BITS),64) 50 + lib1funcs-dir := $(addsuffix $(BITS), $(lib1funcs-dir)) 51 + endif 52 + 53 + KBUILD_CFLAGS += -I$(lib1funcs-dir) 54 + 55 + $(addprefix $(obj)/,$(lib1funcs-y)): $(obj)/%: $(lib1funcs-dir)/% FORCE 56 + $(call cmd,shipped) 57 + 58 + $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(lib1funcs-obj) FORCE 39 59 $(call if_changed,ld) 40 60 @: 41 61