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 

Makefile.eeglobal_sample fix

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



Joined: 27 Jan 2005
Posts: 79
Location: California

PostPosted: Mon Jan 31, 2005 9:28 pm    Post subject: Makefile.eeglobal_sample fix Reply with quote

As I've waded ever deeper into developing with ps2sdk, I've been including the Makefiles in ps2sdk/samples in my project. Unfortunately, as it stands, ps2sdk/samples/Makefile.eeglobal_sample in CVS doesn't quite seem to work. Could someone with CVS write access apply this fix, so that future users don't run into trouble?

According to the comments in the file, libkernel must be linked in last. It's not last in that file right now, though. I wasn't able to link anything until Drakonite on IRC and here pointed this out to me, and after I fixed that locally things started working. So ps2sdk/samples/Makefile.eeglobal_sample's EE_LIBS line I think should be changed in CVS to
Code:
EE_LIBS += -lc -lsyscall -lkernel

Unfortunately, I have no rationale other than "This works for me, while the line currently seen in ViewCVS doesn't." But, unless my setup is weird *and* the comment is bunk, this is the right thing to do.

(That's a lot of verbiage for a one line fix! It's a shame I don't know WHY these libs are finicky. I'd be able to make the case succinctly in that case.)

Thank you,
Back to top
View user's profile Send private message Visit poster's website
Oobles
Site Admin


Joined: 17 Jan 2004
Posts: 362
Location: Melbourne, Australia

PostPosted: Wed Feb 02, 2005 9:24 am    Post subject: Reply with quote

Thanks for picking that up. We're always interested in getting fixes for ps2sdk. Even if the pick up can be a bit slow at times.

As for the reason; it's because the linker isn't very smart. It only looks at the previous libraries on the line for functions. This means that if you have two libraries that use functions from each other you must add the libraries twice. eg.

-lfoo -lbar -lfoo

This is why the order is important and that you can see items duplicated. Hope that explains it.

Oobles.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Wed Feb 02, 2005 9:38 am    Post subject: Reply with quote

Its smarter than the old method of just including everything. :)
Back to top
View user's profile Send private message Visit poster's website
Neil Stevens



Joined: 27 Jan 2005
Posts: 79
Location: California

PostPosted: Wed Feb 02, 2005 2:21 pm    Post subject: Reply with quote

Thanks for the explanation!
Back to top
View user's profile Send private message Visit poster's website
pukko



Joined: 17 Jan 2004
Posts: 17

PostPosted: Wed Feb 02, 2005 6:52 pm    Post subject: Reply with quote

I guess the library order issue is all sorted out now, but if not I'd say it's time we use the --start-group 'list of libs' --end-group linker option for these libraries.. :P

Though I dunno if that works w the old toolchain?
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Thu Feb 03, 2005 3:41 am    Post subject: Reply with quote

Or you can add the group to the top of the linker script which is what Sony libs do.
_________________
"He was warned..."
Back to top
View user's profile Send private message
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