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 

Have problem with the toolchain

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



Joined: 24 Feb 2008
Posts: 9

PostPosted: Sun Feb 24, 2008 7:22 pm    Post subject: Have problem with the toolchain Reply with quote

Built the toolchain on x86 host, but I have problem when I test it with the helloworld program. Any idea what happened?

Code:

~# ppu-gcc -o test test.c
test.c: In function 'main':
test.c:3: warning: incompatible implicit declaration of built-in function 'printf'
/usr/local/ps3dev/ppu/lib/gcc/ppu/4.2.0/../../../../ppu/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
Back to top
View user's profile Send private message
cchalpha



Joined: 24 Feb 2008
Posts: 9

PostPosted: Sun Feb 24, 2008 7:31 pm    Post subject: Reply with quote

Add -v to gcc and generate detail info.

Code:

:~# ppu-gcc -v -o test test.c
Using built-in specs.
Target: ppu
Configured with: ../configure --prefix=/usr/local/ps3dev/ppu --target=ppu --enable-languages=c,c++ --with-newlib --enable-cxx-flags=-G0 --disable-libgomp --disable-libmudflap --disable-nls --disable-shared --disable-threads
Thread model: single
gcc version 4.2.0
 /usr/local/ps3dev/ppu/libexec/gcc/ppu/4.2.0/cc1 -quiet -v -D__unix__ -D__gnu_linux__ -D__linux__ -Dunix -D__unix -Dlinux -D__linux -Asystem=linux -Asystem=unix -Asystem=posix test.c -quiet -dumpbase test.c -auxbase test -version -o /tmp/cceAgKQd.s
ignoring nonexistent directory "/usr/local/ps3dev/ppu/lib/gcc/ppu/4.2.0/../../../../ppu/sys-include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/ps3dev/ppu/lib/gcc/ppu/4.2.0/include
 /usr/local/ps3dev/ppu/lib/gcc/ppu/4.2.0/../../../../ppu/include
End of search list.
GNU C version 4.2.0 (ppu)
   compiled by GNU C version 4.2.3 (Ubuntu 4.2.3-1ubuntu2).
GGC heuristics: --param ggc-min-expand=73 --param ggc-min-heapsize=80642
Compiler executable checksum: 6188bd1ffaf4ee136cf930e05feb79ff
test.c: In function 'main':
test.c:3: warning: incompatible implicit declaration of built-in function 'printf'
 /usr/local/ps3dev/ppu/lib/gcc/ppu/4.2.0/../../../../ppu/bin/as --traditional-format -a64 -mppc64 -many -V -Qy -o /tmp/cc8oQRMk.o /tmp/cceAgKQd.s
GNU assembler version 2.17 (ppu) using BFD version 2.17
 /usr/local/ps3dev/ppu/libexec/gcc/ppu/4.2.0/collect2 --eh-frame-hdr -V -Qy -m elf64ppc -dynamic-linker /lib64/ld64.so.1 -o test crt1.o crti.o /usr/local/ps3dev/ppu/lib/gcc/ppu/4.2.0/crtbegin.o -L/usr/local/ps3dev/ppu/lib/gcc/ppu/4.2.0 -L/usr/local/ps3dev/ppu/lib/gcc/ppu/4.2.0/../../../../ppu/lib/../lib64 -L/usr/local/ps3dev/ppu/lib/gcc/ppu/4.2.0/../../../../ppu/lib /tmp/cc8oQRMk.o -lgcc -lc -lgcc /usr/local/ps3dev/ppu/lib/gcc/ppu/4.2.0/crtsavres.o /usr/local/ps3dev/ppu/lib/gcc/ppu/4.2.0/crtend.o crtn.o
GNU ld version 2.17
  Supported emulations:
   elf64ppc
   elf32ppclinux
   elf32ppc
   elf32ppcsim
/usr/local/ps3dev/ppu/lib/gcc/ppu/4.2.0/../../../../ppu/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
Back to top
View user's profile Send private message
unsolo



Joined: 16 Apr 2007
Posts: 155
Location: OSLO Norway

PostPosted: Sun Feb 24, 2008 9:01 pm    Post subject: Reply with quote

what platform and why 4.2.0
_________________
Don't do it alone.
Back to top
View user's profile Send private message
cchalpha



Joined: 24 Feb 2008
Posts: 9

PostPosted: Mon Feb 25, 2008 12:06 am    Post subject: Reply with quote

unsolo wrote:
what platform and why 4.2.0


I'm using ubuntu 8.04 on x86 pentium M, and the 4.2.0 is the right version according to the toolchain scripts for ppu, you can see 002-gcc-4.2.0-ppu-stage1.sh in scripts folder.
Back to top
View user's profile Send private message
ouasse



Joined: 30 Jul 2007
Posts: 91
Location: Paris, France

PostPosted: Mon Feb 25, 2008 6:02 am    Post subject: Reply with quote

you used the toolchain for otheros, which has neither support for libc nor newlib. You may only be able to use the toolchain for compiling kernels or the otheros demo.
Back to top
View user's profile Send private message
cchalpha



Joined: 24 Feb 2008
Posts: 9

PostPosted: Mon Feb 25, 2008 2:58 pm    Post subject: Reply with quote

