build: allow specifying a custom linker script relative to project
Build system will first check if the linker script is found relative to the project directory, and if not, it will consider it to be an absolute path, as before. Change-Id: Idfc7e55febbc8c197643ca514dc01c3e2262712a Signed-off-by: Benjamin Walsh <benjamin.walsh@windriver.com>
This commit is contained in:
parent
5306a00190
commit
ec89a10c7e
5
Makefile
5
Makefile
|
@ -702,7 +702,10 @@ LDFLAGS_zephyr += $(call cc-ldoption,$(LINKFLAGPREFIX)--build-id=none)
|
|||
LD_TOOLCHAIN ?= -D__GCC_LINKER_CMD__
|
||||
|
||||
ifdef CONFIG_HAVE_CUSTOM_LINKER_SCRIPT
|
||||
KBUILD_LDS := $(subst $(DQUOTE),,$(CONFIG_CUSTOM_LINKER_SCRIPT))
|
||||
KBUILD_LDS := $(subst $(DQUOTE),,$(PROJECT_BASE)/$(CONFIG_CUSTOM_LINKER_SCRIPT))
|
||||
ifeq ($(wildcard $(KBUILD_LDS)),)
|
||||
KBUILD_LDS := $(subst $(DQUOTE),,$(CONFIG_CUSTOM_LINKER_SCRIPT))
|
||||
endif
|
||||
else
|
||||
# Try a board specific linker file
|
||||
KBUILD_LDS := $(srctree)/boards/$(BOARD_NAME)/linker.ld
|
||||
|
|
Loading…
Reference in a new issue