Re: [ccache] Old code ccache hit always come back unless CCACHE_DISABLE is used

2012-06-07 Thread g . esp


- Mail original -
> De: "g esp" 
> À: "Joel Rosdahl" 
> Cc: ccache@lists.samba.org
> Envoyé: Mardi 5 Juin 2012 22:48:48
> Objet: Re: [ccache] Old code ccache hit always come back unless 
> CCACHE_DISABLE is used
> 
> 
> 
> - Mail original -
> > De: "Joel Rosdahl" 
> > À: "g esp" 
> > Cc: ccache@lists.samba.org
> > Envoyé: Samedi 2 Juin 2012 18:29:30
> > Objet: Re: [ccache] Old code ccache hit always come back unless
> > CCACHE_DISABLE is used
> > 
> > On 1 June 2012 12:12,   wrote:
> > > On the no-fPIE case, using CCACHE_CPP2=1 change compilation to
> > > work.
> > > Any next recompilation even without CCACHE_CPP2=1 result in cache
> > > hit.
> > 
> > Yes, so this means that the compiler has a bug. You should be able
> > to
> > reproduce it by running these two commands:
> > 
> > /usr/bin/gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -include
> > ../config.h
> > -I../include -DLOCALEDIR="/usr/share/locale" -fsigned-char -Os
> > -march=i486 -mtune=pentium -pipe -fomit-frame-pointer -c -MT
> > lscpu.o
> > -MD -MP -MF .deps/lscpu.Tpo -E lscpu.c -o lscpu.i
> > /usr/bin/gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -include
> > ../config.h
> > -I../include -DLOCALEDIR="/usr/share/locale" -fsigned-char -Os
> > -march=i486 -mtune=pentium -pipe -fomit-frame-pointer -c lscpu.i -o
> > lscpu.o
> > 
> > As mentioned, the ccache workaround for this kind of bug is to set
> > CCACHE_CPP2=1.
> > 
> > -- Joel
> > 
> True, the second part fail for gcc-4.4.5 with
> lscpu.c: In function 'read_hypervisor':
> lscpu.c:446: error: can't find a register in class 'BREG' while
> reloading 'asm'
> lscpu.c:446: error: 'asm' operand has impossible constraints
> 
> the good new is that the issue is workaround on util-linux-2.21.2 as
> more recent compiler warn for undefined operation there
> 
This was wrong, that still fail with my gcc-4.4.5.
Just that I used during testing a wrong variable name instead of 
CCACHE_RECACHE, so I received from ccache the result of previous compilation 
made with CCACHE_CPP2=1.

So CCACHE_CPP2=1 is required for me to compile lscpu.

Gilles
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] Old code ccache hit always come back unless CCACHE_DISABLE is used

2012-06-05 Thread g . esp


- Mail original -
> De: "Joel Rosdahl" 
> À: "g esp" 
> Cc: ccache@lists.samba.org
> Envoyé: Samedi 2 Juin 2012 18:29:30
> Objet: Re: [ccache] Old code ccache hit always come back unless 
> CCACHE_DISABLE is used
> 
> On 1 June 2012 12:12,   wrote:
> > On the no-fPIE case, using CCACHE_CPP2=1 change compilation to
> > work.
> > Any next recompilation even without CCACHE_CPP2=1 result in cache
> > hit.
> 
> Yes, so this means that the compiler has a bug. You should be able to
> reproduce it by running these two commands:
> 
> /usr/bin/gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -include ../config.h
> -I../include -DLOCALEDIR="/usr/share/locale" -fsigned-char -Os
> -march=i486 -mtune=pentium -pipe -fomit-frame-pointer -c -MT lscpu.o
> -MD -MP -MF .deps/lscpu.Tpo -E lscpu.c -o lscpu.i
> /usr/bin/gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -include ../config.h
> -I../include -DLOCALEDIR="/usr/share/locale" -fsigned-char -Os
> -march=i486 -mtune=pentium -pipe -fomit-frame-pointer -c lscpu.i -o
> lscpu.o
> 
> As mentioned, the ccache workaround for this kind of bug is to set
> CCACHE_CPP2=1.
> 
> -- Joel
> 
True, the second part fail for gcc-4.4.5 with
lscpu.c: In function 'read_hypervisor':
lscpu.c:446: error: can't find a register in class 'BREG' while reloading 'asm'
lscpu.c:446: error: 'asm' operand has impossible constraints

