|
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
View previous topic :: View next topic |
Author |
Message |
Beuc
Joined: 26 Mar 2009 Posts: 33 Location: holland
|
Posted: Thu Apr 09, 2009 4:50 am Post subject: [psptoolchain/newlib] remove readlink(2) declaration |
|
|
readlink(2) is not defined in the PSP SDK, but it's defined in /usr/local/pspdev/psp/include/sys/unistd.h.
When using a portability layer such as Gnulib (which detects readlink and see if it should use its own generic version or keep the optimized system-provided version), this causes confusion.
In particular, Gnulib's declaration isn't exactly the same as pspsdk/newlib's (there a missing 'unsigned' in newlib).
So, since readlink isn't available, and since the definition is causing confusion, I suggest it's removed :)
Code: | sed -i -e 's/.*_EXFUN(readlink.*//' /usr/local/pspdev/psp/include/sys/unistd.h |
Note: I'm willing to make a proper patch, however I don't know how you generate patches/newlib-1.16.0-PSP.patch. Is this described somewhere? |
|
Back to top |
|
|
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Wed Apr 15, 2009 4:28 am Post subject: |
|
|
Quote: | Note: I'm willing to make a proper patch, however I don't know how you generate patches/newlib-1.16.0-PSP.patch. Is this described somewhere? |
It's a mess, for historical reasons :) See
Code: | cd /tmp
svn co -r 2229 svn://svn.ps2dev.org/psp/trunk/psptoolchain@2229
svn co -r 2229 svn://svn.ps2dev.org/psp/trunk/newlib-psp@2229
less psptoolchain/devel/README.TXT
|
More recently, I think the method has been:- unpack newlib sources to -orig
- copy -orig to -dev
- apply newlib-1.16.0-PSP.patch to -dev
- make changes in -dev
- generate patch between -orig and -dev
|
|
Back to top |
|
|
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Tue Jun 23, 2009 8:01 am Post subject: |
|
|
I modified unistd.h as follows:
Code: | diff -burN orig.newlib-1.16.0/newlib/libc/include/sys/unistd.h newlib-1.16.0/newlib/libc/include/sys/unistd.h
--- orig.newlib-1.16.0/newlib/libc/include/sys/unistd.h 2007-11-08 11:20:12.000000000 -0500
+++ newlib-1.16.0/newlib/libc/include/sys/unistd.h 2009-06-22 17:58:22.000000000 -0400
@@ -225,8 +225,10 @@
int _EXFUN(sync, (void));
#endif
+#if !defined(__psp__)
int _EXFUN(readlink, (const char *__path, char *__buf, int __buflen));
int _EXFUN(symlink, (const char *__name1, const char *__name2));
+#endif
#define F_OK 0
#define R_OK 4
|
Not a particularly clean fix, but it should be OK (since we don't support symlinks anyway).
Code: |
Sending patches/newlib-1.16.0-PSP.patch
Transmitting file data .
Committed revision 2464.
|
|
|
Back to top |
|
|
|
|
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
|