when calling time(NULL) error linking in pspsdk
when calling time(NULL) error linking in pspsdk
psp-gcc -I. -I/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=150 -L. -L/psp/sdk/lib main.o my.o -lpspumd -lSDL -ljpeg -lpspgu -lpspaudio -lpsphprm -lpng -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o dumper.elf
/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(lib_a-timer.o): In function `_times_r':
../../../../../newlib/libc/reent/timer.c:64: undefined reference to `_times'
collect2: ld returned 1 exit status
make: *** [dumper.elf] Error 1
Anybody encounter this before?
thx
bin
/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(lib_a-timer.o): In function `_times_r':
../../../../../newlib/libc/reent/timer.c:64: undefined reference to `_times'
collect2: ld returned 1 exit status
make: *** [dumper.elf] Error 1
Anybody encounter this before?
thx
bin
-
- Posts: 31
- Joined: Thu Aug 26, 2004 4:20 pm
hi,
_times() function should be added to a seperate file (syscalls.c ?!). anyway here is a quick and ugly workaround....
or,
anhanguera.
_times() function should be added to a seperate file (syscalls.c ?!). anyway here is a quick and ugly workaround....
Code: Select all
Index: newlib-psp/newlib/libc/sys/psp/pipe.c
===================================================================
--- newlib-psp/newlib/libc/sys/psp/pipe.c (revision 2233)
+++ newlib-psp/newlib/libc/sys/psp/pipe.c (working copy)
@@ -234,3 +234,8 @@
}
}
+int __psp_set_errno(int code);
+time_t _times(time_t *t)
+{
+ return __psp_set_errno(sceKernelLibcTime(t));
+}
Code: Select all
Index: psptoolchain/patches/newlib-1.15.0-PSP.patch
===================================================================
--- psptoolchain/patches/newlib-1.15.0-PSP.patch (revision 2233)
+++ psptoolchain/patches/newlib-1.15.0-PSP.patch (working copy)
@@ -7484,7 +7484,7 @@
diff -burN newlib-1.15.0/newlib/libc/sys/psp/pipe.c newlib-psp/newlib/libc/sys/psp/pipe.c
--- newlib-1.15.0/newlib/libc/sys/psp/pipe.c 1970-01-01 01:00:00.000000000 +0100
+++ newlib-psp/newlib/libc/sys/psp/pipe.c 2007-03-10 18:02:39.000000000 +0100
-@@ -0,0 +1,271 @@
+@@ -0,0 +1,277 @@
+/*
+ * PSP Software Development Kit - http://www.pspdev.org
+ * -----------------------------------------------------------------------
@@ -7756,6 +7756,12 @@
+ }
+}
+
++int __psp_set_errno(int code);
++time_t _times(time_t *t)
++{
++ return __psp_set_errno(sceKernelLibcTime(t));
++}
++
diff -burN newlib-1.15.0/newlib/libc/sys/psp/pspcwd.c newlib-psp/newlib/libc/sys/psp/pspcwd.c
--- newlib-1.15.0/newlib/libc/sys/psp/pspcwd.c 1970-01-01 01:00:00.000000000 +0100
+++ newlib-psp/newlib/libc/sys/psp/pspcwd.c 2007-03-10 18:02:39.000000000 +0100
Uhm, I hadn't seen much activity with it so I assumed it wasn't really useful for people. I had been planning to just merge new patches manually.jimparis wrote:ooPo, I'm having a bit of trouble following the newlib stuff currently in svn. Did we stop using the drop-in trees for some reason? How do we modify and regenerate newlib-1.15.0.patch in that case?
So no real good reason, at least. We can certainly go back to using the trees if you like. :)
Ugh, pipe.c is definitely not the right place for that :P
If we're not using drop in trees (which is fine with me), we should delete it from the repository. Maybe a readme describing how to regenerate the patch would be useful. I don't know the best way, maybe: Unpack newlib, make a copy, apply the psp patch, make edits, then diff the two copies?
If we're not using drop in trees (which is fine with me), we should delete it from the repository. Maybe a readme describing how to regenerate the patch would be useful. I don't know the best way, maybe: Unpack newlib, make a copy, apply the psp patch, make edits, then diff the two copies?
-
- Posts: 31
- Joined: Thu Aug 26, 2004 4:20 pm