Use CC instead of LD to produce intermediate binaries

This makes sure that GCC still finds assembler functions when
using link time optimization.

BRANCH=none
BUG=none
TEST=boot tested on pit and link

Change-Id: If9cb32abf19c17c09bb1f25ca496e963e4ce82f8
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/168774
Reviewed-by: Ronald Minnich <rminnich@chromium.org>
This commit is contained in:
Stefan Reinauer 2013-09-10 11:05:59 -07:00 committed by chrome-internal-fetch
commit bc5415bbb4

View file

@ -92,8 +92,13 @@ files-in-dir=$(filter-out $(call dir-wildcards,$(call filter-out-dirs,$(1),$(dir
#######################################################################
# reduce command line length by linking the objects of each
# directory into an intermediate file
ifeq ($(CONFIG_COMPILER_LLVM_CLANG),y)
LINK=$(LD)
else
LINK=$(CC) $(CFLAGS)
endif
ramstage-postprocess=$(foreach d,$(sort $(dir $(1))), \
$(eval $(d)ramstage.o: $(call files-in-dir,$(d),$(1)); $$(LD) -o $$@ -r $$^ ) \
$(eval $(d)ramstage.o: $(call files-in-dir,$(d),$(1)); $$(LINK) -o $$@ -r $$^ ) \
$(eval ramstage-objs:=$(d)ramstage.o $(filter-out $(call files-in-dir,$(d),$(1)),$(ramstage-objs))))
romstage-c-ccopts:=-D__PRE_RAM__