All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [RFCv1 0/4] Per-package SDK and target directories
Date: Sat, 11 Nov 2017 11:20:01 +0100	[thread overview]
Message-ID: <6dc6ae96-ac4c-8f47-fe89-ac158f99b16e@mind.be> (raw)
In-Reply-To: <5DBA847110A28B46BBA17BE675F0C9B2181AA436@cnshjmbx01>



On 09-11-17 06:02, Chu, Zhuliang (NSB - CN/Shanghai) wrote:
> Hello,
> 
>> By the way there will also be a problem when host-tar is part of
>> DEPENDENCIES_HOST_PREREQ: ccache needs host-tar to be able to build, but there
>> is no explicit dependency between them, it relies purely on left-to-right order.
> the host-ccache mainly because its directory is defined in the top-level Makefile as below.

 Good catch!

>  453 ifeq ($(BR2_CCACHE),y)
>  454 CCACHE := $(HOST_DIR)/bin/ccache
>  455 BR_CACHE_DIR ?= $(call qstrip,$(BR2_CCACHE_DIR))
>  456 export BR_CACHE_DIR
>  457 HOSTCC := $(CCACHE) $(HOSTCC)
>  458 HOSTCXX := $(CCACHE) $(HOSTCXX)

 The problem is that these things are assigned with := instead of = so
$(HOST_DIR) will not get expanded to per-package like it should. Putting = here
will lead to a self-referencing recursive variable. The obvious thing would be
to change it into
HOSTCC_CCACHE = $(CCACHE) $(HOSTCC)
and use HOSTCC_CCACHE everywhere. Unfortunately, that is *very* risky because we
export HOSTCC, so we have no full control over all its uses. (Admittedly, the
risk is limited to not using ccache in some cases, which is not that bad.)

 Perhaps the following can work:

HOSTCC_ORIG := $(HOSTCC)
HOSTCC = $(CCACHE) $(HOSTCC_ORIG)

(and we can probably reuse HOSTCC_NOCCACHE instead of HOSTCC_ORIG). This does
seem to work from a very quick check.

>  459 else
>  460 export BR_NO_CCACHE
>  461 endif
> 
> In the top Makefile, $(CCACHE) is defined as 'output/host/bin/ccache'. So during the compilation process, the $(CCACHE) will do not be found. 

 For CCACHE itself there is no real problem, we can use = instead of := there,
it does not reference itself.

 Regards,
 Arnout

> In fact, its real location is in `output/per-package/host-ccache/host/bin/ccache`.
> The path to host-tar is not defined in top Makefile, So host-tar did not report the same error.

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

  reply	other threads:[~2017-11-11 10:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <5DBA847110A28B46BBA17BE675F0C9B2181A8D38@cnshjmbx01>
2017-11-07 17:13 ` [Buildroot] [RFCv1 0/4] Per-package SDK and target directories Thomas Petazzoni
2017-11-07 17:55   ` Arnout Vandecappelle
2017-11-07 19:55     ` Thomas Petazzoni
2017-11-07 20:54       ` Arnout Vandecappelle
2017-11-09  5:02     ` Chu, Zhuliang
2017-11-11 10:20       ` Arnout Vandecappelle [this message]
2017-11-09  4:32   ` Chu, Zhuliang
2017-11-11 10:37     ` Arnout Vandecappelle
2017-11-15  8:59       ` Chu, Zhuliang
2017-11-08 16:55 ` Thomas Petazzoni
2017-11-09  4:44   ` Chu, Zhuliang
2017-11-08 17:29 ` Yann E. MORIN
2017-11-08 18:35   ` Thomas De Schampheleire
2017-11-09  8:19   ` Chu, Zhuliang
2017-11-03 16:06 Thomas Petazzoni
2017-11-07 23:21 ` Arnout Vandecappelle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6dc6ae96-ac4c-8f47-fe89-ac158f99b16e@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.