forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

psptoolchain broken?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
uberjack



Joined: 17 Jul 2007
Posts: 34
Location: California, USA

PostPosted: Thu Nov 06, 2008 9:05 am    Post subject: psptoolchain broken? Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Thu Nov 06, 2008 3:47 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
uberjack



Joined: 17 Jul 2007
Posts: 34
Location: California, USA

PostPosted: Fri Nov 07, 2008 2:52 am    Post subject: Reply with quote

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 :)
Back to top
View user's profile Send private message Visit poster's website
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Fri Nov 07, 2008 3:36 am    Post subject: Reply with quote

http://forums.ps2dev.org/viewtopic.php?t=11213
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Fri Nov 07, 2008 4:42 am    Post subject: Reply with quote

The solution there is "install an older version of gcc on the host". Was hoping for something better, but it's a start :)
Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Fri Nov 07, 2008 5:56 am    Post subject: Reply with quote

I got the exact same error installing on Ubuntu 8.10.
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Fri Nov 07, 2008 6:08 am    Post subject: Reply with quote

we're all getting I guess
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Fri Nov 07, 2008 6:46 am    Post subject: Reply with quote

I seem to remember a similar problem a few releases of Ubuntu ago.
Quote:
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:
sudo apt-get install gcc-4.2
CC=/usr/bin/gcc-4.2 sudo ./toolchain-sudo.sh
Back to top
View user's profile Send private message Visit poster's website
uberjack



Joined: 17 Jul 2007
Posts: 34
Location: California, USA

PostPosted: Fri Nov 07, 2008 6:48 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
uberjack



Joined: 17 Jul 2007
Posts: 34
Location: California, USA

PostPosted: Fri Nov 07, 2008 8:04 am    Post subject: Reply with quote

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

Code:
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:
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
Back to top
View user's profile Send private message Visit poster's website
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Fri Nov 07, 2008 10:27 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Visit poster's website
uberjack



Joined: 17 Jul 2007
Posts: 34
Location: California, USA

PostPosted: Fri Nov 07, 2008 7:10 pm    Post subject: Reply with quote

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

Code:

 ## Set up the environment.
 export CC=/usr/bin/gcc-4.2
 export PSPDEV=/usr/local/pspdev
Back to top
View user's profile Send private message Visit poster's website
mik



Joined: 29 Mar 2008
Posts: 13

PostPosted: Mon Mar 09, 2009 6:26 pm    Post subject: Reply with quote

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:

--- 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
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Wed Mar 11, 2009 1:31 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
NoEffex



Joined: 27 Nov 2008
Posts: 108

PostPosted: Wed Mar 11, 2009 4:38 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
xantares



Joined: 30 Dec 2008
Posts: 16

PostPosted: Wed Mar 11, 2009 7:02 pm    Post subject: Reply with quote

Hi,
did you try http://my-trac.assembla.com/ayn5-84BSr3BJRab7jnrAJ ?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group