From bc5415bbb43d6c5bb4843ebdfd1d821cb9d6a0c2 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Tue, 10 Sep 2013 11:05:59 -0700 Subject: [PATCH] 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 Reviewed-on: https://chromium-review.googlesource.com/168774 Reviewed-by: Ronald Minnich --- Makefile.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile.inc b/Makefile.inc index de4dc29442..1a732f9eec 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -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__