Commit e75e73dd5f280b91f5bfc0a76a0fd09b6eba1c66

Authored by Alexey Brodkin
Committed by Tom Rini
1 parent 1dd6e3c2dd

examples: select libgcc for non-default architecture

In case of multilib-enabled toolchains if default architecture differ from
the one examples are being built for linker will fail to link example object
files with libgcc of another (non-compatible) architecture.

Interesting enough for years in main Makefile we used CFLAGS/c_flags for this
but not for examples.

So fixing it now.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>

Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Tom Rini <trini@ti.com>
Cc: Wolfgang Denx <wd@denx.de>
Acked-by: WOlfgang Denk <wd@denx.de>
Acked-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

Showing 2 changed files with 2 additions and 3 deletions Side-by-side Diff

... ... @@ -699,6 +699,7 @@
699 699 endif
700 700 PLATFORM_LIBS += $(PLATFORM_LIBGCC)
701 701 export PLATFORM_LIBS
  702 +export PLATFORM_LIBGCC
702 703  
703 704 # Special flags for CPP when processing the linker script.
704 705 # Pass the version down so we can handle backwards compatibility
examples/standalone/Makefile
... ... @@ -38,8 +38,6 @@
38 38 LIBOBJS := $(addprefix $(obj)/,$(LIBOBJS-y))
39 39 ELF := $(addprefix $(obj)/,$(ELF))
40 40  
41   -gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
42   -
43 41 # For PowerPC there's no need to compile standalone applications as a
44 42 # relocatable executable. The relocation data is not needed, and
45 43 # also causes the entry point of the standalone application to be
... ... @@ -63,7 +61,7 @@
63 61  
64 62 quiet_cmd_link_elf = LD $@
65 63 cmd_link_elf = $(LD) $(LDFLAGS) -g -Ttext $(CONFIG_STANDALONE_LOAD_ADDR) \
66   - -o $@ -e $(SYM_PREFIX)$(@F) $< $(LIB) -L$(gcclibdir) -lgcc
  64 + -o $@ -e $(SYM_PREFIX)$(@F) $< $(LIB) $(PLATFORM_LIBGCC)
67 65  
68 66 $(ELF): $(obj)/%: $(obj)/%.o $(LIB) FORCE
69 67 $(call if_changed,link_elf)