Skip to content

Commit

Permalink
sh: Remove compressed kernel libgcc dependency.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Paul Mundt committed Jun 6, 2011
1 parent 298c48a commit 363e9f0
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions arch/sh/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ IMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \
$(CONFIG_BOOT_LINK_OFFSET)]')
endif

LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)

ifeq ($(CONFIG_MCOUNT),y)
ORIG_CFLAGS := $(KBUILD_CFLAGS)
KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
Expand All @@ -37,7 +35,25 @@ endif
LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \
-T $(obj)/../../kernel/vmlinux.lds

$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE
#
# Pull in the necessary libgcc bits from the in-kernel implementation.
#
lib1funcs-$(CONFIG_SUPERH32) := ashiftrt.S ashldi3.c ashrsi3.S ashlsi3.S \
lshrsi3.S
lib1funcs-obj := \
$(addsuffix .o, $(basename $(addprefix $(obj)/, $(lib1funcs-y))))

lib1funcs-dir := $(srctree)/arch/$(SRCARCH)/lib
ifeq ($(BITS),64)
lib1funcs-dir := $(addsuffix $(BITS), $(lib1funcs-dir))
endif

KBUILD_CFLAGS += -I$(lib1funcs-dir)

$(addprefix $(obj)/,$(lib1funcs-y)): $(obj)/%: $(lib1funcs-dir)/% FORCE
$(call cmd,shipped)

$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(lib1funcs-obj) FORCE
$(call if_changed,ld)
@:

Expand Down

0 comments on commit 363e9f0

Please sign in to comment.