Patchwork [2/2] buildroot:package: Avoids prefix absolute compiler path when external toolchain path is empty.

login
register
mail settings
Submitter Sonic Zhang
Date Aug. 6, 2012, 11:17 a.m.
Message ID <1344251847-7709-2-git-send-email-sonic.adi@gmail.com>
Download mbox | patch
Permalink /patch/175328/
State Rejected
Headers show

Comments

Sonic Zhang - Aug. 6, 2012, 11:17 a.m.
From: Sonic Zhang <sonic.zhang@analog.com>

Current external compiler is always prefixed by he customer path.
When external toolchain path is left empty, this patch avoids prefix absolute path.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
---
 package/Makefile.in |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
Thomas Petazzoni - Aug. 6, 2012, 12:50 p.m.
Le Mon, 6 Aug 2012 19:17:26 +0800,
Sonic Zhang <sonic.adi@gmail.com> a écrit :

> From: Sonic Zhang <sonic.zhang@analog.com>
> 
> Current external compiler is always prefixed by he customer path.
> When external toolchain path is left empty, this patch avoids prefix absolute path.
> 
> Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
> ---
>  package/Makefile.in |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/package/Makefile.in b/package/Makefile.in
> index 6fad224..ecbdc00 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -101,8 +101,13 @@ TARGET_LDFLAGS=$(call qstrip,$(BR2_TARGET_LDFLAGS))
>  ifeq ($(BR2_TOOLCHAIN_BUILDROOT)$(BR2_TOOLCHAIN_CTNG),y)
>  TARGET_CROSS=$(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-
>  else
> +TOOLCHAIN_EXTERNAL_LOCATION=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH))
> +ifeq ($(TOOLCHAIN_EXTERNAL_LOCATION),)
> +TARGET_CROSS=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))-
> +else
>  TARGET_CROSS=$(HOST_DIR)/usr/bin/$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))-
>  endif
> +endif

I am sorry but this is not correct. It will lead to packages calling
directly the compiler without going through our external toolchain
wrapper, which is mandatory to ensure that the correct sysroot (and
other flags) are passed correctly.

Passing an empty BR2_TOOLCHAIN_EXTERNAL_PATH works just fine for me if
the toolchain binaries are in the PATH.

Could you explain in more details what you are trying to achieve here?

Thanks,

Thomas

Patch

diff --git a/package/Makefile.in b/package/Makefile.in
index 6fad224..ecbdc00 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -101,8 +101,13 @@  TARGET_LDFLAGS=$(call qstrip,$(BR2_TARGET_LDFLAGS))
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT)$(BR2_TOOLCHAIN_CTNG),y)
 TARGET_CROSS=$(HOST_DIR)/usr/bin/$(GNU_TARGET_NAME)-
 else
+TOOLCHAIN_EXTERNAL_LOCATION=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PATH))
+ifeq ($(TOOLCHAIN_EXTERNAL_LOCATION),)
+TARGET_CROSS=$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))-
+else
 TARGET_CROSS=$(HOST_DIR)/usr/bin/$(call qstrip,$(BR2_TOOLCHAIN_EXTERNAL_PREFIX))-
 endif
+endif
 
 # Quotes are needed for spaces et al in path components.
 TARGET_PATH="$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin/:$(PATH)"