GwenNelson / distcc

Automatically exported from code.google.com/p/distcc
GNU General Public License v2.0
0 stars 0 forks source link

unknown translation unit - mips64 compiler #141

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

distcc --version:
distcc 3.2rc1 compiled for x86_64-unknown-linux-gnu

uname -a:
2.6.39.4-9.NSN.kiuas #1 SMP Thu Feb 13 08:58:31 EET 2014 x86_64 x86_64 x86_64 
GNU/Linux

gcc -v:
gcc version 4.1.2 20080704

I'm trying to use distcc in pump mode, and I see some errors like the following:

--------------------------------
__________Using distcc-pump from 
/var/fpwork/workspace_venkrao/mainline_ccache_evaluation_scm_vkr/apps/distcc/bin
__________Found       1 available distcc servers
WARNING include server: Preprocessing locally. Include server not covering: 
Couldn't determine default system include directories
for compiler 
'/home/venkrao/mainline_ccache_evaluation_scm_vkr/mips64-octeon2-linux-gnu-g++',
 language 'c++':
error executing 
'['/home/venkrao/mainline_ccache_evaluation_scm_vkr/mips64-octeon2-linux-gnu-g++
', '-x', 'c++', '-v', '-c', '/dev/null', '-o', '/dev/null']': [Errno 8] Exec 
format error. for translation unit 'unknown translation unit'
distcc[14700] (dcc_talk_to_include_server) Warning: include server gave up 
analyzing
distcc[14700] (dcc_build_somewhere) Warning: failed to get includes from 
include server, preprocessing locally
__________Shutting down distcc-pump include server

----------------

Without pump mode, I'm successful in distrubution my compilation to a bunch of 
machines. Its only the pump mode that is failing for me.

/home/venkrao/mainline_ccache_evaluation_scm_vkr/mips64-octeon2-linux-gnu-g++ 
is a wrapper on my compiler. The conetnt of this file is:

export PATH=/home/venkrao/mainline_ccache_evaluation_scm_vkr:$PATH
/path/to/packages/gcc/usr/bin/mips64-octeon2-linux-gnu-g++ 
--sysroot=/path/to/sys-root/mips64-octeon2-linux-gnu "$@"

I verified that the said command that was failed to execute, 
/home/venkrao/mainline_ccache_evaluation_scm_vkr/mips64-octeon2-linux-gnu-g++ 
-x c++ -v -c /dev/null -o /dev/null

works just fine for me when run on a shell.
The output I get, when I run it manually is:

-----------

>> 
/home/venkrao/mainline_ccache_evaluation_scm_vkr/mips64-octeon2-linux-gnu-g++ 
-x c++ -v -c /dev/null -o /dev/null

Using built-in specs.
Target: mips64-octeon2-linux-gnu
Configured with: 
/path/to/packages/gcc/work/gcc-4.3/build/i686-pc-linux-gnu/gcc-4.3/gcc-4.3.3/con
figure 
--prefix=/path/to/packages/gcc/work/gcc-4.3/build/i686-pc-linux-gnu/gcc-4.3/../.
./../releases/i686-pc-linux-gnu/glibc-2.3/GCC-4.3.3_13470/usr 
--program-prefix=mips64-octeon2-linux-gnu- --with-pkgversion=GCC-4.3.3_13470 
--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu 
--target=mips64-octeon2-linux-gnu 
--with-sysroot=/path/to/packages/gcc/work/gcc-4.3/build/i686-pc-linux-gnu/gcc-4.
3/../../../releases/i686-pc-linux-gnu/glibc-2.3/GCC-4.3.3_13470/usr/mips64-octeo
n2-linux-gnu/sys-root --disable-generated-files-in-srcdir 
--disable-libstdcxx-pch --disable-nls --disable-multilib --enable-threads=posix 
--enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++ 
--enable-shared --enable-c99 --enable-long-long --enable-cxx-flags='-g -Os 
-fno-strict-aliasing -fasynchronous-unwind-tables -mabi=64 -march=octeon2' 
--without-fp --with-float=soft --enable-target-optspace --disable-fixed-point 
--with-mips-plt
Thread model: posix
gcc version 4.3.3 (GCC-4.3.3_13470)
COLLECT_GCC_OPTIONS='-v' '-c' '-o' '/dev/null' '-shared-libgcc' '-msoft-float' 
'-mllsc' '-mplt' '-mno-shared' '-EB' '-mabi=64'
 /path/to/packages/gcc/usr/bin/../libexec/gcc/mips64-octeon2-linux-gnu/4.3.3/cc1plus -quiet -v -iprefix /path/to/packages/gcc/usr/bin/../lib/gcc/mips64-octeon2-linux-gnu/4.3.3/ -isysroot /path/to/os/sys-root/mips64-octeon2-linux-gnu -D_GNU_SOURCE /dev/null -meb -fasynchronous-unwind-tables -quiet -dumpbase null -msoft-float -mllsc -mplt -mno-shared -mabi=64 -auxbase-strip /dev/null -version -o /tmp/cclfu6Wh.s
ignoring duplicate directory 
"/path/to/packages/gcc/usr/bin/../lib/gcc/../../lib/gcc/mips64-octeon2-linux-gnu
/4.3.3/../../../../mips64-octeon2-linux-gnu/include/c++/4.3.3"
ignoring duplicate directory 
"/path/to/packages/gcc/usr/bin/../lib/gcc/../../lib/gcc/mips64-octeon2-linux-gnu
/4.3.3/../../../../mips64-octeon2-linux-gnu/include/c++/4.3.3/mips64-octeon2-lin
ux-gnu"
ignoring duplicate directory 
"/path/to/packages/gcc/usr/bin/../lib/gcc/../../lib/gcc/mips64-octeon2-linux-gnu
/4.3.3/../../../../mips64-octeon2-linux-gnu/include/c++/4.3.3/backward"
ignoring nonexistent directory 
"/path/to/os/sys-root/mips64-octeon2-linux-gnu/usr/local/include"
ignoring duplicate directory 
"/path/to/packages/gcc/usr/bin/../lib/gcc/../../lib/gcc/mips64-octeon2-linux-gnu
/4.3.3/include"
ignoring duplicate directory 
"/path/to/packages/gcc/usr/bin/../lib/gcc/../../lib/gcc/mips64-octeon2-linux-gnu
/4.3.3/include-fixed"
ignoring duplicate directory 
"/path/to/packages/gcc/usr/bin/../lib/gcc/../../lib/gcc/mips64-octeon2-linux-gnu
/4.3.3/../../../../mips64-octeon2-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /path/to/packages/gcc/usr/bin/../lib/gcc/mips64-octeon2-linux-gnu/4.3.3/../../../../mips64-octeon2-linux-gnu/include/c++/4.3.3
 /path/to/packages/gcc/usr/bin/../lib/gcc/mips64-octeon2-linux-gnu/4.3.3/../../../../mips64-octeon2-linux-gnu/include/c++/4.3.3/mips64-octeon2-linux-gnu
 /path/to/packages/gcc/usr/bin/../lib/gcc/mips64-octeon2-linux-gnu/4.3.3/../../../../mips64-octeon2-linux-gnu/include/c++/4.3.3/backward
 /path/to/packages/gcc/usr/bin/../lib/gcc/mips64-octeon2-linux-gnu/4.3.3/include
 /path/to/packages/gcc/usr/bin/../lib/gcc/mips64-octeon2-linux-gnu/4.3.3/include-fixed
 /path/to/packages/gcc/usr/bin/../lib/gcc/mips64-octeon2-linux-gnu/4.3.3/../../../../mips64-octeon2-linux-gnu/include
 /path/to/os/sys-root/mips64-octeon2-linux-gnu/usr/include
End of search list.
GNU C++ (GCC-4.3.3_13470) version 4.3.3 (mips64-octeon2-linux-gnu)
        compiled by GNU C version 4.3.3, GMP version 4.2.3, MPFR version 2.3.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 9b255c1b0d91d5bf1dc3eb1ea2d0cfab
COLLECT_GCC_OPTIONS='-v' '-c' '-o' '/dev/null' '-shared-libgcc' '-msoft-float' 
'-mllsc' '-mplt' '-mno-shared' '-EB' '-mabi=64'
 /path/to/packages/gcc/usr/bin/../lib/gcc/mips64-octeon2-linux-gnu/4.3.3/../../../../mips64-octeon2-linux-gnu/bin/as -EB -no-mdebug -mabi=64 -mno-shared -v -call_nonpic -o /dev/null /tmp/cclfu6Wh.s
GNU assembler version 2.23.2 (mips64-octeon2-linux-gnu) using BFD version (GNU 
Binutils) 2.23.2.20130703
COMPILER_PATH=/path/to/packages/gcc/usr/bin/../libexec/gcc/mips64-octeon2-linux-
gnu/4.3.3/:/path/to/packages/gcc/usr/bin/../libexec/gcc/:/path/to/packages/gcc/u
sr/bin/../lib/gcc/mips64-octeon2-linux-gnu/4.3.3/../../../../mips64-octeon2-linu
x-gnu/bin/
LIBRARY_PATH=/path/to/packages/gcc/usr/bin/../lib/gcc/mips64-octeon2-linux-gnu/4
.3.3/:/path/to/packages/gcc/usr/bin/../lib/gcc/:/path/to/packages/gcc/usr/bin/..
/lib/gcc/mips64-octeon2-linux-gnu/4.3.3/../../../../mips64-octeon2-linux-gnu/lib
/../lib64/:/path/to/os/sys-root/mips64-octeon2-linux-gnu/lib/../lib64/:/path/to/
os/sys-root/mips64-octeon2-linux-gnu/usr/lib/../lib64/:/path/to/packages/gcc/usr
/bin/../lib/gcc/mips64-octeon2-linux-gnu/4.3.3/../../../../mips64-octeon2-linux-
gnu/lib/:/path/to/os/sys-root/mips64-octeon2-linux-gnu/lib/:/path/to/os/sys-root
/mips64-octeon2-linux-gnu/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-c' '-o' '/dev/null' '-shared-libgcc' '-msoft-float' 
'-mllsc' '-mplt' '-mno-shared' '-EB' '-mabi=64'

--------------

I checked the script 
<distcc_installation>/lib64/python2.4/site-packages/include_server/compiler_defa
ults.py
and I put some debug statements, and noticed that the exception is thrown from:
except (IOError, OSError), why: (line 220)

I could get around this exception by setting shell=True, but
that doesn't really make the preprocessing distributed.

Do you know what could be going wrong?

Original issue reported on code.google.com by VENKATAK...@gmail.com on 5 Apr 2014 at 5:37

GoogleCodeExporter commented 9 years ago
I think I found some kind of a "bug"

If we just pass "-c" to the compiler, then, somehow, preprocessing is not 
distrubuted and pump mode fails.

A small test case:(-c passed)

/path/to/workspace_venkrao/mainline_ccache_evaluation_scm_vkr/apps/distcc/bin/pu
mp 
/path/to/workspace_venkrao/mainline_ccache_evaluation_scm_vkr/apps/distcc/bin/di
stcc 
/home/venkrao/mainline_ccache_evaluation_scm_vkr/mips64-octeon2-linux-gnu-g++ 
-c foo.C -o foo.o
__________Using distcc-pump from 
/path/to/workspace_venkrao/mainline_ccache_evaluation_scm_vkr/apps/distcc/bin
__________Found 1 available distcc servers
WARNING include server: Preprocessing locally. Include server not covering: 
Could not locate name of translation unit: []. for translation unit 'unknown 
translation unit'
distcc[10123] (dcc_talk_to_include_server) Warning: include server gave up 
analyzing
distcc[10123] (dcc_build_somewhere) Warning: failed to get includes from 
include server, preprocessing locally
__________Shutting down distcc-pump include server

====

Pass: (-c not passed)

[venkrao@bhlinb20 itrBuild]$ 
/var/fpwork/workspace_venkrao/mainline_ccache_evaluation_scm_vkr/apps/distcc/bin
/pump 
/var/fpwork/workspace_venkrao/mainline_ccache_evaluation_scm_vkr/apps/distcc/bin
/distcc 
/home/venkrao/mainline_ccache_evaluation_scm_vkr/mips64-octeon2-linux-gnu-g++ 
foo.C -o foo.o
__________Using distcc-pump from 
/var/fpwork/workspace_venkrao/mainline_ccache_evaluation_scm_vkr/apps/distcc/bin
__________Found 1 available distcc servers
__________Shutting down distcc-pump include server

=====

I then tweaked the script : 
<distcc_installation>lib64/python2.4/site-packages/include_server/parse_command.
py

to include "c" 
on line 186   'c': lambda ps, arg: None,

but the results are same.

Could you take check this please?

Original comment by VENKATAK...@gmail.com on 5 Apr 2014 at 6:14

GoogleCodeExporter commented 9 years ago
Did I do something really stupid? Please check the sample test case.

Original comment by VENKATAK...@gmail.com on 9 Apr 2014 at 5:34

GoogleCodeExporter commented 9 years ago
You wrote:
error executing 
'['/home/venkrao/mainline_ccache_evaluation_scm_vkr/mips64-octeon2-linux-gnu-g++
', '-x', 'c++', '-v', '-c', '/dev/null', '-o', '/dev/null']': [Errno 8] Exec 
format error. for translation unit 'unknown translation unit'

Is that file 
/home/venkrao/mainline_ccache_evaluation_scm_vkr/mips64-octeon2-linux-gnu-g++ 
marked as executable and does it start with "#!/bin/sh "?
If not, that could be the problem.

Original comment by fer...@google.com on 9 Apr 2014 at 5:46

GoogleCodeExporter commented 9 years ago
It is an executable file and shebang contains a '#!/bin/sh"

but sorry, that was so stupid of me.

The problem was I did not have the ,cpp,lzo in the 
DISTCC_HOSTS environment variables. So, pump mode kept failing.

Original comment by VENKATAK...@gmail.com on 10 Apr 2014 at 6:45