pb compiling gcc-2.95.2 [solved]

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
WillyCat
Posts: 2
Joined: Sat Oct 03, 2009 2:19 am

pb compiling gcc-2.95.2 [solved]

Post by WillyCat »

Hi,

I try to compile gcc to do cross compilation for ps2 but i meet a problem. I works on an AMD64 Debian lenny. To be able to compile the binutils and gcc, i did the following:

-create a new partition on which i installed debian woody i386 dist with debootstrap.

-use the chroot command to log into this new partition.

-replace the uname command by a script which return i386 as the architecture.

-install the includes and libs from glibc and glibc-dev rpm packages in /usr/cross/mipsEEel-linux/include and /usr/cross/mipsEEel-linux/lib directories.

-correct the broken links of libraries.

-install the kernel headers in /usr/cross/mipsEEel-linux/src/linux-2.2.1/include/

-create the link /usr/cross/mipsEEel-linux/include/asm to ../src/linux-2.2.1/include/asm-mips

-create the link /usr/cross/mipsEEel-linux/include/linux to ../src/linux-2.2.1/include/linux

-install the binutils in /root/ps2/binutils-2.9/src and create /root/ps2/binutils-2.9/build

-install the gcc in /root/ps2/gcc-2.95.2/src and create /root/ps2/gcc-2.95.2/build

-Apply the patches as in this tutorial http://playstation2-linux.com/download/ ... _cross.htm.

to compile the binutils:

=> cd /root/ps2/binutils-2.9/build
=> ../src/configure --target=mipsEEel-linux --prefix=/usr/cross --exec-prefix=/usr/cross
=> make
=> make install

No problem.

To compile GCC:

=> cd /root/ps2/gcc-2.95.2/build
=> ../src/configure target=mipsEEel-linux --prefix=/usr/cross --exec-prefix=/usr/cross
=> make

The compilation process stop:

make[1]: Entering directory `/root/ps2/gcc-2.95.2/build/mipsEEel-linux/libiberty'
test x"no" != xyes || \
/root/ps2/gcc-2.95.2/build/gcc/xgcc -B/root/ps2/gcc-2.95.2/build/gcc/ -B/usr/cross/mipsEEel-linux/bin/ -c -DHAVE_CONFIG_H -g -O2 -I. -I../../../src/libiberty/../include ../../../src/libiberty/choose-temp.c -o pic/choose-temp.o
/root/ps2/gcc-2.95.2/build/gcc/xgcc -B/root/ps2/gcc-2.95.2/build/gcc/ -B/usr/cross/mipsEEel-linux/bin/ -c -DHAVE_CONFIG_H -g -O2 -I. -I../../../src/libiberty/../include ../../../src/libiberty/choose-temp.c
../../../src/libiberty/choose-temp.c:29: stdio.h: Aucun fichier ou répertoire de ce type
../../../src/libiberty/choose-temp.c:30: sys/types.h: Aucun fichier ou répertoire de ce type
../../../src/libiberty/choose-temp.c:32: unistd.h: Aucun fichier ou répertoire de ce type
../../../src/libiberty/choose-temp.c:35: stdlib.h: Aucun fichier ou répertoire de ce type
../../../src/libiberty/choose-temp.c:38: sys/file.h: Aucun fichier ou répertoire de ce type
make[1]: *** [choose-temp.o] Erreur 1
make[1]: Leaving directory `/root/ps2/gcc-2.95.2/build/mipsEEel-linux/libiberty'
make: *** [all-target-libiberty] Erreur 2

As you can see, the compilation of the libiberty library for mips has problem. So , i add the include path to my includes in the makefile line 109 in mipsEEel-linux/libiberty:
COMPILE.c = $(CC) -c -DHAVE_CONFIG_H $(LIBCFLAGS) -I. -I/usr/cross/mipsEEel-linux/include -I$(INCDIR) $(HDEFINES)

so i do make again: the compilation continues but an other error appear:

make[1]: Entering directory `/root/ps2/gcc-2.95.2/build/mipsEEel-linux/libiberty'
test x"no" != xyes || \
/root/ps2/gcc-2.95.2/build/gcc/xgcc -B/root/ps2/gcc-2.95.2/build/gcc/ -B/usr/cross/mipsEEel-linux/bin/ -c -DHAVE_CONFIG_H -g -O2 -I. -I/usr/cross/mipsEEel-linux/include -I../../../src/libiberty/../include ../../../src/libiberty/strsignal.c -o pic/strsignal.o
/root/ps2/gcc-2.95.2/build/gcc/xgcc -B/root/ps2/gcc-2.95.2/build/gcc/ -B/usr/cross/mipsEEel-linux/bin/ -c -DHAVE_CONFIG_H -g -O2 -I. -I/usr/cross/mipsEEel-linux/include -I../../../src/libiberty/../include ../../../src/libiberty/strsignal.c
../../../src/libiberty/strsignal.c: In function `psignal':
../../../src/libiberty/strsignal.c:589: argument `signo' doesn't match prototype
/usr/cross/mipsEEel-linux/include/signal.h:131: prototype declaration
../../../src/libiberty/strsignal.c:589: argument `message' doesn't match prototype
/usr/cross/mipsEEel-linux/include/signal.h:131: prototype declaration
make[1]: *** [strsignal.o] Erreur 1
make[1]: Leaving directory `/root/ps2/gcc-2.95.2/build/mipsEEel-linux/libiberty'
make: *** [all-target-libiberty] Erreur 2

i don't know what to do.

if someone could help me...

thanks, Willy
Last edited by WillyCat on Mon Oct 05, 2009 2:25 am, edited 1 time in total.
WillyCat
Posts: 2
Joined: Sat Oct 03, 2009 2:19 am

pb compiling gcc-2.95.2 [solved]

Post by WillyCat »

Hi,

I solved the problem. I made the link /usr/cross/mipsEEel-linux/sys-include pointing to /usr/cross/mipsEEel-linux/include.

I compiled the binutils and gcc successfully.

Willy.
Post Reply