ouasse wrote:
you used the toolchain for otheros, which has neither support for libc nor newlib. You may only be able to use the toolchain for compiling kernels or the otheros demo.


I downloaded it from http://ps2dev.org/ps3/Tools/Toolchain/ps3toolchain-20070626.tar.bz2, I also tried the svn one, is it only for otherOS dev?
Back to top
View user's profile Send private message
IronAvatar



Joined: 25 Nov 2006
Posts: 23

PostPosted: Mon Feb 25, 2008 8:43 pm    Post subject: Reply with quote

I've finaly gotten my PS3 running Linux and setup with the IBM cell sdk.

If you're using Ubuntu, you should be able to install the compiler from the BSCC by doing something like;

Code:

sudo apt-get install ppu-g++ spu-g++ ppu-gdp spu-gdb cell-programming-primer


And be able to cross compile without any problems to run on a linux box. I haven't personaly tried this yet though, instead I'm using ssh to connect to my PS3 and call make from the command line which uses the CBE version of the IBM Cell SDK.

I edit the code on my PC though by using a folder shared with Samba.

The reason I'm doing it this way, is because I can't be bothered/don't yet know how to cross-compile the necessary support libraries (X11 dev, SDL, libc etc.) that I need. But because all that stuff is pre-built on my PS3, it's just easier to compile via ssh :)
Back to top
View user's profile Send private message
cchalpha



Joined: 24 Feb 2008
Posts: 9

PostPosted: Tue Feb 26, 2008 12:03 pm    Post subject: Reply with quote

Thanks IronAvatar. I'll try your commands when I back home tonight.
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Wed Feb 27, 2008 12:21 am    Post subject: Reply with quote

The ps3toolchain, which is used for otheros development, has support for newlib but it doesn't have an OS added yet. This means there's no startup code, which is why it can't find crt*.o. You can find some startup code in the otheros demo.

As for Ubuntu:

Quote:
danpeori@yggdrasil:~$ apt-cache search ppu-
ppu-binutils - PPU assembler, linker and binary utilities
ppu-g++ - PPU C++ compiler
ppu-gcc - PPU C compiler
ppu-gdb - Combined debugger for Linux on Cell BE
ppu-gfortran - PPU Fortran compiler
ppu-gnat - PPU Ada compiler
ppu-sysroot - Cell Broadband Engine (CBE) Cross-Compile System Root
ppu-sysroot64 - PPU cross-sysroot (64-bit)

danpeori@yggdrasil:~$ apt-cache search spu-
spu-binutils - SPU assembler, linker and binary utilities
spu-g++ - SPU cross-compiler (C++ compiler)
spu-gcc - SPU cross-compiler (preprocessor and C compiler)
spu-gdb - SPU stand-alone debugger
spu-gfortran - SPU cross-compiler (Fortran compiler)
spu-newlib - SPU C library

That's fantastic! I had no idea it was there.
Back to top
View user's profile Send private message Visit poster's website
IronAvatar



Joined: 25 Nov 2006
Posts: 23

PostPosted: Wed Feb 27, 2008 1:03 am    Post subject: Reply with quote

Yeah, not many people know about it. I just happened to come accross it when looking for some advice on installing the IDM sdk on non RH/Fedora.

ooPo...sort of wondering where you got the inspiration for your hostname. Was it;

1) Norse Mythology
2) First Linux distro on CD
3) Name of a character from the first PS2 game that I worked on

(I'm betting that it wasn't 3)
Back to top
View user's profile Send private message
cchalpha



Joined: 24 Feb 2008
Posts: 9

PostPosted: Wed Feb 27, 2008 1:16 am    Post subject: Reply with quote

It works, type

aptitude search ppu-
and
aptitude search spu-

and you will have a list of ppu/spu related packages, and I am sure which ones should be installed, :D
Back to top
View user's profile Send private message
cchalpha



Joined: 24 Feb 2008
Posts: 9

PostPosted: Wed Feb 27, 2008 1:28 am    Post subject: Reply with quote

Here are the packages I installed
Code:

 aptitude search ppu-
i   ppu-binutils                    - PPU assembler, linker and binary utilities
i   ppu-g++                         - PPU C++ compiler                         
i   ppu-gcc                         - PPU C compiler                           
i   ppu-gdb                         - Combined debugger for Linux on Cell BE   
p   ppu-gfortran                    - PPU Fortran compiler                     
p   ppu-gnat                        - PPU Ada compiler                         
i   ppu-sysroot                     - Cell Broadband Engine (CBE) Cross-Compile
i A ppu-sysroot64                   - PPU cross-sysroot (64-bit)               

 aptitude search spu-
i   spu-binutils                    - SPU assembler, linker and binary utilities
i   spu-g++                         - SPU cross-compiler (C++ compiler)         
i   spu-gcc                         - SPU cross-compiler (preprocessor and C com
i   spu-gdb                         - SPU stand-alone debugger                 
p   spu-gfortran                    - SPU cross-compiler (Fortran compiler)     
i   spu-newlib                      - SPU C library                             


And the test helloworld program compiled and linked.

Code:

file test
test: ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), not stripped
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 -> PS3 Linux 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