diff --git a/Makefile b/Makefile index 20fa85e..40d146e 100644 --- a/Makefile +++ b/Makefile @@ -583,18 +583,18 @@ # # System.map is generated to document addresses of all kernel symbols -barebox-common := $(common-y) +BAREBOX_OBJS := $(common-y) export BAREBOX_PBL_OBJS := $(pbl-common-y) -barebox-all := $(barebox-common) -barebox-lds := $(lds-y) +barebox-all := $(BAREBOX_OBJS) +BAREBOX_LDS := $(lds-y) # Rule to link barebox # May be overridden by arch/$(ARCH)/Makefile quiet_cmd_barebox__ ?= LD $@ cmd_barebox__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_barebox) -o $@ \ - -T $(barebox-lds) \ - --start-group $(barebox-common) --end-group \ - $(filter-out $(barebox-lds) $(barebox-common) FORCE ,$^) + -T $(BAREBOX_LDS) \ + --start-group $(BAREBOX_OBJS) --end-group \ + $(filter-out $(BAREBOX_LDS) $(BAREBOX_OBJS) FORCE ,$^) # Generate new barebox version quiet_cmd_barebox_version = GEN .version @@ -691,13 +691,13 @@ $(call cmd,kallsyms) # .tmp_barebox1 must be complete except kallsyms, so update barebox version -.tmp_barebox1: $(barebox-lds) $(barebox-all) FORCE +.tmp_barebox1: $(BAREBOX_LDS) $(barebox-all) FORCE $(call if_changed_rule,ksym_ld) -.tmp_barebox2: $(barebox-lds) $(barebox-all) .tmp_kallsyms1.o FORCE +.tmp_barebox2: $(BAREBOX_LDS) $(barebox-all) .tmp_kallsyms1.o FORCE $(call if_changed,barebox__) -.tmp_barebox3: $(barebox-lds) $(barebox-all) .tmp_kallsyms2.o FORCE +.tmp_barebox3: $(BAREBOX_LDS) $(barebox-all) .tmp_kallsyms2.o FORCE $(call if_changed,barebox__) # Needs to visit scripts/ before $(KALLSYMS) can be used. @@ -767,7 +767,7 @@ endif # barebox image -barebox: $(barebox-lds) $(barebox-common) $(kallsyms.o) FORCE +barebox: $(BAREBOX_LDS) $(BAREBOX_OBJS) $(kallsyms.o) FORCE $(call if_changed_rule,barebox__) $(Q)rm -f .old_version @@ -776,7 +776,7 @@ # The actual objects are generated when descending, # make sure no implicit rule kicks in -$(sort $(barebox-common) ) $(barebox-lds) $(BAREBOX_PBL_OBJS): $(barebox-dirs) ; +$(sort $(BAREBOX_OBJS)) $(BAREBOX_LDS) $(BAREBOX_PBL_OBJS): $(barebox-dirs) ; # Handle descending into subdirectories listed in $(barebox-dirs) # Preset locale variables to speed up the build process. Limit locale diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 486dfd8..ee3364d 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -118,9 +118,9 @@ lds-$(CONFIG_GENERIC_LINKER_SCRIPT) := arch/mips/lib/barebox.lds cmd_barebox__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_barebox) -o $@ \ - -T $(barebox-lds) \ - --start-group $(barebox-common) --end-group \ - $(filter-out $(barebox-lds) $(barebox-common) FORCE ,$^); \ + -T $(BAREBOX_LDS) \ + --start-group $(BAREBOX_OBJS) --end-group \ + $(filter-out $(BAREBOX_LDS) $(BAREBOX_OBJS) FORCE ,$^); \ $(objtree)/scripts/mips-relocs $@ diff --git a/arch/sandbox/Makefile b/arch/sandbox/Makefile index b127560..b7470c3 100644 --- a/arch/sandbox/Makefile +++ b/arch/sandbox/Makefile @@ -56,8 +56,8 @@ SANITIZER_LIBS += -fsanitize=undefined endif -cmd_barebox__ = $(CC) -o $@ -Wl,-T,$(barebox-lds) \ - -Wl,--start-group $(barebox-common) -Wl,--end-group \ +cmd_barebox__ = $(CC) -o $@ -Wl,-T,$(BAREBOX_LDS) \ + -Wl,--start-group $(BAREBOX_OBJS) -Wl,--end-group \ -lrt -lpthread $(SDL_LIBS) $(FTDI1_LIBS) \ $(SANITIZER_LIBS) diff --git a/arch/x86/Makefile b/arch/x86/Makefile index 0751e63..4d471c2 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -77,9 +77,9 @@ cmd_barebox__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_barebox) -o $@ \ -T $(lds-y) \ -shared -Bsymbolic -nostdlib -znocombreloc \ - --start-group $(barebox-common) \ + --start-group $(BAREBOX_OBJS) \ --end-group \ - $(filter-out $(barebox-lds) $(barebox-common) FORCE ,$^) + $(filter-out $(BAREBOX_LDS) $(BAREBOX_OBJS) FORCE ,$^) quiet_cmd_efi_image = EFI-IMG $@ cmd_efi_image = $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \