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: Upgrading Linux GCC on PS2 Linux
  

Results 1 to 9 of 9
  1. #1 Upgrading Linux GCC on PS2 Linux 
    Basic is offline Registered User
    Join Date
    Jul 2011
    Posts
    5
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    Hi I'm trying to upgrade gcc on the PS2 Linux distro.

    I tried to upgrade to GCC3.3.1 but got errors relating to binutils stuff so I upgraded binutils 2.13.2 (I think 2.14 would have worked as well).

    know when I try to configure the make file for the GCC I get an error telling me that my CC environment variable isn't a working compiler.

    I did export CC="/usr/bin/gcc" just to be sure.

    Has anybody experienced this? or know a work around.
    Reply With Quote  

  2. #2  
    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 offical last version is:
    Kernelloader - Browse /Sony Linux Toolkit/Package Update Files/gcc at SourceForge.net
    Kernelloader - Browse /Sony Linux Toolkit/Package Update Files/binutils at SourceForge.net

    I assume that you also have written this linux - Upgrading GCC from 2.9x - Stack Overflow or you have the same problem.

    The R5900 CPU in the PS2 has a bug. There must be a minimum number of assembler instructions in a loop. The original Sony binutils are able to check this with a "warn short loops" parameter. The compiler uses this parameter for the assembler as default, because this is configured in the installed .spec file. I assume that you have overwritten the binutils binaries with a version without support for this parameter. So you need either to use a binutils version which supports this parameter or remove the parameter from the spec file. I would suggest to use gcc 3.0.3 and binutils 2.13.2 from the links above. Otherwise you will have many problems. For newer stuff you need to look at the Linux 2.6 thread in this forum (GCC 4).
    Reply With Quote  

  3. #3  
    Basic is offline Registered User
    Join Date
    Jul 2011
    Posts
    5
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    Yep I wrote the Stackoverflow article as well. Thanks for those links I'll try them later today really hope this will work 2.95.2 is such a crap compiler
    Reply With Quote  

  4. #4  
    Basic is offline Registered User
    Join Date
    Jul 2011
    Posts
    5
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    Ok i installed binutils mipsel, and src, dont quite know what todo with the .diff file.

    installed the binary gcc, I get error messages for simple hello world program.

    5008: Error: illegal operands `mult $2,$2,$3'
    5046: Error: illegal operands `mult $2,$2,$3'

    this is proberly down to my missed .diff file I guess.
    Last edited by Basic; 07-25-2011 at 04:29 AM.
    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 .diff doesn't fix this. There is still something wrong with the binutils. The assembler "as" should be able to compile a file with the text "mult $2,$2,$3". I think every version of MIPS binutils should be able to do it. You can use "strace -fF" to check which assembler is called. You can use parameter "-save-temps" with gcc to save the assembler files and use it directly with "as".
    Reply With Quote  

  6. #6  
    Basic is offline Registered User
    Join Date
    Jul 2011
    Posts
    5
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    OK, just to make sure nothing is interfering, I did a clean install of the PS2 linux (this includes the sps2lib stuff)

    I upgraded binutils, then tried to compile a simple hello world program.

    prior to install
    >as -v = 2.9-33-990721 (mipsEEel-linux) using BDF version 2.0-ee-990721
    I downloaded the src.rpm for the binutils
    >rpm --rebuild binutils.src.rpm
    >rpm -i binutils.rpm --replacefiles
    After upgrading binutils I tried to compile a simple c++ hello world program
    > g++ -o fooWithBinutils2_13 foo.cpp -v
    The error was

    /usr/bin/ld: /tmp/ccJpc4xp.o: ISA mismatch (-mips2) with previous modules (-mips3)
    Bad value: failed to merge target specific data of file /tmp/ccJpc4xp.o
    The full output here

    The output shows that the new version of as is being used
    as -v -mwarn-short-loop -mcpu=r5900 -KPIC -mips2 -msingle-float -o /tmp/ccJpc4xp.o /tmp/ccQhpgC2.s
    GNU assembler version 2.13.2.1 (mipsEEel-linux) using BFD version 2.13.2.1
    Interestingly I can compile the file without link ok.
    >g++ -c foo.cpp -v
    full output here

    But when I link it
    >g++ -o foo foo.o -v
    This results in the same error.
    full output here

    Thanks for your time on this. I feel frustrating close to this.
    Last edited by Basic; 07-27-2011 at 11:23 AM.
    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
    I think you need to use parameter "-mips2" or "-mips3" for g++. One of the parameters should work.
    Reply With Quote  

  8. #8  
    Basic is offline Registered User
    Join Date
    Jul 2011
    Posts
    5
    Downloads
    0
    Uploads
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Likes Given
    0
    Likes Received
    0
    tried those -mips2 gives the same error, -mips3 different errors

    "Error: illegal operands `lui'"
    How would these updates be applied normally?
    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
    As far as I remember I installed gcc 3 without the new binutils on BlackRhino. I used the packages from deba5er.

    I think the binutils are incompatible and you need to recompile all libraries. To prove this, try to compile the following package:
    http://kernelloader.cvs.sourceforge....stic/?view=tar
    This is a self contained program which needs no libraries. This will prove that the linker is working and the libraries are incompatible.
    Reply With Quote  

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •