I am trying to install the gcc-4.8.2 compiler on a remote Debian 7 system, to which I do not have root privileges , but only ssh is available. I realized that the easiest way would be to compile the compiler from the source.
I follow this short installation guide from the GCC web page.
Basically, I made the simplest installation , which summarizes at the bottom of the page:
tar xzf gcc-4.8.2.tar.gz cd gcc-4.8.2 ./contrib/download_prerequisites cd .. mkdir objdir cd objdir $PWD/../gcc-4.8.2/configure --prefix=$HOME/gcc-4.8.2 --enable-languages=c++ make
with a slight exception that I did not run the ./contrib/download_prerequisites script on the remote computer due to firewall restrictions. Instead, I ran it on my local machine, and then moved the entire folder back to gcc-4.8.2.tar.gz and gcc-4.8.2.tar.gz to the remote computer. There I re-created symbolic links to the prerequisite libraries (gmp, ...) and ran make . After a few seconds, I get incredible errors :
In file included from ./tm.h:19:0, from ../../gcc-4.8.2/gcc/c/c-lang.c:24: ./options.h:4078:2: error: #error too many masks for ix86_isa_flags In file included from ../../gcc-4.8.2/gcc/tree.h:26:0, from ../../gcc-4.8.2/gcc/c/c-lang.c:25: ../../gcc-4.8.2/gcc/statistics.h:25:2: error: #error GATHER_STATISTICS must be defined In file included from ../../gcc-4.8.2/gcc/system.h:268:0, from ../../gcc-4.8.2/gcc/c/c-lang.c:22: ../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if ../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if ../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if ../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if ../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if ../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if ../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if ../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if ../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if ../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if ../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if ../../gcc-4.8.2/gcc/hwint.h:16:39: error: division by zero in #if In file included from ../../gcc-4.8.2/gcc/tree.h:29:0, from ../../gcc-4.8.2/gcc/c/c-lang.c:25: ../../gcc-4.8.2/gcc/real.h:103:9: error: #error "REAL_WIDTH > 6 not supported" In file included from ../../gcc-4.8.2/gcc/c-family/c-common.h:24:0, from ../../gcc-4.8.2/gcc/c/c-tree.h:23, from ../../gcc-4.8.2/gcc/c/c-lang.c:26: ../../gcc-4.8.2/gcc/../libcpp/include/cpplib.h:265:3: error: #error "Cannot find a least-32-bit signed integer type" In file included from ../../gcc-4.8.2/gcc/c/c-lang.c:22:0: ../../gcc-4.8.2/gcc/system.h:500:34: error: declaration of C function 'const char* strsignal(int)' conflicts with In file included from /usr/include/c++/4.7/cstring:44:0, from ../../gcc-4.8.2/gcc/system.h:205, from ../../gcc-4.8.2/gcc/c/c-lang.c:22: /usr/include/string.h:566:14: error: previous declaration 'char* strsignal(int)' here In file included from ../../gcc-4.8.2/gcc/system.h:645:0, from ../../gcc-4.8.2/gcc/c/c-lang.c:22: ../../gcc-4.8.2/gcc/../include/libiberty.h:110:36: error: new declaration 'char* basename(const char*)' In file included from /usr/include/c++/4.7/cstring:44:0, from ../../gcc-4.8.2/gcc/system.h:205, from ../../gcc-4.8.2/gcc/c/c-lang.c:22: /usr/include/string.h:603:28: error: ambiguates old declaration 'const char* basename(const char*)' In file included from ../../gcc-4.8.2/gcc/tree.h:27:0, from ../../gcc-4.8.2/gcc/c/c-lang.c:25: ../../gcc-4.8.2/gcc/vec.h: In static member function 'static void va_heap::reserve(vec<T, va_heap, vl_embed>*&, unsigned int, bool)': ../../gcc-4.8.2/gcc/vec.h:295:7: error: 'GATHER_STATISTICS' was not declared in this scope ../../gcc-4.8.2/gcc/vec.h:303:7: error: 'GATHER_STATISTICS' was not declared in this scope ../../gcc-4.8.2/gcc/vec.h: In static member function 'static void va_heap::release(vec<T, va_heap, vl_embed>*&)': ../../gcc-4.8.2/gcc/vec.h:317:7: error: 'GATHER_STATISTICS' was not declared in this scope In file included from ../../gcc-4.8.2/gcc/tree.h:29:0, from ../../gcc-4.8.2/gcc/c/c-lang.c:25: ../../gcc-4.8.2/gcc/real.h: At global scope: ../../gcc-4.8.2/gcc/real.h:51:21: error: 'SIZEOF_LONG' was not declared in this scope ../../gcc-4.8.2/gcc/real.h:51:21: error: 'SIZEOF_LONG' was not declared in this scope ../../gcc-4.8.2/gcc/real.h:76:31: error: 'SIZEOF_LONG' was not declared in this scope ../../gcc-4.8.2/gcc/real.h:76:31: error: 'SIZEOF_LONG' was not declared in this scope ../../gcc-4.8.2/gcc/real.h:76:31: error: 'SIZEOF_LONG' was not declared in this scope ../../gcc-4.8.2/gcc/real.h:76:31: error: 'SIZEOF_LONG' was not declared in this scope In file included from ../../gcc-4.8.2/gcc/c-family/c-common.h:24:0, from ../../gcc-4.8.2/gcc/c/c-tree.h:23, from ../../gcc-4.8.2/gcc/c/c-lang.c:26: ../../gcc-4.8.2/gcc/../libcpp/include/cpplib.h:267:35: error: expected initializer before 'cppchar_t' ../../gcc-4.8.2/gcc/../libcpp/include/cpplib.h:268:9: error: 'CPPCHAR_SIGNED_T' does not name a type ../../gcc-4.8.2/gcc/../libcpp/include/cpplib.h:777:8: error: 'cppchar_t' does not name a type ../../gcc-4.8.2/gcc/../libcpp/include/cpplib.h:788:8: error: 'cppchar_t' does not name a type ../../gcc-4.8.2/gcc/../libcpp/include/cpplib.h:966:8: error: 'cppchar_t' does not name a type make[3]: *** [c/c-lang.o] Error 1 make[3]: Leaving directory `/home/mdrozdik/gccbuild/gcc' make[2]: *** [all-stage1-gcc] Error 2 make[2]: Leaving directory `/home/mdrozdik/gccbuild' make[1]: *** [stage1-bubble] Error 2 make[1]: Leaving directory `/home/mdrozdik/gccbuild' make: *** [all] Error 2
I am compiling with gcc 4.7.2-5 on Debian .
There is Ubuntu 13.10 on the local computer with gcc 4.7.3 , and the build seems to be fine so far (still working).
Please, what could be the cause of these errors?
EDIT:
I checked the file /home/mdrozdik/gccbuild/libcpp/config.log . This is very long, but in two places there are such errors:
configure:3086: gcc -V >&5 gcc: error: unrecognized command line option '-V' gcc: fatal error: no input files compilation terminated. configure:3097: $? = 4 configure:3086: gcc -qversion >&5 gcc: error: unrecognized command line option '-qversion' gcc: fatal error: no input files compilation terminated. configure:3097: $? = 4
However, the journal continues for several pages.