toolchain/wrapper: fix 'reinstall'
authorJérôme Pouiller <jezz@sysmic.org>
Wed, 28 Sep 2016 08:00:56 +0000 (10:00 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 24 Oct 2016 21:02:33 +0000 (23:02 +0200)
toolchain-wrapper was not reinstalled. So rules toolchain-external-reinstall,
gcc-initial-reinstall, gcc-final-reinstall didn't work as expected.

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

Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/gcc/gcc-final/gcc-final.mk
package/gcc/gcc-initial/gcc-initial.mk
toolchain/toolchain-external/toolchain-external.mk
toolchain/toolchain-wrapper.mk

index 910427340a02056cb3968787a64489a2231c94b7..c9ee476fb7f4fcbcfd5b4e8e85a1868bc28d056f 100644 (file)
@@ -113,7 +113,8 @@ 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
+HOST_GCC_FINAL_POST_INSTALL_HOOKS += TOOLCHAIN_WRAPPER_INSTALL
 # 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
index aa88a6808f3996f8314eb28cf67e6152e0dbf19e..7bb988bdf76f14251d851d767f1b30bae5c817f5 100644 (file)
@@ -61,7 +61,8 @@ 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 += TOOLCHAIN_WRAPPER_INSTALL
 HOST_GCC_INITIAL_POST_INSTALL_HOOKS += HOST_GCC_INSTALL_WRAPPER_AND_SIMPLE_SYMLINKS
 
 $(eval $(host-autotools-package))
index 141dd10fd422f77a51bcd6e8874e72804ded0ecc..d3608d082b495f3f83db521b4fa3cf15d3522714 100644 (file)
@@ -770,9 +770,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)
index af39071cf3f5a1cde8f2484f9a014b6d1f451643..e7aa5fb829ff769ccaf83de46bf91f3f71928eb8 100644 (file)
@@ -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 $(@D)/toolchain-wrapper \
+               $(HOST_DIR)/usr/bin/toolchain-wrapper
 endef