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:
Benjamin Walsh 2016-08-15 17:24:28 -04:00
parent 5306a00190
commit ec89a10c7e

View file

@ -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