[Skiboot] [PATCH] external: Fix cross compilation issue

Patrick Williams patrick at stwcx.xyz
Thu Jul 28 20:40:50 AEST 2016


On Thu, Jul 28, 2016 at 03:05:38PM +0530, Vasant Hegde wrote:
> For some reason Makefile thinks compiler variables like CC is already
> assigned and ignores CROSS_COMPILE flags. Hence I'm not able to generate
> arm binary on x86.
> 
> Use default assignment operator instead of conditional assignment
> operator (?=) in Makefile.
> 
> Fixes: 3137d249 (pflash: Allow building under yocto.)
> CC: Patrick Williams <patrick at stwcx.xyz>
> CC: Stewart Smith <stewart at linux.vnet.ibm.com>
> Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
> ---
>  external/common/rules.mk | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/external/common/rules.mk b/external/common/rules.mk
> index bb12fd5..416a40d 100644
> --- a/external/common/rules.mk
> +++ b/external/common/rules.mk
> @@ -1,5 +1,5 @@
> -CC ?= $(CROSS_COMPILE)gcc
> -LD ?= $(CROSS_COMPILE)ld
> +CC = $(CROSS_COMPILE)gcc
> +LD = $(CROSS_COMPILE)ld

This effectively undoes the change I made in 3137d249, so I'm not sure
why we would want it or why it is needed.

Yocto sets CC and LD directly and actually adds some of the CFLAGS onto
the CC variable (for right or wrong).  Thus it doesn't use CROSS_COMPILE
directly.  Also, by forcing 'CC = $(CROSS_COMPILE)gcc' we preclude the
use of clang.

>  ARCH := $(shell $(GET_ARCH) "$(CROSS_COMPILE)")
>  
>  ifeq ($(ARCH),ARCH_ARM)
> -- 
> 2.5.5
> 

-- 
Patrick Williams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.ozlabs.org/pipermail/skiboot/attachments/20160728/68b21b4b/attachment.sig>


More information about the Skiboot mailing list