forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

linking issue with PS2SDK

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
Shazz



Joined: 31 Aug 2004
Posts: 244
Location: Somewhere over the rainbow

PostPosted: Tue Feb 15, 2005 4:36 am    Post subject: linking issue with PS2SDK Reply with quote

Before going into details (if needed), is it a wellknown issue ?

Code:
./uae-cpu/cpuemu5.o(.text+0x19020): In function `cctrue':
cpuemu.c: undefined reference to `_impure_ptr'
./uae-cpu/cpuemu5.o(.text+0x19024):cpuemu.c: undefined reference to `_impure_ptr'
./uae-cpu/cpuemu6.o(.text+0x28254): In function `cctrue':
cpuemu.c: undefined reference to `_impure_ptr'
./uae-cpu/cpuemu6.o(.text+0x28258):cpuemu.c: undefined reference to `_impure_ptr'
D:\cygwin\usr\local\ps2dev\ps2sdk/ee/lib/libc.a(fflush.o)(.text+0x5c): In function `fflush':
src/stdio.c: undefined reference to `mcFlush'
D:\cygwin\usr\local\ps2dev\ps2sdk/ee/lib/libc.a(fflush.o)(.text+0x6c):src/stdio.c: undefined reference to `mcSync'
D:\cygwin\usr\local\ps2dev\ps2sdk/ee/lib/libc.a(sscanf.o)(.text+0x30): In function `sscanf':
src/stdio.c: undefined reference to `vsscanf'


Especially the 3 refs to fflush, mcFlush, vsscanf, mcSync...

I'm using the toolchain updated with the shell script from 2 days ago and PS2SDK makefiles from Makefile.eeglobal_sample,v 1.6 2005/02/01 23:31:01 oobles Exp $
I tried changing the EE_LIBS += -lc -lsyscall -lkernel but nothing changes...

The '_impure_ptr' pb is more tricky for me as I really don't know what is it... I've got it when recompiling the 68K UAE core...


Thx...
_________________
- TiTAN Art Division -
http://www.titandemo.org
Back to top
View user's profile Send private message Visit poster's website
pixel



Joined: 30 Jan 2004
Posts: 791

PostPosted: Tue Feb 15, 2005 11:29 am    Post subject: Reply with quote

_impure_ptr ==> this is from newlib. Please check back your -I options so that the includes falls into the ps2sdk's common/include and ee/include. And also, please check that you are not including a header that is defined into the newlib and not in the ps2sdk

mcFlush ==> add -lmc to link phase. it's needed by fflush.

vsscanf ==> we don't have any *scanf function familly in the sdk, sorry. If you deadly need it, just try to simplify/change your code so that it uses custom scanners, maybe using atoi for example. However, you're trying to compile uae (the Amiga emulator, right?). Just check if sscanf is really useful in the case you're having. In that latter case, I can provide a short sscanf replacement depending on the format used in your software. Otherwise, just add this .c code to the link phase:
Code:
int vsscanf(void){return 0;}
Just bug me on IRC about it or PM me or whatever.
_________________
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
Back to top
View user's profile Send private message
Shazz



Joined: 31 Aug 2004
Posts: 244
Location: Somewhere over the rainbow

PostPosted: Tue Feb 15, 2005 6:35 pm    Post subject: Reply with quote

Thx pixels !

As I don't have newlib and using a fresh ps2sdk toolchain install I don't know where it can come from... I search I search...

mcFlush fixed, thx

for the *scanf call, here is the unique need in the FPP UAE core :

Code:
STATIC_INLINE fptype to_pack (uae_u32 wrd1, uae_u32 wrd2, uae_u32 wrd3)
{
    fptype d;
    char *cp;
    char str[100];

    cp = str;
    if (wrd1 & 0x80000000)
   *cp++ = '-';
    *cp++ = (wrd1 & 0xf) + '0';
    *cp++ = '.';
    *cp++ = ((wrd2 >> 28) & 0xf) + '0';
    *cp++ = ((wrd2 >> 24) & 0xf) + '0';
    *cp++ = ((wrd2 >> 20) & 0xf) + '0';
    *cp++ = ((wrd2 >> 16) & 0xf) + '0';
    *cp++ = ((wrd2 >> 12) & 0xf) + '0';
    *cp++ = ((wrd2 >> 8) & 0xf) + '0';
    *cp++ = ((wrd2 >> 4) & 0xf) + '0';
    *cp++ = ((wrd2 >> 0) & 0xf) + '0';
    *cp++ = ((wrd3 >> 28) & 0xf) + '0';
    *cp++ = ((wrd3 >> 24) & 0xf) + '0';
    *cp++ = ((wrd3 >> 20) & 0xf) + '0';
    *cp++ = ((wrd3 >> 16) & 0xf) + '0';
    *cp++ = ((wrd3 >> 12) & 0xf) + '0';
    *cp++ = ((wrd3 >> 8) & 0xf) + '0';
    *cp++ = ((wrd3 >> 4) & 0xf) + '0';
    *cp++ = ((wrd3 >> 0) & 0xf) + '0';
    *cp++ = 'E';
    if (wrd1 & 0x40000000)
   *cp++ = '-';
    *cp++ = ((wrd1 >> 24) & 0xf) + '0';
    *cp++ = ((wrd1 >> 20) & 0xf) + '0';
    *cp++ = ((wrd1 >> 16) & 0xf) + '0';
    *cp = 0;
    sscanf (str, "%le", &d);
    return d;
}


Do you have an idea of what to use available to replace it ?

Thanks a lot for your help, those things are really tricky for me :D (and Evilo too eh eh)
_________________
- TiTAN Art Division -
http://www.titandemo.org
Back to top
View user's profile Send private message Visit poster's website
pixel



Joined: 30 Jan 2004
Posts: 791

PostPosted: Tue Feb 15, 2005 8:19 pm    Post subject: Reply with quote

Code:
sscanf(str, "%le", &d)
would be equivalent to
Code:
d = strtod(str, 0)
The _impure_ptr really comes from a .h files not in the ps2sdk's libc. So, in order to find what's wrong, I'd recommand using the -v flag when compiling with gcc. It'll display all the files it opens and read, alongside with large pieces of information. Reading this output might give you a hint about which .h file is included from not within ps2sdk. Of course, please report any result of that.
_________________
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
Back to top
View user's profile Send private message
Shazz



Joined: 31 Aug 2004
Posts: 244
Location: Somewhere over the rainbow

PostPosted: Tue Feb 15, 2005 11:42 pm    Post subject: Reply with quote

Ok I get rid of some other sscanf fns used to parsing config files... not an issue for the moment, I'll see later...

here is the log using the v flag :

Code:

ee-gcc -v -DPART_5 -c  -I.  -Wno-unused cpuemu.c -o cpuemu5.o
Reading specs from /usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.2/specs
Configured with: ../configure --prefix=/usr/local/ps2dev/ee --target=ee --enable-languages=c,c++ --with-newlib --with-headers=/usr/local/ps2dev/ee/ee/include --enable-cxx-flags=-G0
Thread model: single
gcc version 3.2.2
 /usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.2/cc1.exe -lang-c -v -I. -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=2 -D__GXX_ABI_VERSION=102 -D__ELF__ -Dmips -D_mips -D__mips -D__mips__ -DR5900 -D_R5900 -D__R5900 -DR3000 -D_3000 -D__3000 -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__ -D__ELF__ -D__mips__ -D__mips__ -D__mips -D__mips__ -D__R5900__ -D_R5900 -D__R5900 -D__R3000__ -D__3000__ -D__3000 -D__MIPSEL__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ -D__mips -D__mips -D__R5900 -D__R3000 -D__3000 -D__MIPSEL -Acpu(mips) -Amachine(mips) -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D__LANGUAGE_C -D_LANGUAGE_C -DLANGUAGE_C -D_MIPS_SZPTR=32 -D_MIPS_SZINT=32 -D__SIZE_TYPE__=unsigned int -D__SSIZE_TYPE__=int -D__PTRDIFF_TYPE__=int -D_MIPS_SZLONG=64 -D__mips_fpr=64 -D_MIPS_FPSET=32 -U__mips -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS3 -D__mips=3 -D__mips64 -D__mips_eabi -D__mips_single_float -D__LANGUAGE_C__ -DLANGUAGE_C -DPART_5 cpuemu.c -quiet -dumpbase cpuemu.c -Wno-unused -version -o /cygdrive/d/temp/ccPkHmTQ.s
GNU CPP version 3.2.2 (cpplib) [AL 1.1, MM 40] (MIPSel R5900 ELF)
GNU C version 3.2.2 (ee)
   compiled by GNU C version 3.3.3 (cygwin special).
#include "..." search starts here:
#include <...> search starts here:
 .
 /usr/local/ps2dev/ee/include
 /usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.2/include
 /usr/local/ps2dev/ee/ee/sys-include
 /usr/local/ps2dev/ee/ee/include
End of search list.
 /usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.2/../../../../ee/bin/as.exe -v -mwarn-short-loop -march=r5900 -mips3 -mfp32 -mgp64 -mabi=eabi -msingle-float -o cpuemu5.o /cygdrive/d/temp/ccPkHmTQ.s
GNU assembler version 2.14 (ee) using BFD version 2.14 20030612
ee-gcc -v -DPART_6 -c  -I.  -Wno-unused cpuemu.c -o cpuemu6.o
Reading specs from /usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.2/specs
Configured with: ../configure --prefix=/usr/local/ps2dev/ee --target=ee --enable-languages=c,c++ --with-newlib --with-headers=/usr/local/ps2dev/ee/ee/include --enable-cxx-flags=-G0
Thread model: single
gcc version 3.2.2
 /usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.2/cc1.exe -lang-c -v -I. -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=2 -D__GXX_ABI_VERSION=102 -D__ELF__ -Dmips -D_mips -D__mips -D__mips__ -DR5900 -D_R5900 -D__R5900 -DR3000 -D_3000 -D__3000 -DMIPSEL -D_MIPSEL -D__MIPSEL -D__MIPSEL__ -D__ELF__ -D__mips__ -D__mips__ -D__mips -D__mips__ -D__R5900__ -D_R5900 -D__R5900 -D__R3000__ -D__3000__ -D__3000 -D__MIPSEL__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ -D__mips -D__mips -D__R5900 -D__R3000 -D__3000 -D__MIPSEL -Acpu(mips) -Amachine(mips) -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D__LANGUAGE_C -D_LANGUAGE_C -DLANGUAGE_C -D_MIPS_SZPTR=32 -D_MIPS_SZINT=32 -D__SIZE_TYPE__=unsigned int -D__SSIZE_TYPE__=int -D__PTRDIFF_TYPE__=int -D_MIPS_SZLONG=64 -D__mips_fpr=64 -D_MIPS_FPSET=32 -U__mips -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS3 -D__mips=3 -D__mips64 -D__mips_eabi -D__mips_single_float -D__LANGUAGE_C__ -DLANGUAGE_C -DPART_6 cpuemu.c -quiet -dumpbase cpuemu.c -Wno-unused -version -o /cygdrive/d/temp/ccTNesVC.s
GNU CPP version 3.2.2 (cpplib) [AL 1.1, MM 40] (MIPSel R5900 ELF)
GNU C version 3.2.2 (ee)
   compiled by GNU C version 3.3.3 (cygwin special).
#include "..." search starts here:
#include <...> search starts here:
 .
 /usr/local/ps2dev/ee/include
 /usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.2/include
 /usr/local/ps2dev/ee/ee/sys-include
 /usr/local/ps2dev/ee/ee/include
End of search list.
 /usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.2/../../../../ee/bin/as.exe -v -mwarn-short-loop -march=r5900 -mips3 -mfp32 -mgp64 -mabi=eabi -msingle-float -o cpuemu6.o /cygdrive/d/temp/ccTNesVC.s
GNU assembler version 2.14 (ee) using BFD version 2.14 20030612
ee-gcc -DPART_7 -c  -I.  -Wno-unused cpuemu.c -o cpuemu7.o
ee-gcc -DPART_8 -c  -I.  -Wno-unused cpuemu.c -o cpuemu8.o
make[2]: Leaving directory `/cygdrive/d/Dev/DevC/projects/PS2/hatari/src/uae-cpu'
make -C uae-cpu/ all
make[2]: Entering directory `/cygdrive/d/Dev/DevC/projects/PS2/hatari/src/uae-cpu'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/cygdrive/d/Dev/DevC/projects/PS2/hatari/src/uae-cpu'
make -C uae-cpu/ cpuemu.c
make[2]: Entering directory `/cygdrive/d/Dev/DevC/projects/PS2/hatari/src/uae-cpu'
make[2]: `cpuemu.c' is up to date.
make[2]: Leaving directory `/cygdrive/d/Dev/DevC/projects/PS2/hatari/src/uae-cpu'
ee-gcc -mno-crt0 -TD:\cygwin\usr\local\ps2dev\ps2sdk/ee/startup/linkfile -LD:\cygwin\usr\local\ps2dev\ps2sdk/ee/lib  \
   -o hatari.elf D:\cygwin\usr\local\ps2dev\ps2sdk/ee/startup/crt0.o audio.o bios.o blitter.o cart.o cfgopts.o configuration.o createBlankImage.o debug.o debugui.o dialog.o errlog.o fdc.o file.o floppy.o gemdos.o hdc.o ikbd.o int.o intercept.o joy.o keymap.o m68000.o main.o midi.o memAlloc.o memorySnapShot.o mfp.o misc.o msa.o psg.o printer.o reset.o rtc.o st.o stMemory.o screen.o screenConvert.o screenSnapShot.o shortcut.o sound.o spec512.o tos.o vdi.o video.o wavFormat.o xbios.o ymFormat.o ./gui-sdl/dlgAbout.o ./gui-sdl/dlgAlert.o ./gui-sdl/dlgDevice.o ./gui-sdl/dlgDisc.o ./gui-sdl/dlgJoystick.o ./gui-sdl/dlgKeyboard.o ./gui-sdl/dlgMain.o ./gui-sdl/dlgMemory.o ./gui-sdl/dlgNewDisc.o ./gui-sdl/dlgRom.o ./gui-sdl/dlgScreen.o ./gui-sdl/dlgSound.o ./gui-sdl/dlgSystem.o ./gui-sdl/dlgFileSelect.o ./gui-sdl/sdlgui.o ./uae-cpu/hatari-glue.o ./uae-cpu/memory.o ./uae-cpu/newcpu.o ./uae-cpu/readcpu.o ./uae-cpu/fpp.o ./uae-cpu/cpustbl.o ./uae-cpu/cpudefs.o ./uae-cpu/cpuemu1.o ./uae-cpu/cpuemu2.o ./uae-cpu/cpuemu3.o ./uae-cpu/cpuemu4.o ./uae-cpu/cpuemu5.o ./uae-cpu/cpuemu6.o ./uae-cpu/cpuemu7.o ./uae-cpu/cpuemu8.o -lc -LD:\Dev\DevC\projects\PS2\SDL/lib -LD:\cygwin\usr\local\ps2dev\lib\gskit/lib -lsdl -lgskit -ldmakit -lpad -lkbd -lm -lmc -lc -lkernel -lc -lsyscall
./uae-cpu/cpuemu5.o(.text+0x19020): In function `cctrue':
cpuemu.c: undefined reference to `_impure_ptr'
./uae-cpu/cpuemu5.o(.text+0x19024):cpuemu.c: undefined reference to `_impure_ptr'
./uae-cpu/cpuemu6.o(.text+0x28254): In function `cctrue':
cpuemu.c: undefined reference to `_impure_ptr'
./uae-cpu/cpuemu6.o(.text+0x28258):cpuemu.c: undefined reference to `_impure_ptr'
collect2: ld returned 1 exit status


Have fun.... ;-)
_________________
- TiTAN Art Division -
http://www.titandemo.org
Back to top
View user's profile Send private message Visit poster's website
pixel



Joined: 30 Jan 2004
Posts: 791

PostPosted: Wed Feb 16, 2005 12:03 am    Post subject: Reply with quote

Just as I said a few posts before, you are not having -I $PS2SDK/ee/include -I $PS2SDK/common/include in your compilation lines.
_________________
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
Back to top
View user's profile Send private message
Shazz



Joined: 31 Aug 2004
Posts: 244
Location: Somewhere over the rainbow

PostPosted: Wed Feb 16, 2005 2:58 am    Post subject: Reply with quote

Thanks Pixel, yep some UAE files were compiled a little... brutly..

So now it compiles & links...

And it crashes before entering the main... :)
Let's have some fun...
_________________
- TiTAN Art Division -
http://www.titandemo.org
Back to top
View user's profile Send private message Visit poster's website
ole



Joined: 08 May 2004
Posts: 92
Location: Czech Republic

PostPosted: Wed Feb 16, 2005 5:11 am    Post subject: Reply with quote

can't wait to see UAE working on the ps2.... :) What about the Atari ST emu you mentioned earlier? Any progress?
Back to top
View user's profile Send private message
Shazz



Joined: 31 Aug 2004
Posts: 244
Location: Somewhere over the rainbow

PostPosted: Wed Feb 16, 2005 5:43 am    Post subject: Reply with quote

Arf Ole... bad news for you...

Remember I'm a true olsk00l Atarist... So somebody will have to threat me to have UAE ported to the PS2 :D

In fact with 7not6 we have a working version of Castaway but make it evolve is a real pain due to nasty code...
In the same time, Hatari exists, still supported, nice code, better emulation and... .SDL based...

So I have decided to give my efforts to Hatari which is for me a better choice...

So what about UAE ????
Hatari uses the UAE 68K core engine :D (shame on me)

But who knows maybe UAE could be next on the list :D (ask evilo the old amiga freak :D)
_________________
- TiTAN Art Division -
http://www.titandemo.org
Back to top
View user's profile Send private message Visit poster's website
EugeneE3RD



Joined: 03 Apr 2004
Posts: 51

PostPosted: Thu Feb 17, 2005 9:10 am    Post subject: Reply with quote

ole wrote:
can't wait to see UAE working on the ps2.... :) What about the Atari ST emu you mentioned earlier? Any progress?


So would I. UAE on PS2 would be great since the Amiga has so many freeware programs & in fact, a good amount of commerical companies are allowing downloads of their old Amiga progs.
_________________
You no mess with Lo Wang- Lo Wang (Shadow Warrior).
Back to top
View user's profile Send private message Send e-mail
EugeneE3RD



Joined: 03 Apr 2004
Posts: 51

PostPosted: Fri Feb 18, 2005 8:56 am    Post subject: Reply with quote

I like to mention a warning about UAE. If you do release UAE for PS2, it must not contain the Amiga Kickstart roms since Amiga INC doesn't allow the Kickstart roms to be downloaded from the NET/ & the Kickstart roms can't be included/packaged with the Amiga Emu.

People who want to use an Amiga Emu have to purchase Amiga Forever which contains the Kickstart roms & Amiga Forever is licensed by Amiga INC.
_________________
You no mess with Lo Wang- Lo Wang (Shadow Warrior).
Back to top
View user's profile Send private message Send e-mail
OptiRoc



Joined: 02 Feb 2004
Posts: 22
Location: Sweden

PostPosted: Fri Feb 18, 2005 11:55 am    Post subject: Reply with quote

UAE requires a fairly hi spec PC to run decently. It would be interesting to see how it performs on PS2. At least you have all the videomodes (and a proper TV hook-up) needed to achieve perfect image quality.
Back to top
View user's profile Send private message
ole



Joined: 08 May 2004
Posts: 92
Location: Czech Republic

PostPosted: Sat Feb 19, 2005 6:37 pm    Post subject: Reply with quote

Agree. Not only the proccessor speed is required but the memory amount is critical. I have compiled (just curious wether it's gonna work :-) uae under ps2dev environment (only 68000 core, dummy sound and graphics routines) and the elf launched with TLB Store exception: BadVaddr 02000000 - that is IMHO not enough memory (it didn't even start in main() when it terminated)....
Edit:
finally it works, so if anyone woud like to test it here is the preliminary version.
http://www.volny.cz./molej/ps2/uae.htm
Back to top
View user's profile Send private message
Shazz



Joined: 31 Aug 2004
Posts: 244
Location: Somewhere over the rainbow

PostPosted: Tue Feb 22, 2005 7:05 pm    Post subject: Reply with quote

Eh eh ole you're faster than me :D

My Hatari port based on UAE core is not working yey and it is "just" a SDL portage...

You're incredible :D
_________________
- TiTAN Art Division -
http://www.titandemo.org
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group