Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 542516 - dev-util/strace-4.10 calls gcc breaking distcc
Summary: dev-util/strace-4.10 calls gcc breaking distcc
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-08 07:15 UTC by Petr Pisar
Modified: 2015-03-09 03:28 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Pisar 2015-03-08 07:15:16 UTC
I have a mips host which uses distcc to distribute builds to localhost and remote x86_64 machine. Building dev-util/strace-4.10 fails:

>>> Compiling source in /var/tmp/portage/dev-util/strace-4.10/work/strace-4.10 ...
make -j2 
cat linux/mips/ioctls_inc0.h linux/mips/ioctls_arch0.h > ioctls_all0.h
gcc -DHAVE_CONFIG_H -I.  -I./linux/mips -I./linux/mips -I./linux -I./linux  -Wall -Wwrite-strings -Wsign-compare -g -O2 -DIOCTLSORT_INC=\"ioctls_all0.h\" -c -o ioctlsort0.o ./ioctlsort.c
./ioctlsort.c: In function ‘compare_name_info’:
./ioctlsort.c:66:174: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
[...]
./ioctlsort.c:112:1762: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
gcc -Wall -Wwrite-strings -Wsign-compare -g -O2   ioctlsort0.o -o ioctlsort0
/usr/lib/gcc/mips64el-unknown-linux-gnu/4.9.2/../../../../mips64el-unknown-linux-gnu/bin/ld: ioctlsort0.o: Relocations in generic ELF (EM: 62)
[...]
ioctlsort0.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
distcc[10309] ERROR: compile (null) on localhost failed

This is config.log:
  $ ./configure --prefix=/usr --build=mips64el-unknown-linux-gnu --host=mips64el-unknown-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --libdir=/usr/lib32
[...]
CC='mips64el-unknown-linux-gnu-gcc'
CCDEPMODE='depmode=none'
CC_FOR_BUILD='gcc'

And the use in the Makefile.am:

ioctlsort_CC = $(CC_FOR_BUILD)
ioctlsort_DEFS = $(DEFS)
ioctlsort_INCLUDES = $(DEFAULT_INCLUDES) $(INCLUDES)
ioctlsort_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_FOR_BUILD)
ioctlsort_CFLAGS = $(AM_CFLAGS) $(CFLAGS_FOR_BUILD)
ioctlsort_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD)

ioctls_inc_h = $(wildcard $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h)
ioctlent_h = $(patsubst $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%,ioctlent%,$(ioctls_inc_h))
BUILT_SOURCES += $(ioctlent_h)
CLEANFILES = $(ioctlent_h)

ioctlent%.h: ioctlsort%
        ./$< > $@

ioctlsort%$(BUILD_EXEEXT): ioctlsort%.o
        $(ioctlsort_CC) $(ioctlsort_CFLAGS) $(ioctlsort_LDFLAGS) $< -o $@

ioctlsort%.o: ioctls_all%.h $(srcdir)/ioctlsort.c
        $(ioctlsort_CC) $(ioctlsort_DEFS) $(ioctlsort_INCLUDES) $(ioctlsort_CPPFLAGS) $(ioctlsort_CFLAGS) -DIOCTLSORT_INC=\"$<\" -c -o $@ $(srcdir)/ioctlsort.c

Obviously, the ioctlsort is intended for running only on the host system at build time. But because configure script does not propagate --host option value to the CC_FOR_BUILD properly, it uses "gcc" instead of "mips64el-unknown-linux-gnu-gcc".
Comment 1 Brian Dolbec (RETIRED) gentoo-dev 2015-03-09 02:19:59 UTC
Please incluse your emerge --info and relevant distcc config's
Comment 2 SpanKY gentoo-dev 2015-03-09 03:28:38 UTC
i don't see a bug here.  ioctlsort is a build-time tool that is compiled with the build-time compiler and executed at build-time.  it isn't compiled or installed for the target.

if your distcc is wrapping `gcc`, then that's broken.