the good new is that the issue is workaround on util-linux-2.21.2 as more 
recent compiler warn for undefined operation there

commit 550a02d6e75833be169ac22ab4a2d479cc2ffcbf
Author: Petr Uzel 
Date:   Mon Apr 23 10:43:38 2012 +0200

lscpu: fix possibly undefined operation

With -Wall -Werror, compilation of lscpu.c fails with:

  Making all in sys-utils
  make[2]: Entering directory `/home/petr/upstream/util-linux/sys-utils'
  gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -include ../config.h 
-I../include -DLOCALEDIR=\"/usr/share/locale\"  -fsigned-char -Wall -Werror -MT 
lscpu.o -M
  lscpu.c: In function ‘print_parsable’:
  lscpu.c:971:7: error: operation on ‘p’ may be undefined 
[-Werror=sequence-point]
  cc1: all warnings being treated as errors

Fix by splitting the pointer increment to separate statement.

Signed-off-by: Petr Uzel 

diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c
index 65e1eb6..ee6969c 100644
--- a/sys-utils/lscpu.c
+++ b/sys-utils/lscpu.c
@@ -966,8 +966,10 @@ print_parsable(struct lscpu_desc *desc, int cols[], int 
ncols,
 */
char *p = data + 1;

-   while (p && *p != '\0')
-   *p++ = tolower((unsigned int) *p);
+   while (p && *p != '\0') {
+   *p = tolower((unsigned int) *p);
+   p++;
+   }
}
fputs(data && *data ? data : "", stdout);
}

So there is no issue on ccache and gcc-4.4.5 was not totally wrong while 
failing to compile.

Gilles
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] Old code ccache hit always come back unless CCACHE_DISABLE is used

2012-06-02 Thread Joel Rosdahl
On 1 June 2012 12:12,   wrote:
> On the no-fPIE case, using CCACHE_CPP2=1 change compilation to work.
> Any next recompilation even without CCACHE_CPP2=1 result in cache hit.

Yes, so this means that the compiler has a bug. You should be able to
reproduce it by running these two commands:

/usr/bin/gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -include ../config.h
-I../include -DLOCALEDIR="/usr/share/locale" -fsigned-char -Os
-march=i486 -mtune=pentium -pipe -fomit-frame-pointer -c -MT lscpu.o
-MD -MP -MF .deps/lscpu.Tpo -E lscpu.c -o lscpu.i
/usr/bin/gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -include ../config.h
-I../include -DLOCALEDIR="/usr/share/locale" -fsigned-char -Os
-march=i486 -mtune=pentium -pipe -fomit-frame-pointer -c lscpu.i -o
lscpu.o

As mentioned, the ccache workaround for this kind of bug is to set
CCACHE_CPP2=1.

-- Joel
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] Old code ccache hit always come back unless CCACHE_DISABLE is used

2012-06-01 Thread g . esp


- Mail original -
> De: "Joel Rosdahl" 
> À: "g esp" 
> Cc: ccache@lists.samba.org
> Envoyé: Mercredi 30 Mai 2012 19:53:31
> Objet: Re: [ccache] Old code ccache hit always come back unless 
> CCACHE_DISABLE is used
> 
> On 30 May 2012 09:14,   wrote:
> > I had in the past an issue compiling util-linux-2.18 lscpu that was
> > worked around adding '-fPIE -pie' to CFLAGS.
> > The issue is that now with any new and fixed util-linux package,
> > this workaround can't be removed or old compilation issue come
> > back, unless CCACHE_DISABLE is used.
> > [...]
> > What should allow ccache not to retrieve the old hit that fail?
> 
> As can be seen in no-fPIE.log, ccache doesn't get any cache hit, so it
> isn't related to false cache hits.
> 
> My guess is that when you compile without "-fPIE -pie", the compiler
> can't compile its own preprocessed output. If this is the case,
> setting CCACHE_CPP2=1 should make it work.
> 
> -- Joel
> 
For the record, the original issue was with ccache-3.1.5 or 3.1.6, 
binutils-2.21.1a, gcc-4.4.5 (patched spec to default to -fPIE)

On the no-fPIE case, using CCACHE_CPP2=1 change compilation to work.
Any next recompilation even without CCACHE_CPP2=1 result in cache hit.

I changed to ccache-3.1.7 and behavior is the same.
I next changed gcc to gcc-4.4.7 and behavior is the same.

Compilation work :
- with CCACHE_DISABLE= or CCACHE_CPP2=1

Compilation fail :
- with ccache-3.1.{5,6,7} and without CCACHE_CPP2=1 (using CCACHE_RECACHE to 
not depend from ccache content)
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -include ../config.h -I../include 
-DLOCALEDIR=\"/usr/share/locale\"  -fsigned-char -Os -march=i486 -mtune=pentium 
-pipe -fomit-frame-pointer -MT lscpu.o -MD -MP -MF .deps/lscpu.Tpo -c -o 
lscpu.o lscpu.c
lscpu.c: In function 'read_hypervisor':
lscpu.c:446: error: can't find a register in class 'BREG' while reloading 'asm'
lscpu.c:446: error: 'asm' operand has impossible constraints
make: *** [lscpu.o] Error 1

Gilles
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


Re: [ccache] Old code ccache hit always come back unless CCACHE_DISABLE is used

2012-05-30 Thread Joel Rosdahl
On 30 May 2012 09:14,   wrote:
> I had in the past an issue compiling util-linux-2.18 lscpu that was worked 
> around adding '-fPIE -pie' to CFLAGS.
> The issue is that now with any new and fixed util-linux package, this 
> workaround can't be removed or old compilation issue come back, unless 
> CCACHE_DISABLE is used.
> [...]
> What should allow ccache not to retrieve the old hit that fail?

As can be seen in no-fPIE.log, ccache doesn't get any cache hit, so it
isn't related to false cache hits.

My guess is that when you compile without "-fPIE -pie", the compiler
can't compile its own preprocessed output. If this is the case,
setting CCACHE_CPP2=1 should make it work.

-- Joel
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


[ccache] Old code ccache hit always come back unless CCACHE_DISABLE is used

2012-05-30 Thread g . esp
I had in the past an issue compiling util-linux-2.18 lscpu that was worked 
around adding '-fPIE -pie' to CFLAGS.
The issue is that now with any new and fixed util-linux package, this 
workaround can't be removed or old compilation issue come back, unless 
CCACHE_DISABLE is used.

Using the CFLAGS workaround produce this log
[chroot-i486] root:/usr/src/util-linux-2.21.2/sys-utils$ make lscpu V=1 
CCACHE_LOGFILE=./mylog

Removing '-fPIE -pie' from CFLAGS show
[chroot-i486] root:/usr/src/util-linux-2.21.2/sys-utils$ make clean && make 
lscpu V=1 CCACHE_LOGFILE=./no-fPIE.log
...
rm -f *.o
rm -f *.lo
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -include ../config.h -I../include 
-DLOCALEDIR=\"/usr/share/locale\"  -fsigned-char -Os -march=i486 -mtune=pentium 
-pipe -fomit-frame-pointer -MT lscpu.o -MD -MP -MF .deps/lscpu.Tpo -c -o 
lscpu.o lscpu.c
lscpu.c: In function 'read_hypervisor':
lscpu.c:446: error: can't find a register in class 'BREG' while reloading 'asm'
lscpu.c:446: error: 'asm' operand has impossible constraints
make: *** [lscpu.o] Error 1

which is the old issue in 2.18, fixed in 2.19.

If using CCACHE_DISABLE, compilation does not fail
[chroot-i486] root:/usr/src/util-linux-2.21.2/sys-utils$ make clean && make 
lscpu V=1 CCACHE_DISABLE=
...
rm -f *.o
rm -f *.lo
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -include ../config.h -I../include 
-DLOCALEDIR=\"/usr/share/locale\"  -fsigned-char -Os -march=i486 -mtune=pentium 
-pipe -fomit-frame-pointer -MT lscpu.o -MD -MP -MF .deps/lscpu.Tpo -c -o 
lscpu.o lscpu.c
mv -f .deps/lscpu.Tpo .deps/lscpu.Po
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -include ../config.h -I../include 
-DLOCALEDIR=\"/usr/share/locale\"  -fsigned-char -Os -march=i486 -mtune=pentium 
-pipe -fomit-frame-pointer -MT cpuset.o -MD -MP -MF .deps/cpuset.Tpo -c -o 
cpuset.o `test -f '../lib/cpuset.c' || echo './'`../lib/cpuset.c
mv -f .deps/cpuset.Tpo .deps/cpuset.Po
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -include ../config.h -I../include 
-DLOCALEDIR=\"/usr/share/locale\"  -fsigned-char -Os -march=i486 -mtune=pentium 
-pipe -fomit-frame-pointer -MT strutils.o -MD -MP -MF .deps/strutils.Tpo -c -o 
strutils.o `test -f '../lib/strutils.c' || echo './'`../lib/strutils.c
mv -f .deps/strutils.Tpo .deps/strutils.Po
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -include ../config.h -I../include 
-DLOCALEDIR=\"/usr/share/locale\"  -fsigned-char -Os -march=i486 -mtune=pentium 
-pipe -fomit-frame-pointer -MT mbsalign.o -MD -MP -MF .deps/mbsalign.Tpo -c -o 
mbsalign.o `test -f '../lib/mbsalign.c' || echo './'`../lib/mbsalign.c
mv -f .deps/mbsalign.Tpo .deps/mbsalign.Po
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -include ../config.h -I../include 
-DLOCALEDIR=\"/usr/share/locale\"  -fsigned-char -Os -march=i486 -mtune=pentium 
-pipe -fomit-frame-pointer -MT tt.o -MD -MP -MF .deps/tt.Tpo -c -o tt.o `test 
-f '../lib/tt.c' || echo './'`../lib/tt.c
mv -f .deps/tt.Tpo .deps/tt.Po
gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..  -include ../config.h -I../include 
-DLOCALEDIR=\"/usr/share/locale\"  -fsigned-char -Os -march=i486 -mtune=pentium 
-pipe -fomit-frame-pointer -MT path.o -MD -MP -MF .deps/path.Tpo -c -o path.o 
`test -f '../lib/path.c' || echo './'`../lib/path.c
mv -f .deps/path.Tpo .deps/path.Po
/bin/sh ../libtool  --tag=CC   --mode=link gcc -std=gnu99 -fsigned-char -Os 
-march=i486 -mtune=pentium -pipe -fomit-frame-pointer  -Wl,--hash-style=gnu -o 
lscpu lscpu.o cpuset.o strutils.o mbsalign.o tt.o path.o
libtool: link: gcc -std=gnu99 -fsigned-char -Os -march=i486 -mtune=pentium 
-pipe -fomit-frame-pointer -Wl,--hash-style=gnu -o lscpu lscpu.o cpuset.o 
strutils.o mbsalign.o tt.o path.o

What should allow ccache not to retrieve the old hit that fail?

Gilles
 [2012-05-30T09:05:01.777185 8654 ] === CCACHE STARTED =
[2012-05-30T09:05:01.777399 8654 ] Command line: gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -include ../config.h -I../include -DLOCALEDIR="/usr/share/locale" -fsigned-char -Os -march=i486 -mtune=pentium -pipe -fomit-frame-pointer -MT lscpu.o -MD -MP -MF .deps/lscpu.Tpo -c -o lscpu.o lscpu.c
[2012-05-30T09:05:01.777417 8654 ] Hostname: amd64
[2012-05-30T09:05:01.777428 8654 ] Working directory: /usr/src/util-linux-2.21.2/sys-utils
[2012-05-30T09:05:01.777490 8654 ] Source file: lscpu.c
[2012-05-30T09:05:01.777501 8654 ] Dependency file: .deps/lscpu.Tpo
[2012-05-30T09:05:01.777512 8654 ] Object file: lscpu.o
[2012-05-30T09:05:01.777530 8654 ] Executing compiler check command echo a59a2c6b8a999e8cadc2780f67bdb24a /home/gesp/ipcop/2.svn/build_i486/ipcop/usr/bin/gcc
[2012-05-30T09:05:01.778117 8654 ] Trying direct lookup
[2012-05-30T09:05:01.778486 8654 ] Looking for object file hash in /usr/src/ccache/6/2/0d67e827e755a2a113751dd92633d6-30002.manifest
[2012-05-30T09:05:01.778505 8654 ] No such manifest file
[2012-05-30T09:05:01.778516 8654 ] Did not find object file hash in manifest
[2012-05-30T09:05:01.778526 8654 ] Running preprocessor
[2012-05-30T09:05:01.778555 8654 ] Exec