Forum: PS2 Linux - Show your penguin pride. Discuss PS2 Linux (Official kit and Blackrhino) here!


The above video goes away if you are a member and logged in, so log in now!




 
Would you like to get all the new info from
PSX-Scene in your email each day?




Want to learn more about the team keeping you up to date with the latest scene news?

Read about them now!

Check out our Developer bios, too!

 


User Tag List

Thread: binutils
  

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
  1. #1 binutils 
    eljedi is offline Registered User
    Join Date
    Jul 2010
    Posts
    5
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    Hello guys!

    I'm a really newbie on linux ps2 (just installed few days ago deba5er usb distro).

    I got a problem while trying to compile gcc 4.4. It just blows up and I got the "out of the branch" error. So i thought it could be a linker problem while trying to link the assembler.

    Searching on google I found that with newer versions of binutils i can use an option called -relax-branch to solve the previous problem, but that requieres to update the binutils.

    I downloaded the binutils from gnu ftp server, and here comes my problems:
    compiling binutils 2.20.1 with ./configure (no options, all by default) i compiles and passes the checks. When I try to compile a simple dummy code like:
    void(){} (just this in a file) i got this error:
    as: unrecognized option `-mwarn-short-loop'

    So i decided to test a older version, 2.14.
    I repeat the scenario, but I got a different error:
    as: unrecognized option `-mcpu=r5900'

    Any light on that??
    Thanks!!
    Reply With Quote  

  2. #2  
    coldguy is offline Registered User
    Join Date
    Jul 2010
    Posts
    4
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    As I understand it, the PS2 support that was added to GCC and binutils was never merged into the mainline of the projects, so the support doesn't exist in newer versions. I might be wrong on these version numbers, but for Linux on the PS2 I think the newest GCC you can get is 2.95 (or if you just want to make bare ELFs there's a 3.something port.) ps2dev was the best source for this information but it looks like it's down right now

    (Edit: Just to clarify, it's not simply a matter of getting an older version of GCC or binutils. You have to find versions patched specifically for PS2 support)
    Reply With Quote  

  3. #3  
    eljedi is offline Registered User
    Join Date
    Jul 2010
    Posts
    5
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    I thought binutils 2.14 worked on ps2 linux.. and the support was on mainline as i read someone made the patch for that version.

    Sorry for the confusion, my bad!!

    If that patch exists, is it available still?

    thanks!
    Reply With Quote  

  4. #4  
    coldguy is offline Registered User
    Join Date
    Jul 2010
    Posts
    4
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    I'm honestly not sure, I'm just getting started playing with the PS2 development stuff myself. The patch should still be out there somewhere. Maybe someone more knowledgeable can enlighten us on the state of the PS2 Linux toolchain, and where to obtain it?
    Reply With Quote  

  5. #5  
    Mega Man's Avatar
    Mega Man is offline Member
    Join Date
    Jan 2010
    Location
    Germany
    Posts
    519
    Downloads
    0
    Uploads
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    5
    Likes Received
    35
    The latest working version is gcc 3.0.3 which was available at the offical PS2 Linux homepage. This page is closed now. You can look at the dosbox thread in this forum to get the it.

    Otherwise the best you can get is here: http://rapidshare.com/files/37089499...4.tar.bz2.html
    This includes binutils-2.16.1 and gcc-4.2.0.
    It is not possible to compile it completely. You will only get the early stage called xgcc. When you try to compile something with xgcc, it is very likely that the compiler stops with an internal error. To get this solved you need to be a GCC expert. Only simple assembler will work. I assume most people don't want assembler only.

    You can test the new binutils with the following program:
    Code:
    #define zero $0
    #define AT $1
    #define v0 $2
    #define v1 $3
    #define a0 $4
    #define a1 $5
    #define a2 $6
    #define a3 $7
    #define t0 $8
    
    #define gp $29
    #define ra $31
    
    .data
    msg:
    	.ascii "MIPS Assembler Test\n"
    len:
    	.long . - msg
    
    .text
    .global __start
    __start:
    	lui $29, %hi(_gp)
    	addiu $29, %lo(_gp)
    
    	li $2, 4004
    
    	li $4, 1
    	la $5, msg
    	lw $6, len
    	syscall
    
    	li $4, 0
    	li $2, 4001
    	syscall
    You can compile it with the commands:
    Code:
    ee-as   -o mini.o mini.s
    ee-ld -o simple mini.o
    Reply With Quote  

  6. #6  
    eljedi is offline Registered User
    Join Date
    Jul 2010
    Posts
    5
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    Thanks MegaMan and Coldguy.

    I think i found a patch for version 2.14:
    http://bitbucket.org/ps2dev/ps2toolchain/wiki/Home

    You download it, execute toolchain script and it will create a patches dir. Inside this dir there's a patch for the binutils-2.14
    I'm trying it at the moment..

    Is there some tutorial on how to use this toolchain? I got some error when trying to compile a simple dummy.c file:
    void(){}

    Thanks!


    EDIT: Do you use a cross compiler to compile code for ps2linux or just compile inside the ps2? (which is very slow)
    Reply With Quote  

  7. #7  
    Mega Man's Avatar
    Mega Man is offline Member
    Join Date
    Jan 2010
    Location
    Germany
    Posts
    519
    Downloads
    0
    Uploads
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    5
    Likes Received
    35
    Your test should include at least a function name:
    Code:
    void main()
    {
    }
    I use a native compiler for BlackRhino because the old Debian didn't supported cross compiling. For the Kernel I use a cross compiler. I built the GCC 4 as cross compiler. I think it will not be possible to build the GCC binary native with the old GCC.
    Reply With Quote  

  8. #8  
    eljedi is offline Registered User
    Join Date
    Jul 2010
    Posts
    5
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    It was a typo, sorry.

    I use this: main(){}
    without a void, or any type so i don't need to make any include. Otherwise i will need to use includes.

    when using gcc 3.03, did you get this error:

    as: unrecognized option `-mcpu=r5900'

    I tried to pass -Wa,-march=5900 but gcc still calls as with -mcpu option.

    thanks!
    Reply With Quote  

  9. #9  
    Mega Man's Avatar
    Mega Man is offline Member
    Join Date
    Jan 2010
    Location
    Germany
    Posts
    519
    Downloads
    0
    Uploads
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    5
    Likes Received
    35
    Normally the message "-mcpu=r5900" appears if you try to cross compile but you don't have the cross binutils installed. It then calls the native assembler which doesn't support mips and print this message. But it is also possible that you have mips binutils without support for PS2 (R5900).
    Reply With Quote  

  10. #10  
    eljedi is offline Registered User
    Join Date
    Jul 2010
    Posts
    5
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    using as -march=r5900 works perfectly.
    I read -mcpu on binutils 2.14 is deprecated. But gcc 3.03 passes -mcpu automaticly to as, even if I specify -Wa,-march=5900

    Is there someway to avoid that?

    thanks!!
    Reply With Quote  

Page 1 of 2 1 2 LastLast
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •