Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psl1ght does not provide times() for newlib to use #71

Open
andoma opened this issue Jan 18, 2011 · 7 comments
Open

psl1ght does not provide times() for newlib to use #71

andoma opened this issue Jan 18, 2011 · 7 comments

Comments

@andoma
Copy link

andoma commented Jan 18, 2011

This code

#include <time.h>
int main(int argc, const char* argv[])
{
   return clock();
}

fails to link:


$ make
[CC] main.c
ppu-gcc -MMD -MP -MF /home/andoma/PSL1GHT/template/build/main.d -g -I/home/andoma/ps3dev/psl1ght/target/include -I/home/andoma/ps3dev/host/ppu/include -O2 -Wall -std=gnu99 -I/home/andoma/PSL1GHT/template/include -I/home/andoma/PSL1GHT/template/build -c /home/andoma/PSL1GHT/template/source/main.c -o main.o
[LD] template.elf
ppu-gcc main.o -B/home/andoma/ps3dev/psl1ght/target/lib -B/home/andoma/ps3dev/host/ppu/lib /home/andoma/ps3dev/host/ppu/ppu/lib/lv2-psl1ght.o -lpsl1ght -llv2 -o /home/andoma/PSL1GHT/template/template.elf
/home/andoma/ps3dev/host/ppu/lib/gcc/ppu/4.5.2/../../../../ppu/lib/libc.a(lib_a-clock.o): In function clock': /home/andoma/ps3toolchain/build/newlib-1.19.0/build-ppu/ppu/newlib/libc/time/../../../../../newlib/libc/time/clock.c:62: undefined reference to._times_r'
collect2: ld returned 1 exit status
make[1]: *** [/home/andoma/PSL1GHT/template/template.elf] Error 1
make: *** [build] Error 2

Looks like PSL1GHT fails to provide times().Not sure if LV2 can provide this info. Perhaps it should just read PPC TBU or something...

@Parlane
Copy link
Member

Parlane commented Jan 19, 2011

Find out what the cell sdk uses?

@andoma
Copy link
Author

andoma commented Jan 19, 2011

I myself don't have the cell SDK...

After reading the man pages on linux which says 'times() returns the number of clock ticks that have elapsed since an arbitrary point in the past.', I think we make times just set tms_utime = time(NULL) * CLOCKS_PER_SEC and set all other fields to 0

       struct tms {
           clock_t tms_utime;  /* user time */
           clock_t tms_stime;  /* system time */
           clock_t tms_cutime; /* user time of children */
           clock_t tms_cstime; /* system time of children */
       };

@Parlane
Copy link
Member

Parlane commented Feb 15, 2011

andoma has this been fixed?

@andoma
Copy link
Author

andoma commented Feb 15, 2011

Nope not AFAIK

@andoma
Copy link
Author

andoma commented Feb 15, 2011

wtf.. i manage to close the bug?!

@andoma
Copy link
Author

andoma commented Feb 15, 2011

not sure if it's possible to reopen it.. hm hm hm...

@themarioga
Copy link

I have this bug, anyone know how to fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants