Skip to contentSkip to conversation

Fix 'make toolchain-external-reinstall'

PATCH Superseded Jérôme Pouiller 2 participants 3 messages Sep 27, 2016 – Sep 28, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Fix 'make toolchain-external-reinstall'

toolchain-wrapper was not reinstalled on 'make
toolchain-external-reinstall'

In add, normalize variable name: s/TOOLCHAIN_BUILD_WRAPPER/TOOLCHAIN_WRAPPER_BUILD/

---
v2:
- Fix missed occurences of TOOLCHAIN_BUILD_WRAPPER in package/
- Do not write intermediate file with sources
- Use 'install' instead of 'mkdir'
- Fix indentation

 package/gcc/gcc-final/gcc-final.mk                 |  2 +-
 package/gcc/gcc-initial/gcc-initial.mk             |  2 +-
 toolchain/toolchain-external/toolchain-external.mk |  3 ++-
 toolchain/toolchain-wrapper.mk                     | 11 +++++++----
 4 files changed, 11 insertions(+), 7 deletions(-)
package/gcc/gcc-final/gcc-final.mk +1 -1
index 36f185e..0f7f1e1 100644
@@ -113,7 +113,7 @@ endef
 HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_FINAL_CREATE_CC_SYMLINKS
 
 HOST_GCC_FINAL_TOOLCHAIN_WRAPPER_ARGS += $(HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS)
-HOST_GCC_FINAL_POST_BUILD_HOOKS += TOOLCHAIN_BUILD_WRAPPER
+HOST_GCC_FINAL_POST_BUILD_HOOKS += TOOLCHAIN_WRAPPER_BUILD
 # Note: this must be done after CREATE_CC_SYMLINKS, otherwise the
 # -cc symlink to the wrapper is not created.
 HOST_GCC_FINAL_POST_INSTALL_HOOKS += HOST_GCC_INSTALL_WRAPPER_AND_SIMPLE_SYMLINKS
package/gcc/gcc-initial/gcc-initial.mk +1 -1
index aa88a68..7a4ce21 100644
@@ -61,7 +61,7 @@ HOST_GCC_INITIAL_INSTALL_OPTS += install-target-libgcc
 endif
 
 HOST_GCC_INITIAL_TOOLCHAIN_WRAPPER_ARGS += $(HOST_GCC_COMMON_TOOLCHAIN_WRAPPER_ARGS)
-HOST_GCC_INITIAL_POST_BUILD_HOOKS += TOOLCHAIN_BUILD_WRAPPER
+HOST_GCC_INITIAL_POST_BUILD_HOOKS += TOOLCHAIN_WRAPPER_BUILD
 HOST_GCC_INITIAL_POST_INSTALL_HOOKS += HOST_GCC_INSTALL_WRAPPER_AND_SIMPLE_SYMLINKS
 
 $(eval $(host-autotools-package))
toolchain/toolchain-external/toolchain-external.mk +2 -1
index 6fd2742..e9e6340 100644
@@ -787,9 +787,10 @@ define TOOLCHAIN_EXTERNAL_FIXUP_UCLIBCNG_LDSO
 	fi
 endef
 
-TOOLCHAIN_EXTERNAL_BUILD_CMDS = $(TOOLCHAIN_BUILD_WRAPPER)
+TOOLCHAIN_EXTERNAL_BUILD_CMDS = $(TOOLCHAIN_WRAPPER_BUILD)
 
 define TOOLCHAIN_EXTERNAL_INSTALL_STAGING_CMDS
+	$(TOOLCHAIN_WRAPPER_INSTALL)
 	$(TOOLCHAIN_EXTERNAL_CREATE_STAGING_LIB_SYMLINK)
 	$(TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS)
 	$(TOOLCHAIN_EXTERNAL_INSTALL_SYSROOT_LIBS_BFIN_FDPIC)
toolchain/toolchain-wrapper.mk +7 -4
index af39071..891f9f0 100644
@@ -30,11 +30,14 @@ ifeq ($(BR2_CCACHE_USE_BASEDIR),y)
 TOOLCHAIN_WRAPPER_ARGS += -DBR_CCACHE_BASEDIR='"$(BASE_DIR)"'
 endif
 
