Page 1 of 1

ps2sdk build error

Posted: Sat May 29, 2004 5:51 pm
by mrbrown
I get the following when trying to build ps2sdk from CVS:

Code: Select all

ee-gcc -D_EE -O2 -G0 -Wall   -I/home/mrbrown/cvs/ps2dev/ps2sdk/ee/kernel/include -I/home/mrbrown/cvs/ps2dev/ps2sdk/common/include -Iinclude -DF_SifCheckStatRpc src/sifrpc.c -c -o obj/SifCheckStatRpc.o
ee-gcc -D_EE -O2 -G0 -Wall   -I/home/mrbrown/cvs/ps2dev/ps2sdk/ee/kernel/include -I/home/mrbrown/cvs/ps2dev/ps2sdk/common/include -Iinclude -DF_fio_main src/fileio.c -c -o obj/fio_main.o
src/fileio.c:17:20: string.h: No such file or directory
make[2]: *** [obj/fio_main.o] Error 1
make[2]: Leaving directory `/home/mrbrown/cvs/ps2dev/ps2sdk/ee/kernel'
make[1]: *** [all-kernel] Error 2
make[1]: Leaving directory `/home/mrbrown/cvs/ps2dev/ps2sdk/ee'
make: *** [all-ee] Error 2
Let me guess, everyone who has built ps2sdk has newlib installed? I don't.

Posted: Sat May 29, 2004 6:05 pm
by ole
Uff...
Are PS2SDK sources available to public now? Where?
(I thought there are only on ufo that has restricted accesss)

Posted: Sat May 29, 2004 6:10 pm
by mrbrown
So, after adding -I$(PS2SDKSRC)/ee/libc/include to EE_INCS in $(PS2SDKSRC)/ee/Rules.make, I get the following error (with both GCC 2.9ee and 3.22):

Code: Select all

make[2]: Entering directory `/home/mrbrown/cvs/ps2dev/ps2sdk/ee/loader'
ee-gcc -nostartfiles -T/home/mrbrown/cvs/ps2dev/ps2sdk/ee/startup/src/linkfile -L/home/mrbrown/cvs/ps2dev/ps2sdk/ee/kernel/lib -L/home/mrbrown/cvs/ps2dev/ps2sdk/ee/libc/lib -L/home/mrbrown/cvs/ps2dev/ps2sdk/ee/rpc/hdd/lib -L/home/mrbrown/cvs/ps2dev/ps2sdk/ee/rpc/filexio/lib -L/home/mrbrown/cvs/ps2dev/ps2sdk/ee/rpc/poweroff/lib \
        -o bin/loader.elf /home/mrbrown/cvs/ps2dev/ps2sdk/ee/startup/obj/crt0.o obj/loader.o obj/fakehost.o obj/poweroff.o -lkernel -lpoweroff -lhdd -lfileXio -lsyscall -lc -lkernel
/home/mrbrown/cvs/ps2dev/ps2sdk/ee/libc/lib/libc.a(sbrk.o): In function `ps2_sbrk':
src/sbrk.c(.text+0x64): undefined reference to `EndOfHeap'
collect2: ld returned 1 exit status
make[2]: *** [bin/loader.elf] Error 1
make[2]: Leaving directory `/home/mrbrown/cvs/ps2dev/ps2sdk/ee/loader'
make[1]: *** [all-loader] Error 2
make[1]: Leaving directory `/home/mrbrown/cvs/ps2dev/ps2sdk/ee'
make: *** [all-ee] Error 2
Argh. libsyscall.a has always been redundant. Did anyone ever link to it before this change in ps2sdk? Please remove it and move the syscalls back into libkernel.a where they belong. Why was this changed from ps2lib anyway?

And, let me guess, everyone who has built ps2sdk up to this point has been linking with newlib, and not ps2sdk's internal libc?

Posted: Sun May 30, 2004 7:04 am
by t0mb0la
I saw the same link error for the first time yesterday, after a CVS update.

I added an extra '-lc' to the EE_LIBS in ps2sdk/ee/loader/Makefile, as the first entry and linking worked.

I am using gcc-3.2.2 in cygwin, which was compiled using ooPo's toolchain scripts, these include newlib as part of the build iirc.

I'm not sure where this linkage weirdness came from. The only update I'd gotten from CVS for ps2sdk was xprintf.c, and as I rule I always 'make clean' at the top level before 'make', esp. for library updates.

Posted: Sun May 30, 2004 7:38 am
by mrbrown
Great. Now printf() uses malloc() internally. Congrats, our libc is as crappy as newlib now.

Posted: Sun May 30, 2004 8:11 am
by sjeep
Well, why dont you fix it instead of just bitching? :)

Posted: Sun May 30, 2004 7:51 pm
by Lukasz
mrbrown wrote:Great. Now printf() uses malloc() internally. Congrats, our libc is as crappy as newlib now.
Where does it use malloc() ?

I only see it in mout(), mprintf() & vmprintf() and none of those are built into libc.a because of the #ifdef's. I just keept them there until there is some sort of agreement what to do with functions which weren't in the old xprintf.c source.