Skip to contentSkip to conversation

toolchain/helpers.mk: fix creation of DESTDIR in copy_toolchain_lib_root

PATCH New Arnout Vandecappelle (Essensium/Mind) 2 participants 2 messages Jul 5, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 toolchain/helpers.mk: fix creation of DESTDIR in copy_toolchain_lib_root

In commit b3cc7e65ee, the definition of the DESTDIR variable was moved down into the loop that follows symlinks in the libraries that are copied to target. However, the corresponding mkdir was not moved down, so that no directories are ever created.

In practice, this mkdir is normally redundant since the directories should already have been created as part of creating STAGING_DIR. Still, the current situation is clearly wrong, so fix it by moving the mkdir down to after the assignment to DESTDIR.

While we're at it, also remove a redundant empty line. It's a leftover from when a lot of variables were declared above.

---
 toolchain/helpers.mk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
toolchain/helpers.mk +1 -2
index 6136aef6b9..9942ce404f 100644
@@ -10,13 +10,12 @@
 #
 copy_toolchain_lib_root = \
 	LIBPATTERN="$(strip $1)"; \
-\
 	LIBPATHS=`find $(STAGING_DIR)/ -name "$${LIBPATTERN}" 2>/dev/null` ; \
 	for LIBPATH in $${LIBPATHS} ; do \
-		mkdir -p $(TARGET_DIR)/$${DESTDIR}; \
 		while true ; do \
 			LIBNAME=`basename $${LIBPATH}`; \
 			DESTDIR=`echo $${LIBPATH} | sed "s,^$(STAGING_DIR)/,," | xargs dirname` ; \
+			mkdir -p $(TARGET_DIR)/$${DESTDIR}; \
 			rm -fr $(TARGET_DIR)/$${DESTDIR}/$${LIBNAME}; \
 			if test -h $${LIBPATH} ; then \
 				cp -d $${LIBPATH} $(TARGET_DIR)/$${DESTDIR}/$${LIBNAME}; \
Signature · 1 line
2.13.2
#1 lore raw

PATCH 1/1 toolchain/helpers.mk: fix creation of DESTDIR in copy_toolchain_lib_root

Hello,

Quoted 10 lines · Arnout Vandecappelle (Essensium/Mind)

In commit b3cc7e65ee, the definition of the DESTDIR variable was moved down into the loop that follows symlinks in the libraries that are copied to target. However, the corresponding mkdir was not moved down, so that no directories are ever created.

In practice, this mkdir is normally redundant since the directories should already have been created as part of creating STAGING_DIR. Still, the current situation is clearly wrong, so fix it by moving the mkdir down to after the assignment to DESTDIR.

Quoted 7 lines

While we're at it, also remove a redundant empty line. It's a leftover from when a lot of variables were declared above.

---
 toolchain/helpers.mk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com