Skip to content

[Question] Would it be possible to update gcc? #118

Open

Description

@DarkBattle0000

I'm new to the playstation 3 development scene, I started using the toolset not too long ago. But I noticed some interesting things that got in the way of development for the platform. For some reason I have problems compiling projects with -O2 levels, it compiles more does not run, always returns to xmb (I did Code Review, this ok). In search of an answer the idea came to my mind that the flags that -O2 levels add could be the problem, so I decided to test one by one until I get to the -fcode-hoisting flag, for some reason this flag does not allow me to compile with -O2 levels. Searching around a bit, I found a small update from gcc 7.2.0 to gcc 7.5.0, but it seems to be very unstable. But when compiling my project with this update it worked perfectly. The point here is, Would it be possible to update gcc or fix the problem?

Activity

  1. zeldin commented on Jan 25, 2024

    @zeldin
    Member

    Hi! You might want to try out #110 which contains an update to gcc 10. Would be nice to get some more feedback on how that works out for people.

  2. humbertodias commented on Mar 6, 2024

    @humbertodias
    Contributor
  3. cy33hc commented on Mar 13, 2024

    @cy33hc

    Hi! You might want to try out #110 which contains an update to gcc 10. Would be nice to get some more feedback on how that works out for people.

    Built couple of tiny3d samples, but get a black screen and have to power off the ps3 when trying to load from ps3loadx.

  4. cy33hc commented on Mar 13, 2024

    @cy33hc

    @DarkBattle0000 Try out #121

    Built the toolchain on Ubuntu focal and then built a couple of tiny3d samples. Loaded it via ps3loadx. Same like thing like gcc 10.2.0, I just get black screen and have to poweroff the ps3.

  5. humbertodias commented on Mar 13, 2024

    @humbertodias
    Contributor

    @DarkBattle0000 Try out #121

    Built the toolchain on Ubuntu focal and then built a couple of tiny3d samples. Loaded it via ps3loadx. Same like thing like gcc 10.2.0, I just get black screen and have to poweroff the ps3.

    I'm also facing the black screen using c++ with iostream.h and I'm still investigating the reason.
    On the hand pure c it's working.
    @DarkBattle0000 try out to generated the pkg and tell me if still fails

    docker run -i --rm -v `pwd`:/build -w /build hldtux/ps3dev-sdl2 bash -s <<EOF
    echo '#include <SDL.h>
    #include <stdio.h>
    
    int main(int argc, char *argv[])
    {
        SDL_version version;
        SDL_VERSION(&version);
        printf("SDL version %d.%d.%d\n", version.major, version.minor, version.patch);
    
        // Initialize SDL with video and game controller subsystems
        if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_GAMECONTROLLER) != 0) {
            printf("SDL initialization failed: %s\n", SDL_GetError());
            return 1;
        }
    
        SDL_Window * window = SDL_CreateWindow(
           "window",
            SDL_WINDOWPOS_UNDEFINED,
            SDL_WINDOWPOS_UNDEFINED,
            480,
            272,
            0
        );
    
        if (window == NULL) {
            printf("Window creation failed: %s\n", SDL_GetError());
            SDL_Quit();
            return 1;
        }
    
    
        // SDL_Renderer * renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
        SDL_Renderer * renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_SOFTWARE);
        if (renderer == NULL) {
            printf("Renderer creation failed: %s\n", SDL_GetError());
            SDL_DestroyWindow(window);
            SDL_Quit();
            return 1;
        }
    
        SDL_Rect rect = {216, 96, 34, 64};
    
        int running = 1;
        SDL_Event event;
        while (running) {
            if (SDL_PollEvent(&event)) {
                switch (event.type) {
                    case SDL_QUIT:
                            running = 0;
                        break;
                    case SDL_CONTROLLERDEVICEADDED:
                        SDL_GameControllerOpen(event.cdevice.which);
                        break;
                    case SDL_CONTROLLERBUTTONDOWN:
                        if(event.cbutton.button == SDL_CONTROLLER_BUTTON_START)
                            running = 0;
                        break;
                }
            }
    
            // Clear the screen
            SDL_RenderClear(renderer);
    
            // Draw a red square
            SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255);
            SDL_RenderFillRect(renderer, &rect);
    
            // Draw everything on a white background
            SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
            SDL_RenderPresent(renderer);
        }
    
        return 0;
    }' > main.c
    
    # compile
    ppu-gcc main.c -o main \
    -mcpu=cell -I/usr/local/ps3dev/ppu/include \
    -I/usr/local/ps3dev/portlibs/ppu/include \
    -L/usr/local/ps3dev/portlibs/ppu/lib \
    -L/usr/local/ps3dev/spu/spu/lib \
    -L/usr/local/ps3dev/ppu/powerpc64-ps3-elf/lib \
    -I/usr/local/ps3dev/portlibs/ppu/include/SDL2 -I/usr/local/ps3dev/portlibs/ppu/include -L/usr/local/ps3dev/portlibs/ppu/lib -lSDL2_image -lSDL2 -lm -lgcm_sys -lrsx -lsysutil -lrt -llv2 -lio -laudio
    
    # elf
    ppu-strip main -o main.elf
    sprxlinker main.elf
    fself main.elf main.self
    make_self main.elf main.self
    
    # pkg
    mkdir -p pkg/USRDIR
    make_self_npdrm main.elf pkg/USRDIR/EBOOT.BIN UP0000-ABCDEFG_00-0000000000000000
    cp /usr/local/ps3dev/bin/sfo.xml .
    sed -i "s/01\.00/2.00/g" sfo.xml
    sfo.py --title GAME_TITLE --appid GAME_ID -f sfo.xml pkg/PARAM.SFO
    pkg.py --contentid UP0000-ABCDEFG_00-0000000000000000 pkg/ main.pkg
    
    EOF

    Screenshot 2024-03-13 at 12 17 48 PM

  6. cy33hc commented on Mar 14, 2024

    @cy33hc

    @humbertodias Blacks screen with pkg also.

  7. humbertodias commented on Mar 14, 2024

    @humbertodias
    Contributor

    @humbertodias Blacks screen with pkg also.

    Weird! I have tested successfully it on rpcs3 today.
    is the black screen only on console or also on rpcs3?

  8. cy33hc commented on Mar 14, 2024

    @cy33hc

    @humbertodias Testing on console only. I can try downloading your prebuilt toolchain and try building. What Ubuntu version are you on? I tried running in Focal and I'm getting this error.

    ./powerpc64-ps3-elf-gcc: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found

  9. humbertodias commented on Mar 14, 2024

    @humbertodias
    Contributor

    I'm using ubuntu 24.04 amd64 the same used to publish at releases

    You could also use the docker version of toolchain

    docker run -it -v`pwd`:/build hldtux/ps3dev
  10. cy33hc commented on Mar 14, 2024

    @cy33hc

    Tested with the prebuilt toolchain. Testing on console only.

    1. Built sprite2D sample from tiny3d and black screen on both PKG and ps3loadx
    2. Built the graphics/cairo sample from PSL1GHT and black screen on ps3loadx. This sample does not have option to build a pkg.
  11. humbertodias commented on Mar 14, 2024

    @humbertodias
    Contributor

    Unfortunately, I don't have a ps3 for testing.
    But, I have successfully tested on rpcs3

    How I did to compile sprites 2D and generate the pkg

    git clone https://github.com/wargio/tiny3D
    docker run -i -v`pwd`:/build hldtux/ps3dev bash -s <<EOF
    cd tiny3D
    make
    cd samples/sprites2D
    make pkg
    EOF

    Then outside the container grab the tiny3D/samples/sprites2D/sprites2D.pkg and drop on rpcs3

    image
  12. humbertodias commented on Mar 14, 2024

    @humbertodias
    Contributor

    Tested with the prebuilt toolchain. Testing on console only.

    1. Built sprite2D sample from tiny3d and black screen on both PKG and ps3loadx
    2. Built the graphics/cairo sample from PSL1GHT and black screen on ps3loadx. This sample does not have option to build a pkg.

    I found out the problem and fix here humbertodias@bc0c04b
    Basically, the app ps3loadx uses the library tiny3D that wasn't on https://github.com/ps3dev/ps3libraries
    Therefore, I had pointed to mine https://github.com/humbertodias/ps3libraries that already have the script to install it.
    Try to use the latest release of https://github.com/humbertodias/ps3loadx/releases and it should work now.

  13. linked a pull request that will close this issueUpgrade GCC 13.2.0 version (PPU-SPU) #121on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions