Building gcc-4.8.3 on ppc64

Jeff Preshing jeff@preshing.com
Sat Jun 7 14:52:00 GMT 2014


Hi,

I've installed Debian Linux 7.5 (wheezy) on a Power Mac G5, which uses a PowerPC64 kernel.

I installed gcc and g++ using aptitude, which gives me gcc 4.6.3. Next, I would like to get a working g++ 4.8.3 compiler, to use some C++11 features.

So I downloaded and extracted the sources from gcc-4.8.3.tar.bz2, and am trying to follow the directions at: https://gcc.gnu.org/install/index.html

In trying to get it working, I've also installed these packages using aptitude:

make
linux-headers-3.2.0.4-all
gcc-multilib

Now I'm at the point where I've configured gcc using:

$ ../gcc-4.8.3/configure --disable-multilib --enable-languages=c,c++

But when I run make, I get the following errors:

make[3]: Entering directory `/home/jeff/Documents/gcc-4.8.3/build/gcc'
/home/jeff/Documents/gcc-4.8.3/build/./prev-gcc/xg++ -B/home/jeff/Documents/gcc-4.8.3/build/./prev-gcc/ -B/usr/local/powerpc64-unknown-linux-gnu/bin/ -nostdinc++ -B/home/jeff/Documents/gcc-4.8.3/build/prev-powerpc64-unknown-linux-gnu/libstdc++-v3/src/.libs -B/home/jeff/Documents/gcc-4.8.3/build/prev-powerpc64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -I/home/jeff/Documents/gcc-4.8.3/build/prev-powerpc64-unknown-linux-gnu/libstdc++-v3/include/powerpc64-unknown-linux-gnu -I/home/jeff/Documents/gcc-4.8.3/build/prev-powerpc64-unknown-linux-gnu/libstdc++-v3/include -I/home/jeff/Documents/gcc-4.8.3/gcc-4.8.3/libstdc++-v3/libsupc++ -L/home/jeff/Documents/gcc-4.8.3/build/prev-powerpc64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/home/jeff/Documents/gcc-4.8.3/build/prev-powerpc64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -c   -g -O2 -gtoggle -DIN_GCC   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../gcc-4.8.3/gcc -I../../gcc-4.8.3/gcc/build -I../../gcc-4.8.3/gcc/../include  -I../../gcc-4.8.3/gcc/../libcpp/include  \
		-o build/genconstants.o ../../gcc-4.8.3/gcc/genconstants.c
In file included from ./bconfig.h:3:0,
                 from ../../gcc-4.8.3/gcc/genconstants.c:27:
./auto-host.h:2000:16: error: declaration does not declare anything [-fpermissive]
 #define rlim_t long
                ^
In file included from ../../gcc-4.8.3/gcc/genconstants.c:28:0:
../../gcc-4.8.3/gcc/system.h:444:23: error: declaration of C function ‘void* sbrk(int)’ conflicts with
 extern void *sbrk (int);
                       ^
In file included from ../../gcc-4.8.3/gcc/system.h:254:0,
                 from ../../gcc-4.8.3/gcc/genconstants.c:28:
/usr/include/unistd.h:1056:14: error: previous declaration ‘void* sbrk(intptr_t)’ here
 extern void *sbrk (intptr_t __delta) __THROW;
              ^
In file included from ../../gcc-4.8.3/gcc/genconstants.c:28:0:
../../gcc-4.8.3/gcc/system.h:448:48: error: new declaration ‘char* strstr(const char*, const char*)’
 extern char *strstr (const char *, const char *);
                                                ^
In file included from /home/jeff/Documents/gcc-4.8.3/build/prev-powerpc64-unknown-linux-gnu/libstdc++-v3/include/cstring:42:0,
                 from ../../gcc-4.8.3/gcc/system.h:205,
                 from ../../gcc-4.8.3/gcc/genconstants.c:28:
/usr/include/string.h:335:1: error: ambiguates old declaration ‘const char* strstr(const char*, const char*)’
 strstr (__const char *__haystack, __const char *__needle) __THROW
 ^
In file included from ../../gcc-4.8.3/gcc/genconstants.c:28:0:
../../gcc-4.8.3/gcc/system.h:500:34: error: declaration of C function ‘const char* strsignal(int)’ conflicts with
 extern const char *strsignal (int);
                                  ^
In file included from /home/jeff/Documents/gcc-4.8.3/build/prev-powerpc64-unknown-linux-gnu/libstdc++-v3/include/cstring:42:0,
                 from ../../gcc-4.8.3/gcc/system.h:205,
                 from ../../gcc-4.8.3/gcc/genconstants.c:28:
/usr/include/string.h:566:14: error: previous declaration ‘char* strsignal(int)’ here
 extern char *strsignal (int __sig) __THROW;
              ^
In file included from ../../gcc-4.8.3/gcc/system.h:645:0,
                 from ../../gcc-4.8.3/gcc/genconstants.c:28:
../../gcc-4.8.3/gcc/../include/libiberty.h:110:36: error: new declaration ‘char* basename(const char*)’
 extern char *basename (const char *);
                                    ^
In file included from /home/jeff/Documents/gcc-4.8.3/build/prev-powerpc64-unknown-linux-gnu/libstdc++-v3/include/cstring:42:0,
                 from ../../gcc-4.8.3/gcc/system.h:205,
                 from ../../gcc-4.8.3/gcc/genconstants.c:28:
/usr/include/string.h:603:28: error: ambiguates old declaration ‘const char* basename(const char*)’
 extern "C++" __const char *basename (__const char *__filename)
                            ^
make[3]: *** [build/genconstants.o] Error 1
make[3]: Leaving directory `/home/jeff/Documents/gcc-4.8.3/build/gcc'
make[2]: *** [all-stage2-gcc] Error 2
make[2]: Leaving directory `/home/jeff/Documents/gcc-4.8.3/build'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/home/jeff/Documents/gcc-4.8.3/build'
make: *** [all] Error 2

I understand that gcc tries to perform a three-stage bootstrap. In my case, it's failing in stage2. I also see that there are conflicting declarations between my system headers in /usr/include and the headers in the gcc source package itself. But I don't know how to resolve them, or whether the compiler should be grabbing headers from both places in the first place.

Does anyone have some tips on how to investigate further?

Much appreciated, thanks!
Jeff



More information about the Gcc-help mailing list