ccache pausing in buildworld

Dimitry Andric dim at FreeBSD.org
Mon Nov 8 19:04:26 UTC 2010


On 2010-11-08 14:48, Emanuel Haupt wrote:
> After updating and zeroing the cache files the a build of RELENG_8_1 fails with:
>
> CC='/usr/local/libexec/ccache/world-cc' mkdep -f .depend -a    -I/usr/src/lib/csu/i386-elf/../common -I/usr/src/lib/csu/i386-elf/../../libc/include /usr/src/lib/csu/i386-elf/crti.S /usr/src/lib/csu/i386-elf/crtn.S
> /usr/local/libexec/ccache/world-cc -O2 -pipe -I/usr/src/lib/csu/i386-elf/../common  -I/usr/src/lib/csu/i386-elf/../../libc/include -std=gnu99  -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wno-pointer-sign -c /usr/src/lib/csu/i386-elf/crti.S
> /usr/local/libexec/ccache/world-cc -O2 -pipe -I/usr/src/lib/csu/i386-elf/../common  -I/usr/src/lib/csu/i386-elf/../../libc/include -std=gnu99  -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wno-pointer-sign -c /usr/src/lib/csu/i386-elf/crtn.S
> /usr/local/libexec/ccache/world-cc -O2 -pipe -I/usr/src/lib/csu/i386-elf/../common  -I/usr/src/lib/csu/i386-elf/../../libc/include -std=gnu99  -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wno-pointer-sign -DGCRT -c -o gcrt1_c.o /usr/src/lib/csu/i386-elf/crt1_c.c
> /usr/local/libexec/ccache/world-cc -O2 -pipe -I/usr/src/lib/csu/i386-elf/../common  -I/usr/src/lib/csu/i386-elf/../../libc/include -std=gnu99  -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wunused-parameter -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wno-pointer-sign -c /usr/src/lib/csu/i386-elf/crt1_s.S
> /usr/src/lib/csu/i386-elf/crt1_s.S: Assembler messages:
> /usr/src/lib/csu/i386-elf/crt1_s.S:34: Error: suffix or operands invalid for `push'
> /usr/src/lib/csu/i386-elf/crt1_s.S:37: Error: `8(%ebp)' is not a valid 64 bit base/index expression
> /usr/src/lib/csu/i386-elf/crt1_s.S:38: Error: suffix or operands invalid for `push'
> /usr/src/lib/csu/i386-elf/crt1_s.S:39: Error: `4(%ebp)' is not a valid 64 bit base/index expression
> /usr/src/lib/csu/i386-elf/crt1_s.S:40: Error: suffix or operands invalid for `push'
> *** Error code 1

This is during the 32-bit build stage on amd64?  If so, what will
happen, depends on how you defined CC.  Makefile.inc1 defines CC as an
environment variable for a sub-make, using something like:

	CC="${CC} -m32 ${LIB32CPUFLAGS} -DCOMPAT_32BIT \
		-isystem ${LIB32TMP}/usr/include/ \
		-L${LIB32TMP}/usr/lib32 \
		-B${LIB32TMP}/usr/lib32"

However, if you either put CC=/usr/local/libexec/ccache/world-cc on the
make command line, or in /etc/src.conf or /etc/make.conf as an
unconditional assignment, it will *always* override the above setting
through the environment, causing the 32-bit build stage to fail.

If this is the case, you could use the same construction I have been
using to get clang to build the 32-bit stage properly, e.g. put:

.if !defined(CC) || ${CC} == "cc"
CC=/usr/local/libexec/ccache/world-cc
.endif
.if !defined(CXX) || ${CXX} == "c++"
CXX=/usr/local/libexec/ccache/world-cc
.endif

in your src.conf or make.conf, as a workaround.

Really fixing this issue requires rather ugly hackery in Makefile.inc1,
bsd.*.mk and so on, though... :-/


More information about the freebsd-hackers mailing list