# ccache confusion with gcc45



## Beeblebrox (May 7, 2011)

Using *gcc45* for ports, base *(gcc42)* for world/kernel (as it shoud be).  Just started using *ccache* but my dual setup is giving me some trouble.  I have this in make.conf for *ccache*:

```
.if !defined(NO_CCACHE)
.if !empty{.CURDIR:M/usr/ports/*}
CC=  /usr/local/libexec/ccache/world/gcc45
CXX= /usr/local/libexec/ccache/world/gc++45
CFLAGS+= -mssse3
.else 
CC=  /usr/local/libexec/ccache/world/cc
CXX= /usr/local/libexec/ccache/world/c++
.endif
.endif

.if ${.CURDIR:M*/ports/devel/ccache}
  NO_CCACHE= yes
  CC= gcc45
  CXX= g++45
  CPP= cpp45
  CFLAGS+= -mssse3
.endif
```
But obviously something is missing since I just got error below.

```
checking if /usr/local/libexec/ccache/world/gcc45 supports -fno-rtti -fno-exceptions... no
checking whether we are using the GNU C++ compiler... no
checking whether /usr/local/libexec/ccache/world/gc++45 accepts -g... no
checking dependency style of /usr/local/libexec/ccache/world/gc++45... none
checking how to run the C++ preprocessor... /lib/cpp
configure: error: in `/arch/cvsup/obj/arch/cvsup/ports/graphics/tiff/work/tiff-4.0.0beta6':
configure: error: C++ [color="Red"]preprocessor "/lib/cpp" fails sanity check[/color]
```
EDIT: I also tried a run on a simple port by placing the following entry in make.conf's if statement. No improvement - still breaks with CPP inconsistency.  Of course, I first created the 2 cpp45 symlinks in /usr/local/libexec/ccache and its sub-dir world.

```
CPP= /usr/local/libexec/ccache/world/cpp45
```
Before posting, I also played around with sysutils/bsdadminscripts settings and commented out the lines from make.conf above.
QUESTIONS:
1. It seems sysutils/bsdadminscripts is able to tell that *gcc45* is installed - fine for ports.  How would I go about telling it to use *gcc42* when doing world stuff?

2. The above setup does not seem to pass the correct CPP for ports and I think it is passing the base CPP instead of CPP45. Will the CCACHE_CC= GCC45 setting take care of all 3 flags (CC-CXX-CPP)?  If I also use sysutils/bsdadminscripts where in the .conf should I place this?

3. EDIT: Oh btw, buildworld breaks too, even though I have commented out everything except:

```
CC=  /usr/local/libexec/ccache/world/cc
CXX= /usr/local/libexec/ccache/world/c++
```


```
/src/lib/csu/i386-elf/crt1_s.S: Assembler messages:
/src/lib/csu/i386-elf/crt1_s.S:38: Error: suffix or operands invalid for `push'
/src/lib/csu/i386-elf/crt1_s.S:41: Error: bad register expression
/src/lib/csu/i386-elf/crt1_s.S:42: Error: bad register expression
/src/lib/csu/i386-elf/crt1_s.S:46: Error: suffix or operands invalid for `push'
/src/lib/csu/i386-elf/crt1_s.S:47: Error: suffix or operands invalid for `push'
/src/lib/csu/i386-elf/crt1_s.S:48: Error: suffix or operands invalid for `push'
*** Error code 1
Stop in /src/lib/csu/i386-elf.
```


----------



## kamikaze (Aug 12, 2011)

I haven't been here for a long, long time.

The answer you were looking for can be found in buildflags.mk(1).


----------

