* [Buildroot] [PATCH] Fix 'make toolchain-external-reinstall'
@ 2016-09-27 16:28 Jérôme Pouiller
2016-09-27 16:52 ` Thomas Petazzoni
0 siblings, 1 reply; 2+ messages in thread
From: Jérôme Pouiller @ 2016-09-27 16:28 UTC (permalink / raw)
To: buildroot
toolchain-wrapper was not reinstalled on 'make
toolchain-external-reinstall'
In add, normalize variable name: s/TOOLCHAIN_BUILD_WRAPPER/TOOLCHAIN_WRAPPER_BUILD/
Signed-off-by: J?r?me Pouiller <jezz@sysmic.org>
---
toolchain/toolchain-external/toolchain-external.mk | 3 ++-
toolchain/toolchain-wrapper.mk | 12 ++++++++----
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index 6fd2742..e9e6340 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -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)
diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk
index af39071..21690fd 100644
--- a/toolchain/toolchain-wrapper.mk
+++ b/toolchain/toolchain-wrapper.mk
@@ -30,11 +30,15 @@ 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 toolchain/toolchain-wrapper
+endef
+
+define TOOLCHAIN_WRAPPER_INSTALL
+ $(Q)mkdir -p $(HOST_DIR)/usr/bin
+ $(INSTALL) -m 0755 toolchain/toolchain-wrapper \
+ $(HOST_DIR)/usr/bin/toolchain-wrapper
endef
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH] Fix 'make toolchain-external-reinstall'
2016-09-27 16:28 [Buildroot] [PATCH] Fix 'make toolchain-external-reinstall' Jérôme Pouiller
@ 2016-09-27 16:52 ` Thomas Petazzoni
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2016-09-27 16:52 UTC (permalink / raw)
To: buildroot
Hello,
On Tue, 27 Sep 2016 18:28:32 +0200, J?r?me Pouiller wrote:
> diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk
> index af39071..21690fd 100644
> --- a/toolchain/toolchain-wrapper.mk
> +++ b/toolchain/toolchain-wrapper.mk
> @@ -30,11 +30,15 @@ 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
If you rename this, you should fix the gcc package, which also uses the
same variable. As it is, your patch breaks the internal toolchain
backend.
> $(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 toolchain/toolchain-wrapper
This is not good: it generates a file in the source tree. You should
consider the source tree as read-only. Anything built by Buildroot
should be generated in the output directory. So, I'd suggest to
generate it in $(@D)/toolchain-wrapper maybe?
> +define TOOLCHAIN_WRAPPER_INSTALL
> + $(Q)mkdir -p $(HOST_DIR)/usr/bin
Not needed, just use $(INSTALL) with the -D option.
Other than those implementation issues, I agree with the general
principle: the installation to the host directory should only take
place at install time.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-27 16:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-27 16:28 [Buildroot] [PATCH] Fix 'make toolchain-external-reinstall' Jérôme Pouiller
2016-09-27 16:52 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox