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 

problems with latest toolchain / psplibraries builds
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
MagerValp



Joined: 20 Jul 2007
Posts: 10

PostPosted: Tue Jun 03, 2008 5:58 pm    Post subject: Reply with quote

Insert_witty_name wrote:
I have no idea what actually broke, but it was broken by the changes introduced in revision 2392.

I didn't fix it as such, but reverted the toolchain.sh and binutils patch back to what they were in revision 2391.

Just for clarification Oopo, all I have to do to get the toolchain to compile on OSX is to change the last line of 001-binutils-2.16.1.sh from:

Code:
 make clean && make -j 2 && make install && make clean || { exit 1; }


to

Code:
 make clean && make -r -j 2 && make install && make clean || { exit 1; }


Maybe an update with a check using uname = Darwin?


The toolchain doesn't build on OSX for me with those changes. I still get .dSYM stuff when compiling binutils, but -r takes care of the .m files. Setting CFLAGS in the binutils script fixes it.

psplink doesn't compile:
Code:
make -C pspsh all
g++ -Wall -g -D_PCTERM -I../psplink   -c -o pspsh.o pspsh.C
pspsh.C: In function 'int strlen_cmd(int, char**)':
pspsh.C:439: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'
g++ -Wall -g -D_PCTERM -I../psplink   -c -o parse_args.o parse_args.C
g++ -Wall -g -D_PCTERM -I../psplink   -c -o pspkerror.o pspkerror.C
g++ -Wall -g -D_PCTERM -I../psplink   -c -o asm.o asm.C
g++ -Wall -g -D_PCTERM -I../psplink   -c -o disasm.o disasm.C
g++ -o pspsh pspsh.o parse_args.o pspkerror.o asm.o disasm.o -lreadline -lcurses
Undefined symbols:
  "_rl_filename_completion_function", referenced from:
      _rl_filename_completion_function$non_lazy_ptr in pspsh.o
  "_emacs_standard_keymap", referenced from:
      _emacs_standard_keymap$non_lazy_ptr in pspsh.o
  "_rl_completion_matches", referenced from:
      shell_completion(char const*, int, int)in pspsh.o
      shell_completion(char const*, int, int)in pspsh.o
      shell_completion(char const*, int, int)in pspsh.o
      shell_completion(char const*, int, int)in pspsh.o
      shell_completion(char const*, int, int)in pspsh.o
  "_rl_forced_update_display", referenced from:
      completion_display(char**, int, int)in pspsh.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [pspsh] Error 1
make: *** [all] Error 2
../scripts/009-psplinkusb.sh: Failed.


The warning on line 439 can be fixed by printing %ld and casting to long.

readline fails as gcc finds /usr/lib/libreadline.dylib before /usr/local/lib where GNU readline is installed. What's the best way to make that happen? Right now I'm setting CFLAGS and LDFLAGS and rebuilding manually.
Back to top
View user's profile Send private message Visit poster's website
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Tue Jun 03, 2008 8:12 pm    Post subject: Reply with quote

I had to reinstall readline from source when I was setting up this box (Tiger).

I had the same problems you did.
Back to top
View user's profile Send private message
MagerValp



Joined: 20 Jul 2007
Posts: 10

PostPosted: Tue Jun 03, 2008 8:30 pm    Post subject: Reply with quote

Right, I have readline installed from source in /usr/local, but a plain toolchain.sh build still finds Apple's version in /usr/lib first. I know how to work around it manually of course, but the idea here is for toolchain.sh to build automagically :)
Back to top
View user's profile Send private message Visit poster's website
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Tue Jun 03, 2008 9:34 pm    Post subject: Reply with quote

If I recall correctly, and it was a long time ago, but when I installed readline I passed a path to configure.

I think it was:

Code:
./configure --prefix=/usr


It's not really a toolchain problem, but the fact that OSX doesn't come with GNU readline.
Back to top
View user's profile Send private message
MagerValp



Joined: 20 Jul 2007
Posts: 10

PostPosted: Tue Jun 03, 2008 9:37 pm    Post subject: Reply with quote

Insert_witty_name wrote:
If I recall correctly, and it was a long time ago, but when I installed readline I passed a path to configure.

I think it was:

Code:
./configure --prefix=/usr


I'm not brave enough to overwrite Apple's readline :)

Quote:
It's not really a toolchain problem, but the fact that OSX doesn't come with GNU readline.


Agreed, but the end result is the same - toolchain doesn't build out of the box on OSX.

I'll see if I can find some time to port psplink to BSD readline, and submit a patch.
Back to top
View user's profile Send private message Visit poster's website
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Wed Jun 04, 2008 2:24 am    Post subject: Reply with quote

You can only blame apple for this, quite why the GNU include gets picked up (and this doesn't fail at compile time) and then it uses the BSD library first is just dumb.
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Wed Jun 04, 2008 2:44 am    Post subject: Reply with quote

Isn't this the kind of stuff autoconf and automake are supposed to deal with anyway?
Back to top
View user's profile Send private message Visit poster's website
MagerValp



Joined: 20 Jul 2007
Posts: 10

PostPosted: Wed Jun 04, 2008 3:44 am    Post subject: Reply with quote

OSX ships with libedit, which is a BSD licensed clone of readline. libedit used to come with a readline compatible API, but it appears to be incomplete. To make psplink build cleanly on OSX out of the box, you have to either
  • make readline optional via autoconf,
  • port the code to support libedit with a few #defines,
  • require GNU readline in /usr/local and adjust the Makefile accordingly,
  • build against psptoolchain/build/gdb-6.4/readline and adjust the Makefile accordingly


Most of what psplink needs is available in libedit, but notably the filename completion isn't. The four symbols that don't resolve are:

rl_filename_completion_function
emacs_standard_keymap
rl_completion_matches
rl_forced_update_display

I don't understand why emacs_standard_keymap is requested, as RL_READLINE_VERSION is set to 0x0402 in the Apple header.
Back to top
View user's profile Send private message Visit poster's website
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Wed Jun 04, 2008 7:48 am    Post subject: Reply with quote

Tbh I am not even sure usbhostfs_pc works on OSX without getting a "fixed" libusb anyway, so it probably isn't even worth building on OSX as part of the toolchain. Solve all the problems ;)
Back to top
View user's profile Send private message
MagerValp



Joined: 20 Jul 2007
Posts: 10

PostPosted: Wed Jun 04, 2008 4:45 pm    Post subject: Reply with quote

Ah, that's true. An uname check for Darwin and a message telling the user to install manually seems like a reasonable compromise until the libedit and libusb problems are sorted.
Back to top
View user's profile Send private message Visit poster's website
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Fri Jun 06, 2008 10:52 pm    Post subject: Reply with quote

In the meantime, I've committed the 'make -r' and heap size changes.
Back to top
View user's profile Send private message Visit poster's website
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Sat Jun 07, 2008 2:50 am    Post subject: Reply with quote

Cool. I haven't noticed any issues so far, and I have both those changes made.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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