psptoolchain broken?

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

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
uberjack
Posts: 34
Joined: Tue Jul 17, 2007 9:09 am
Location: California, USA
Contact:

psptoolchain broken?

Post by uberjack »

I'm getting an error running psptoolchain:

I'm running ubuntu, and I have all the prerequisites (I've also installed toolchain successfully at different times). Any ideas?

make[3]: Entering directory `/home/jack/psptoolchain/build/gcc-4.3.1/build-psp/gcc'
/home/jack/psptoolchain/build/gcc-4.3.1/build-psp/./gcc/xgcc -B/home/jack/psptoolchain/build/gcc-4.3.1/build-psp/./gcc/ -B/usr/local/pspdev/psp/bin/ -B/usr/local/pspdev/psp/lib/ -isystem /usr/local/pspdev/psp/include -isystem /usr/local/pspdev/psp/sys-include -O2 -O2 -g -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -I. -I/home/jack/psptoolchain/build/gcc-4.3.1/build-psp/psp/libgcc -I../../gcc -I../../gcc//home/jack/psptoolchain/build/gcc-4.3.1/build-psp/psp/libgcc -I../../gcc/../include -I../../gcc/../libcpp/include -Iyes/include -Iyes/include -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/dpd -I../libdecnumber -O2 -g -g -O2 -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize -Dinhibit_libc -G 0 \
-c ../../gcc/crtstuff.c -DCRT_BEGIN \
-o /home/jack/psptoolchain/build/gcc-4.3.1/build-psp/psp/libgcc/crtbegin.o
*** buffer overflow detected ***: /usr/local/pspdev/psp/bin/ar terminated
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(__fortify_fail+0x48)[0x40127558]
/lib/tls/i686/cmov/libc.so.6[0x40125680]
/lib/tls/i686/cmov/libc.so.6[0x40124d68]
/lib/tls/i686/cmov/libc.so.6(_IO_default_xsputn+0xc8)[0x4009aa18]
/lib/tls/i686/cmov/libc.so.6(_IO_padn+0xed)[0x4008de0d]
/lib/tls/i686/cmov/libc.so.6(_IO_vfprintf+0x27cf)[0x4006f15f]
/lib/tls/i686/cmov/libc.so.6(__vsprintf_chk+0xa7)[0x40124e17]
/lib/tls/i686/cmov/libc.so.6(__sprintf_chk+0x2d)[0x40124d5d]
/usr/local/pspdev/psp/bin/ar[0x8051192]
/usr/local/pspdev/psp/bin/ar[0x804f18b]
/usr/local/pspdev/psp/bin/ar[0x8052000]
/usr/local/pspdev/psp/bin/ar[0x8059d08]
/usr/local/pspdev/psp/bin/ar[0x804bab5]
/usr/local/pspdev/psp/bin/ar[0x804c7f0]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5)[0x40043685]
/usr/local/pspdev/psp/bin/ar[0x8049aa1]
======= Memory map: ========
08048000-080c7000 r-xp 00000000 08:01 1088877 /usr/local/pspdev/psp/bin/ar
080c7000-080c8000 r--p 0007e000 08:01 1088877 /usr/local/pspdev/psp/bin/ar
080c8000-080c9000 rw-p 0007f000 08:01 1088877 /usr/local/pspdev/psp/bin/ar
080c9000-080cd000 rw-p 080c9000 00:00 0
09a78000-0cb68000 rw-p 09a78000 00:00 0 [heap]
40000000-4001a000 r-xp 00000000 08:01 1438995 /lib/ld-2.8.90.so
4001a000-4001b000 r-xp 4001a000 00:00 0 [vdso]
4001b000-4001c000 r--p 0001a000 08:01 1438995 /lib/ld-2.8.90.so
4001c000-4001d000 rw-p 0001b000 08:01 1438995 /lib/ld-2.8.90.so
4001d000-4001f000 rw-p 4001d000 00:00 0
4001f000-40020000 r--p 00000000 08:01 752823 /usr/lib/locale/en_US.utf8/LC_MESSAGES/SYS_LC_MESSAGES
40020000-40027000 r--s 00000000 08:01 1038595 /usr/lib/gconv/gconv-modules.cache
40027000-4002d000 rw-p 40027000 00:00 0
4002d000-40185000 r-xp 00000000 08:01 1456347 /lib/tls/i686/cmov/libc-2.8.90.so
40185000-40187000 r--p 00158000 08:01 1456347 /lib/tls/i686/cmov/libc-2.8.90.so
40187000-40188000 rw-p 0015a000 08:01 1456347 /lib/tls/i686/cmov/libc-2.8.90.so
40188000-4018c000 rw-p 40188000 00:00 0
4018c000-401cb000 r--p 00000000 08:01 752814 /usr/lib/locale/en_US.utf8/LC_CTYPE
401cb000-401cf000 rw-p 401cb000 00:00 0
401dd000-401ea000 r-xp 00000000 08:01 1439038 /lib/libgcc_s.so.1
401ea000-401eb000 r--p 0000c000 08:01 1439038 /lib/libgcc_s.so.1
401eb000-401ec000 rw-p 0000d000 08:01 1439038 /lib/libgcc_s.so.1
bfc49000-bfc66000 rw-p bffe3000 00:00 0 [stack]
/bin/bash: line 7: 25871 Aborted /usr/local/pspdev/psp/bin/ar rc libgcc.a $objects
make[2]: *** [libgcc.a] Error 134
make[2]: *** Waiting for unfinished jobs....

Thanks
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Looks like a bug in binutils that is being detected by a new version of GCC (or libssp or whatever) on the host. I'd see if you can disable libssp; either at runtime or when binutils is built. The other solution would be to upgrade pspsdk's binutils port to the latest version, although that might be tricky.
User avatar
uberjack
Posts: 34
Joined: Tue Jul 17, 2007 9:09 am
Location: California, USA
Contact:

Post by uberjack »

jimparis wrote:Looks like a bug in binutils that is being detected by a new version of GCC (or libssp or whatever) on the host. I'd see if you can disable libssp; either at runtime or when binutils is built. The other solution would be to upgrade pspsdk's binutils port to the latest version, although that might be tricky.
Ack! They both sound complicated, but thanks for the suggestion :)
Pirata Nervo
Posts: 409
Joined: Tue Oct 09, 2007 4:22 am

Post by Pirata Nervo »

Image
Upgrade your PSP
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

The solution there is "install an older version of gcc on the host". Was hoping for something better, but it's a start :)
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

I got the exact same error installing on Ubuntu 8.10.
Pirata Nervo
Posts: 409
Joined: Tue Oct 09, 2007 4:22 am

Post by Pirata Nervo »

we're all getting I guess
Image
Upgrade your PSP
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

I seem to remember a similar problem a few releases of Ubuntu ago.
2.- built the toolchain, and at this point I run into a lot of trouble...
it seemed like an easy thing to do, just ./toolchain PS2, but I had problems because my ubuntu version was gcc-4.0, and I needed gcc-3.3.
No problem, apt-get install gcc-3.3, set up the CC variable to /usr/bin/gcc·3.3
http://forums.ps2dev.org/viewtopic.php?t=5413

I haven't upgraded to 8.10 yet so I can't test, but I imagine something similar could be done here.

Code: Select all

sudo apt-get install gcc-4.2
CC=/usr/bin/gcc-4.2 sudo ./toolchain-sudo.sh
User avatar
uberjack
Posts: 34
Joined: Tue Jul 17, 2007 9:09 am
Location: California, USA
Contact:

Post by uberjack »

Yeah, I installed gcc 4.2, and 'ln -s'ed gcc and g++ to the 4.2 versions. I'm trying to compile toolchain now - so far so good - I'll post if everything goes well.
User avatar
uberjack
Posts: 34
Joined: Tue Jul 17, 2007 9:09 am
Location: California, USA
Contact:

Post by uberjack »

Here's what I did to get the toolchain to compile:

Code: Select all

sudo apt-get install gcc-4.2
sudo rm /usr/bin/gcc /usr/bin/g++
sudo ln -s /usr/bin/gcc-4.2 /usr/bin/gcc
sudo ln -s /usr/bin/g++-4.2 /usr/bin/g++
Then run toolchain-sudo. Afterwards, to restore gcc and g++ back to 4.3:

Code: Select all

sudo rm /usr/bin/gcc /usr/bin/g++
sudo ln -s /usr/bin/gcc-4.3 /usr/bin/gcc
sudo ln -s /usr/bin/g++-4.3 /usr/bin/g++
Hope it helps. Thanks for your help, everyone
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Good to know, but you could probably get away with just setting the CC variable in the command line. No need to add links temporarily.
User avatar
uberjack
Posts: 34
Joined: Tue Jul 17, 2007 9:09 am
Location: California, USA
Contact:

Post by uberjack »

That worked better, thanks - with a small modification (export):

Code: Select all

 ## Set up the environment.
 export CC=/usr/bin/gcc-4.2
 export PSPDEV=/usr/local/pspdev
mik
Posts: 13
Joined: Sat Mar 29, 2008 9:55 am

Post by mik »

Hi,

could a Dev please apply the below patch to the toolchains' readme-ubuntu.txt? This makes explicit that gcc-4.2 is required and higher versions break the build.

Thanks,
Mik

Code: Select all

--- 1/readme-ubuntu.txt	2009-03-09 09:18:27.000000000 +0100
+++ 2/readme-ubuntu.txt	2009-03-09 09:18:12.000000000 +0100
@@ -16,4 +16,8 @@
  source ~/.bashrc
 
  ## Build and install the toolchain + sdk.
- sudo ./toolchain-sudo.sh
+
+  ## Set compiler to gcc-4.2 since build currently fails with higher versions
+  export CC="/usr/bin/gcc-4.2"
+
+  sudo ./toolchain-sudo.sh
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

I don't think gcc-4.2 is required -- earlier versions should work too. Can we make the check a bit smarter to:
- check the gcc or $CC version and see if it's bad
- if bad, see if gcc-4.2 is available
- if available, use it, otherwise complain

Another plan would be to just find and fix the real bug that's causing problems with gcc-4.3.
NoEffex
Posts: 106
Joined: Thu Nov 27, 2008 6:48 am

Post by NoEffex »

Just a note, but for some reason(Well, for very clear reasons in that it's just not compatible) the toolchain compiles perfectly with no previous psp* stuff installed, while it fails with the older stuff already installed.
Programming with:
Geany + Latest PSPSDK from svn
xantares
Posts: 16
Joined: Tue Dec 30, 2008 4:09 am

Post by xantares »

Post Reply