All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle via buildroot <buildroot@buildroot.org>
To: "Andreas Düring" <brpi@duering-andreas.de>, buildroot@buildroot.org
Subject: Re: [Buildroot] Buildroot does not use ccache for compiling Linux kernel?
Date: Sat, 14 Sep 2024 21:51:21 +0200	[thread overview]
Message-ID: <1456288c-ea8a-401d-bdec-c51d4fbdf09d@mind.be> (raw)
In-Reply-To: <20240914201937.567067fd@devuanPc.fritz.box>



On 14/09/2024 20:19, Andreas Düring via buildroot wrote:
> Hello,
> 
> I am currently experimenting with building a minimal image for my
> Raspberry Pi.
> 
> During this process, I realized that ccache, although enabled, is not
> used for compiling the Linux kernel.

  That is very weird, because ccache is added by the toolchain wrapper. It can 
only be disabled by setting BR2_USE_CCACHE=0 in the environment (or on the make 
command line).

  How did you determine that it doesn't use ccache?

> I think this is because of the
> recipe in linux/linux.mk:
> 
> LINUX_MAKE_FLAGS = \
>          HOSTCC="$(HOSTCC) $(subst -I/,-isystem /,$(subst -I /,-isystem /,$(HOST_CFLAGS))) $(HOST_LDFLAGS)" \

  We explicitly don't use ccache here (HOSTCC doesn't use the wrapper, so it 
needs to be added explicitly there). See commit 71a31b23 for an explanation why.

>          ARCH=$(KERNEL_ARCH) \
>          INSTALL_MOD_PATH=$(TARGET_DIR) \
>          CROSS_COMPILE="$(TARGET_CROSS)" \
>          WERROR=0 \
>          REGENERATE_PARSERS=1 \
>          DEPMOD=$(HOST_DIR)/sbin/depmod
> 
> 
> The linux kernel seems to assemble the compiler using TARGET_CROSS,
> e.g.
> CC = $(TARGET_CROSS)gcc
> 
> As a very crude solution, I changed the corresponding line to
>          CROSS_COMPILE="ccache $(TARGET_CROSS)"

  This is what we had originally, but it was removed in commit 546a69db66ab 
because it is now done by the wrapper.

  Regards,
  Arnout

> but this is probably not the optimal solution. (I didn't carefully
> check where else CROSS_COMPILE is used).
> 
> If this is a known limitation? Should this be added to the
> documentation?
> https://buildroot.org/downloads/manual/manual.html#ccache
> ("This will automatically build ccache and use it for every host and
> target compilation.")
> 
> With best regards,
> Andreas
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      parent reply	other threads:[~2024-09-14 19:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-14 18:19 [Buildroot] Buildroot does not use ccache for compiling Linux kernel? Andreas Düring via buildroot
2024-09-14 18:25 ` Thomas Petazzoni via buildroot
2024-09-14 18:35   ` Andreas Düring via buildroot
2024-09-14 19:51 ` Arnout Vandecappelle via buildroot [this message]

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=1456288c-ea8a-401d-bdec-c51d4fbdf09d@mind.be \
    --to=buildroot@buildroot.org \
    --cc=arnout@mind.be \
    --cc=brpi@duering-andreas.de \
    /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.