Skip to contentSkip to conversation

ccache complains in latest git about -p

DISCUSSION Andi Kleen 3 participants 4 messages Mar 25, 2006

lore
Share & tools
lore

Andi Kleen

author
#0 lore raw

ccache complains for me on x86-64 now:

Quoted 1 line

make CC=ccache

make -C /home/lsrc/quilt/linux O=/home/lsrc/quilt/obj
ccache: invalid option -- p
Using /home/lsrc/quilt/linux as source for kernel

It's probably harmless but looks ugly

Quoted 1 line

make CC=ccache V=1

make -C /home/lsrc/quilt/linux O=/home/lsrc/quilt/obj make -C /home/lsrc/quilt/obj \
KBUILD_SRC=/home/lsrc/quilt/linux \
KBUILD_EXTMOD="" -f /home/lsrc/quilt/linux/Makefile _all
ccache: invalid option -- p

-Andi

author
#1 lore raw
Quoted 4 lines · Andi Kleen

ccache complains for me on x86-64 now:

Quoted 1 line

make CC=ccache

Sorry ignore email. Obviously was a typo on my side. With CC="ccache cc" it works as expected.

-Andi

#2 lore raw
Quoted 1 line · Andi Kleen

With CC="ccache cc" it works as expected.

And here I was, thinking that CC should be a variable containing no whitespace, ie. just a single path to a binary, be it relative or absolute, and that there were ways of teaching ccache to be completely transparent (using gentoo, it was set up for me that way):

 $ ls -l /usr/lib/ccache/bin/
insgesamt 0
lrwxrwxrwx 1 root root 15  6. Mär 01:13 c++ -> /usr/bin/ccache
lrwxrwxrwx 1 root root 15  6. Mär 01:13 cc -> /usr/bin/ccache
lrwxrwxrwx 1 root root 15  6. Mär 01:13 g++ -> /usr/bin/ccache
lrwxrwxrwx 1 root root 15  6. Mär 01:13 gcc -> /usr/bin/ccache
lrwxrwxrwx 1 root root 15  6. Mär 01:13 i686-pc-linux-gnu-c++ ->
/usr/bin/ccache
lrwxrwxrwx 1 root root 15  6. Mär 01:13 i686-pc-linux-gnu-g++ ->
/usr/bin/ccache
lrwxrwxrwx 1 root root 15  6. Mär 01:13 i686-pc-linux-gnu-gcc ->
/usr/bin/ccache
 $ 

So all I need to do in order to enable ccache is add this stub dir to the front of my PATH:

 $ echo $PATH
/usr/lib/ccache/bin:/usr/lib/distcc/bin:/usr/local/bin:/usr/i686-pc-linux-gnu/gcc-bin/4.1.0:[...]
(Note: the order of distcc after ccache is important, if not obvious)

So what the thing does is call the next instance of the name it was called by from your path, ie. subtracts dirname($0) from the beginning of $PATH, and supply each and every argument to that. In my past setup, stuff is taken from the cache, and if not found, distributed across machines. Works extremely well for kernel builds on slow machines, with a faster one right beside it. And no dirty CC= stuff to begin with : )

AFAICT this is not a religious or purist issues, as there have been real problems with CC not following the recommendation and some projects relying on that, but as this thread goes to show there occur problems even without real problems existing ; ) Maybe setting obscure CC variables works reliably for kernel builds, I never tried...

Kind regards,

Chris

#3 lore raw
In reply to Andi Kleen
Quoted 3 lines · Andi Kleen

ccache complains for me on x86-64 now:

Quoted 1 line

make CC=ccache

Didn't you mean CC="ccache gcc"?

Andreas.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."