-# For simplicity, build directly into the install location
-define TOOLCHAIN_BUILD_WRAPPER
-	$(Q)mkdir -p $(HOST_DIR)/usr/bin
+define TOOLCHAIN_WRAPPER_BUILD
 	$(HOSTCC) $(HOST_CFLAGS) $(TOOLCHAIN_WRAPPER_ARGS) \
 		-s -Wl,--hash-style=$(TOOLCHAIN_WRAPPER_HASH_STYLE) \
 		toolchain/toolchain-wrapper.c \
-		-o $(HOST_DIR)/usr/bin/toolchain-wrapper
+		-o $(@D)/toolchain-wrapper
+endef
+
+define TOOLCHAIN_WRAPPER_INSTALL
+	$(INSTALL) -D -m 0755 toolchain/toolchain-wrapper \
+		$(HOST_DIR)/usr/bin/toolchain-wrapper
 endef
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/1 Fix 'make toolchain-external-reinstall'

(reviewing myself)

On Tuesday 27 September 2016 23:05:32 J?r?me Pouiller wrote:
[...]

Quoted 5 lines
toolchain/toolchain-wrapper.mk +1 -3
-# For simplicity, build directly into the install location
-define TOOLCHAIN_BUILD_WRAPPER
-	$(Q)mkdir -p $(HOST_DIR)/usr/bin
+define TOOLCHAIN_WRAPPER_BUILD
 	$(HOSTCC) $(HOST_CFLAGS) $(TOOLCHAIN_WRAPPER_ARGS) \

toolchain/toolchain-wrapper.mk ifeq ($(BR2_CCACHE_USE_BASEDIR),y) · line 43

Quoted 10 lines
toolchain/toolchain-wrapper.mk +6 -1
 		-s -Wl,--hash-style=$(TOOLCHAIN_WRAPPER_HASH_STYLE) \
 		toolchain/toolchain-wrapper.c \
-		-o $(HOST_DIR)/usr/bin/toolchain-wrapper
+		-o $(@D)/toolchain-wrapper
+endef
+
+define TOOLCHAIN_WRAPPER_INSTALL
+	$(INSTALL) -D -m 0755 toolchain/toolchain-wrapper \
+		$(HOST_DIR)/usr/bin/toolchain-wrapper
 endef

I have forgotten to call TOOLCHAIN_WRAPPER_INSTALL from gcc-initial/gcc- final.

Signature · 3 lines
J?r?me Pouiller, Sysmic
Embedded Linux specialist
http://www.sysmic.fr
#2 lore raw

PATCH v2 1/1 Fix 'make toolchain-external-reinstall'

In reply to Jérôme Pouiller

Hello,

Quoted 4 lines · J?r?me Pouiller

toolchain-wrapper was not reinstalled on 'make
toolchain-external-reinstall'

In add, normalize variable name: s/TOOLCHAIN_BUILD_WRAPPER/TOOLCHAIN_WRAPPER_BUILD/

I'm wondering if the rename should be done in a separate patch.

toolchain/toolchain-wrapper.mk ifeq ($(BR2_CCACHE_USE_BASEDIR),y) · line 37

Quoted 9 lines
toolchain/toolchain-wrapper.mk +2 -4
-# For simplicity, build directly into the install location
-define TOOLCHAIN_BUILD_WRAPPER
-	$(Q)mkdir -p $(HOST_DIR)/usr/bin
+define TOOLCHAIN_WRAPPER_BUILD
 	$(HOSTCC) $(HOST_CFLAGS) $(TOOLCHAIN_WRAPPER_ARGS) \
 		-s -Wl,--hash-style=$(TOOLCHAIN_WRAPPER_HASH_STYLE) \
 		toolchain/toolchain-wrapper.c \
-		-o $(HOST_DIR)/usr/bin/toolchain-wrapper
+		-o $(@D)/toolchain-wrapper

You're building the wrapper in $(@D)/toolchain-wrapper

toolchain/toolchain-wrapper.mk ifeq ($(BR2_CCACHE_USE_BASEDIR),y) · line 41

Quoted 4 lines
toolchain/toolchain-wrapper.mk +4 -0
+endef
+
+define TOOLCHAIN_WRAPPER_INSTALL
+	$(INSTALL) -D -m 0755 toolchain/toolchain-wrapper \

but installing it from toolchain/toolchain-wrapper

I'm not sure how this can work.

Thomas

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