X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=examples%2Fstandalone%2FMakefile;h=c1dfdce581d8f1823754ab8089ac1b304c52eb58;hb=9a4d50e34dde4d03f9c7c595f548d8c214d98eb7;hp=5f1f8008073648a30643f66e6690e4a76577e63b;hpb=620bbba524fbaa26971a5004793010b169824f1b;p=u-boot diff --git a/examples/standalone/Makefile b/examples/standalone/Makefile index 5f1f800807..c1dfdce581 100644 --- a/examples/standalone/Makefile +++ b/examples/standalone/Makefile @@ -50,7 +50,7 @@ BIN = $(addsuffix .bin,$(ELF)) COBJS := $(ELF:=.o) -LIB = $(obj)libstubs.a +LIB = $(obj)libstubs.o LIBAOBJS-$(ARCH) := LIBAOBJS-$(CPU) := @@ -82,11 +82,16 @@ CFLAGS := $(filter-out $(RELFLAGS),$(CFLAGS)) CPPFLAGS := $(filter-out $(RELFLAGS),$(CPPFLAGS)) endif +# We don't want gcc reordering functions if possible. This ensures that an +# application's entry point will be the first function in the application's +# source file. +CFLAGS += $(call cc-option,-fno-toplevel-reorder) + all: $(obj).depend $(OBJS) $(LIB) $(SREC) $(BIN) $(ELF) ######################################################################### $(LIB): $(obj).depend $(LIBOBJS) - $(AR) $(ARFLAGS) $@ $(LIBOBJS) + $(call cmd_link_o_target, $(LIBOBJS)) $(ELF): $(obj)%: $(obj)%.o $(LIB)