| View previous topic :: View next topic |
| Author |
Message |
binch
Joined: 04 Jul 2006 Posts: 28 Location: China
|
Posted: Tue May 15, 2007 5:06 pm Post subject: 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 |
|
| Back to top |
|
 |
be2003
Joined: 20 Apr 2006 Posts: 144
|
Posted: Wed May 16, 2007 8:56 am Post subject: |
|
|
im not sure....
try linking you're project with the kernel libc instead _________________ - be2003
blog |
|
| Back to top |
|
 |
nataku92
Joined: 27 Dec 2005 Posts: 5
|
Posted: Fri May 25, 2007 5:54 pm Post subject: |
|
|
Hi,
I'm also having the same problem as the topic creator. How would I link my project with the kernel libc?
Thanks |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Fri May 25, 2007 6:32 pm Post subject: |
|
|
This looks like a toolchain regression, probably in the newlib 1.15 patch.
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? |
|
| Back to top |
|
 |
anhanguera
Joined: 26 Aug 2004 Posts: 31
|
Posted: Tue May 29, 2007 10:42 pm Post subject: |
|
|
hi,
_times() function should be added to a seperate file (syscalls.c ?!). anyway here is a quick and ugly workaround....
| Code: | 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));
+}
|
or,
| Code: | 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
|
anhanguera. |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Wed May 30, 2007 3:48 am Post subject: |
|
|
| 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? |
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.
So no real good reason, at least. We can certainly go back to using the trees if you like. :) |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Wed May 30, 2007 4:51 am Post subject: |
|
|
| anhanguera wrote: | | _times() function should be added to a seperate file (syscalls.c ?!). anyway here is a quick and ugly workaround.... |
I've merged this into newlib-1.15.0-PSP.patch in the repository. |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Wed May 30, 2007 5:57 am Post subject: |
|
|
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? |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Wed May 30, 2007 6:48 am Post subject: |
|
|
Perhaps pipe.c is a bad place for it, but until a better place is decided we have working code. It is a small change that can be easily removed later.
In the meantime, I'll do up a howto for making patches and how to submit them. |
|
| Back to top |
|
 |
anhanguera
Joined: 26 Aug 2004 Posts: 31
|
Posted: Fri Jun 01, 2007 6:49 am Post subject: |
|
|
| i would like to pute _times(..) to a seperated file syscalls.c but there is something with my autoconf, version mismatch i think. when i generate .in and configure files with autotools ./configure gives strange errors in newlib. |
|
| Back to top |
|
 |
|