1 Star 0 Fork 5

王国琨/plat-raspi

forked from TenonOS/plat-raspi 
Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
Linker.uk 2.16 KB
Copy Edit Raw Blame History
李浩德 authored 2024-06-12 18:48 . add build and link files
RASPI_LDFLAGS-y += -Wl,-m,aarch64elf
ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
RASPI_LDFLAGS-y += -mfix-cortex-a53-843419
endif
##
## Link image
##
RASPI_IMAGE := $(BUILD_DIR)/$(CONFIG_UK_NAME)_raspi-$(CONFIG_UK_ARCH)
RASPI_ELF_IMAGE := $(RASPI_IMAGE).elf
RASPI_LD_SCRIPT_FLAGS := $(addprefix -Wl$(comma)-dT$(comma),\
$(UK_PLAT_RASPI_DEF_LDS))
RASPI_LD_SCRIPT_FLAGS += $(addprefix -Wl$(comma)-T$(comma),\
$(LIBRASPIPLAT_DEF_LDS) $(EXTRA_LD_SCRIPT-y))
$(RASPI_ELF_IMAGE): $(RASPI_ALIBS) $(RASPI_ALIBS-y) $(RASPI_OLIBS) $(RASPI_OLIBS-y) \
$(UK_ALIBS) $(UK_ALIBS-y) $(UK_OLIBS) $(UK_OLIBS-y)
$(call build_cmd,LD,,$(RASPI_IMAGE).ld.o,\
$(LD) -r $(LIBLDFLAGS) $(LIBLDFLAGS-y) \
$(RASPI_LDFLAGS) $(RASPI_LDFLAGS-y) \
$(RASPI_OLIBS) $(RASPI_OLIBS-y) \
$(UK_OLIBS) $(UK_OLIBS-y) \
-lgcc \
-Wl$(comma)--start-group \
$(RASPI_ALIBS) $(RASPI_ALIBS-y) \
$(UK_ALIBS) $(UK_ALIBS-y) \
-Wl$(comma)--end-group \
-o $(RASPI_IMAGE).ld.o)
$(call build_cmd,OBJCOPY,,$(RASPI_IMAGE).o,\
$(OBJCOPY) -w -G _libraspiplat_entry \
$(RASPI_IMAGE).ld.o $(RASPI_IMAGE).o)
$(call build_cmd,LD,,$@,\
$(LD) $(LDFLAGS) $(LDFLAGS-y) \
$(RASPI_LDFLAGS) $(RASPI_LDFLAGS-y) \
$(RASPI_LD_SCRIPT_FLAGS) \
$(RASPI_IMAGE).o -o $@)
$(call build_bootinfo,$@)
$(RASPI_IMAGE): $(RASPI_IMAGE).elf
$(call build_cmd,SCSTRIP,,$@,\
$(STRIP) -s \
$(SECT_STRIP_FLAGS) $(SECT_STRIP_FLAGS-y) \
$< -o $@ 2>&1 | \
{ grep -v "Empty loadable segment detected" || true; })
$(call build_cmd,OBJCOPY,,$(RASPI_IMAGE).img,\
$(OBJCOPY) -O binary $(RASPI_ELF_IMAGE) $(BUILD_DIR)/kernel8.img)
# register images to the build
ifeq ($(CONFIG_PLAT_RASPI),y)
UK_DEBUG_IMAGES-y += $(RASPI_ELF_IMAGE)
UK_IMAGES-y += $(RASPI_IMAGE)
endif
# ...for cleaning:
LIBRASPIPLAT_CLEAN += $(call build_clean,$(RASPI_IMAGE).o)
LIBRASPIPLAT_CLEAN += $(call build_clean,$(RASPI_IMAGE).ld.o)
LIBRASPIPLAT_CLEAN += $(call build_clean,$(RASPI_IMAGE).elf)
LIBRASPIPLAT_CLEAN += $(call build_clean,$(RASPI_IMAGE).img)
LIBRASPIPLAT_CLEAN += $(call build_clean,$(RASPI_ELF_IMAGE).bootinfo)
LIBRASPIPLAT_CLEAN += $(call build_clean,$(BUILD_DIR)/kernel8.img)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wang-guo-kun/plat-raspi.git
git@gitee.com:wang-guo-kun/plat-raspi.git
wang-guo-kun
plat-raspi
plat-raspi
master

Search

0d507c66 1850385 C8b1a773 1850385