Toolchain Build Error

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
remleduff
Posts: 11
Joined: Sun Jul 24, 2005 3:29 am

Post by remleduff »

I just rebuilt my toolchain and have been getting errors when I try to make the samples/debug/exception sample.

Known regression?

Code: Select all

psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall  -L. -L/usr/local/ pspdev/psp/sdk/lib   main.o  -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspuser -lpspkernel -o exception.elf
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libc.a(exit.o): In function `exit':
../../../../../newlib/libc/stdlib/exit.c:65: undefined reference to `_exit'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libc.a(sbrkr.o): In function `_sbrk_r':
../../../../../newlib/libc/reent/sbrkr.c:60: undefined reference to `_sbrk'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libc.a(makebuf.o): In function `__smakebuf':
../../../../../newlib/libc/stdio/makebuf.c:96: undefined reference to `isatty'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libc.a(writer.o): In function `_write_r':
../../../../../newlib/libc/reent/writer.c:58: undefined reference to `_write'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libc.a(closer.o): In function `_close_r':
../../../../../newlib/libc/reent/closer.c:53: undefined reference to `_close'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libc.a(fstatr.o): In function `_fstat_r':
../../../../../newlib/libc/reent/fstatr.c:62: undefined reference to `_fstat'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libc.a(lseekr.o): In function `_lseek_r':
../../../../../newlib/libc/reent/lseekr.c:58: undefined reference to `_lseek'
/usr/local/pspdev/lib/gcc/psp/4.0.0/../../../../psp/lib/libc.a(readr.o): In function `_read_r':
../../../../../newlib/libc/reent/readr.c:58: undefined reference to `_read'
collect2: ld returned 1 exit status
User avatar
Agoln
Posts: 326
Joined: Wed Jun 08, 2005 3:14 am
Location: Fort Wayne, IN

Post by Agoln »

Split and moved... How was that related to the debugging thread?

Anyways, remove your old toolchain and SDK and then update the toolchain from svn and run it.
Lego of my Ago!
remleduff
Posts: 11
Joined: Sun Jul 24, 2005 3:29 am

Post by remleduff »

Ok, I've been using the psptoolchain script to rebuild my toolchain but I guess it had gotten old and needed to be checked out again.

Shouldn't the first thing the script does be to make sure it's up-to-date? :)
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

A script that automatically updates itself is a tricky thing to do as strange things can happen if a script changes while it is running.

Also, there's no easy way to pull fresh patches for binutils/gcc/newlib from the svn server so it really can't update those automatically either. However, we really make an effort to keep the psptoolchain package as up to date as possible. This isn't so bad as they don't change as often as pspsdk has been lately.

Luckily, a fresh version of pspsdk can be easily checked out of svn. This is why you can just type './toolchain.sh -p' to grab the latest version and install it. Most of the time this will be all you'll have to do.

Still, when in doubt... check for a newer version of the psptoolchain package. If you're running the latest then you're probably ok.
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

ooPo wrote:A script that automatically updates itself is a tricky thing to do as strange things can happen if a script changes while it is running.
Like what?
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Shell scripts aren't read entirely into ram before being parsed.

If you add or remove a few characters in the middle of a script while its running then its pointer shifts. It may start parsing the next line halfway through and die - or worse.
remleduff
Posts: 11
Joined: Sun Jul 24, 2005 3:29 am

Post by remleduff »

How about if toolchain.sh never changes and all it does is pull down the newest do_toolchain.sh (where do_toolchain.sh would be the actual script that does the work) and run it?

Like this tc.sh:

Code: Select all

#!/usr/bin/sh
svn update
./toolchain.sh $*
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Yeah, that's a great workaround. Way to go!

Or, people could type 'svn update' themselves or even just grab the latest version from my website.
Post Reply