From cdc7396f97ccc7209019b0a3cde7c8420f0a0f4b Mon Sep 17 00:00:00 2001 From: Eyob Date: Sat, 8 Apr 2017 18:18:16 -0400 Subject: [PATCH] Make sure LD -L option is calculated correctly when the project Makefile has specified SRCDIRS components that are not directly below Makefile folder level. For example, SRCDIRS = comp_a happy/comp_b /c/dev/comp_c Then the following are built: build/comp_a/libcomp_a.a build/comp_b/libcomp_b.a build/comp_c/libcomp_c.a But when LD is run the -L is calculated as follows -L build/comp_a -L build/happy/comp_b -L build//c/dev/comp_c This means comp_b and comp_c are not found by LD. With this change set -L is calculated correctly for comp_b and comp_c Merges #504 https://github.com/espressif/esp-idf/pull/504 --- make/project.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make/project.mk b/make/project.mk index fd85ef4e55..1c868ad307 100644 --- a/make/project.mk +++ b/make/project.mk @@ -189,9 +189,9 @@ endif IDF_VER := $(shell cd ${IDF_PATH} && git describe --always --tags --dirty) # Set default LDFLAGS - +SRCDIRS_COMPONENT_NAMES := $(sort $(foreach comp,$(SRCDIRS),$(lastword $(subst /, ,$(comp))))) LDFLAGS ?= -nostdlib \ - $(addprefix -L$(BUILD_DIR_BASE)/,$(COMPONENTS) $(TEST_COMPONENT_NAMES) $(SRCDIRS) ) \ + $(addprefix -L$(BUILD_DIR_BASE)/,$(COMPONENTS) $(TEST_COMPONENT_NAMES) $(SRCDIRS_COMPONENT_NAMES) ) \ -u call_user_start_cpu0 \ $(EXTRA_LDFLAGS) \ -Wl,--gc-sections \ -- 2.40.0