tl;dr Devkitpro r38 looks like it will work to build retroarch WiiU with some minor makefile changes. Of course, testing, code review and continuous integration are a whole other matter.
I spent a few hours updating retroarch build scripts from unsupported Devkitpro r29 (per Wii U wiki) to the supported Devkitpro version r38. Before I spend too much more time, can someone help answer these 3 questions.
1. Has someone already updated the build scripts to work on the supported Devkitpro releases (ex r38)? Let me know and I'll stop working on this.
2. If I spend time on this, would it be possible to commit the fixes/updates added to the main branch? (and who signs off on this?... or is that a question to be asked on another forum?)
3. How does testing work for the WiiU retroarch builds? Assuming we have a stable build config with a working build, and an ok for question 2, there are 30+ cores that need testing plus the main binary. I don't think I could do justice to retroarch quality if I tested all by myself.
== Rationale for update ==
Tl;dr - Devkitpro 38 is the supported release and very polished, Devkitpro 29 has no support and is in a rough state. detailed answer: TBH, I'm new to this, but from reading source, posts & wikis plus some mucking about....
1. Devkitpro for Wii U received a significant investment over 2019 & 2020 in the areas of build automation and linking. The new Wii U Toolchain (wut) seems like the only supported linker solution for all Wii U DevkitPPC projects. Installation is very easy and clean.
2. The old build scripts (pre34) suffer from lot of small creeping issues. ex. The Devkitpro r34 release & commit notes imply the old rpx support (incl r29) was incomplete/broken, so retroarch sounds like it's missing out on fixes. I pulled the r29 build scripts from archives, but these didn't compile/work out of the box, and the failures tended to be the uncaught/silent type .
3. IIRC, Libraries like ffmpeg appear to be packaged for WiiU devkitpro r38. (my interest). This means a community is sharing the load of keeping the versions updated, tested and fixed, and such shared WiiU libraries have a home. The ffmepg core is a separate topic, and I am setting my expectations really low. I don't plan on trying this until retroarch fully builds on.
== Changes ==
I'm approaching this with next to no background in retroarch, homebrew, devkitpro or WiiU/ppc development, so apologies if my notes are too detailed for the audience. In case anyone wants to do it themselves, I'm documenting what has worked so far.
First, remove obsoleted LD_FLAGS from all core makefiles then build cores. Second, change the Makefile.WiiU linker targets from old linker libraries (ld, scripts, asms) that are bundled with retroarch to the standard Wii U Toolchain (wut) style targets. Third, we need to deal with the static core linking scripts specific to WiiU, since each core is a separate executable.
[CORES] First part, build the cores without error and successfully generate libretro_xyz_wiiu.a libraries.
* install devkitpro per devkitpro's platform-specific instructions (I used mac os package)
* install PPC and toolchain per instructions
sudo dkp-pacman -Syu devkitPPC wut-tools
export DEVKITPRO=/opt/devkitpro
export DEVKITPPC=/opt/devkitpro/devkitPPC
# my mac version
/opt/devkitpro/devkitPPC/bin/powerpc-eabi-gcc --version
powerpc-eabi-gcc (devkitPPC release 38) 10.2.0
* install extra stuff some of the WiiU cores will need.
% sudo dkp-pacman -Syu ppc-libpng libogc
Make sure cores build first. Checkout per retroarch wiki.
git clone.../libretro-super.git (sorry, Noobs not allowed to post urls)
$ cd libretro-super
$ ./libretro-fetch.sh
Most important step: Find and removed all instances of the -mwup flag. From looking through devpro team posts, wikis, old code submits, It sounds this older (unsupported) approach required projects such as retroarch to copy and ship WiiU linker libraries/scripts with their projects. The new approach is to rely on linker scripts officially owned and supported by Devkitpro, and deployed using package managers. The first part of this migration is ensure the deprecated -mwup flag is stripped. All you need to do is ensure the cores build, and the libretro_xyz_wiiu.a files get compiled without error.
# expect this error out of the box: powerpc-eabi-g++: error: unrecognized command-line option '-mwup'
# small tweak - makefiles for cores "fbneo" & "lutro" seem to need this to locate gnu archiver binary (AR). All makefiles should be fixed to rely on $DEVKITPPC/bin
$ export PATH=$PATH:$DEVKITPPC/bin
# mass change - remove all references of -muwp
$ grep -irl '\-mwup' .
# manually changes the files you want or pipe to sed -i for in place changes. (I did this manually. There are recipes on the web, but Noobs like me can't post urls )
$ ./libretro-build-wiiu.sh
If you made all the changes, this produces an output of "N core(s) successfully processed:" and No "cores failed". If this doesn't work, I don't see much point in continuing.
== Planned =
[Makefile.WiiU] Second part, I'll need to update Makefile.wiiu to conform with modern DevkitPro / wut makefile target format.
* check out retroarch per retroarch (sorry, Noobs can't post URLS, so adding "...". See WiiU retroarch wiki)
git clone .../ /RetroArch.git retroarch
cd retroarch
## this will break with familar linker errors called out by QuarkTheAwesome (libretro/RetroArch/issues/6781 on github com - sorry, Noob's can't post full URLs)
make -f Makefile.wiiu
TBD work, but I'll continue if no-one points me to this being solved already (and time permits)
* Open Makefile.wiiu
* Open devkitPro/wut/tree/master/samples/make (sorry, Noobs can't post URLS. This path is on github com)
* Refactor Makefile.wiiu to conform to example WUT target format.
[Distscripts] Third part (probably)
(TIL) The wiki for WiiU retroarch release notes that retroarch for WiiU is special. Specifically WiiU statically links all core libraries into executables. Other platforms like linux and windows load the cores as dynamic libraries. WiiU handles this extra step through a custom "dist script" solution. TBD - learn work needed to adapt WUT link syntax to dist scripts. Open question: Why does WiiU need distscripts? Would it be cleaner/easier to just rely on libretro-super documentation + an extra makefile build rule?
I spent a few hours updating retroarch build scripts from unsupported Devkitpro r29 (per Wii U wiki) to the supported Devkitpro version r38. Before I spend too much more time, can someone help answer these 3 questions.
1. Has someone already updated the build scripts to work on the supported Devkitpro releases (ex r38)? Let me know and I'll stop working on this.
2. If I spend time on this, would it be possible to commit the fixes/updates added to the main branch? (and who signs off on this?... or is that a question to be asked on another forum?)
3. How does testing work for the WiiU retroarch builds? Assuming we have a stable build config with a working build, and an ok for question 2, there are 30+ cores that need testing plus the main binary. I don't think I could do justice to retroarch quality if I tested all by myself.
== Rationale for update ==
Tl;dr - Devkitpro 38 is the supported release and very polished, Devkitpro 29 has no support and is in a rough state. detailed answer: TBH, I'm new to this, but from reading source, posts & wikis plus some mucking about....
1. Devkitpro for Wii U received a significant investment over 2019 & 2020 in the areas of build automation and linking. The new Wii U Toolchain (wut) seems like the only supported linker solution for all Wii U DevkitPPC projects. Installation is very easy and clean.
2. The old build scripts (pre34) suffer from lot of small creeping issues. ex. The Devkitpro r34 release & commit notes imply the old rpx support (incl r29) was incomplete/broken, so retroarch sounds like it's missing out on fixes. I pulled the r29 build scripts from archives, but these didn't compile/work out of the box, and the failures tended to be the uncaught/silent type .
3. IIRC, Libraries like ffmpeg appear to be packaged for WiiU devkitpro r38. (my interest). This means a community is sharing the load of keeping the versions updated, tested and fixed, and such shared WiiU libraries have a home. The ffmepg core is a separate topic, and I am setting my expectations really low. I don't plan on trying this until retroarch fully builds on.
== Changes ==
I'm approaching this with next to no background in retroarch, homebrew, devkitpro or WiiU/ppc development, so apologies if my notes are too detailed for the audience. In case anyone wants to do it themselves, I'm documenting what has worked so far.
First, remove obsoleted LD_FLAGS from all core makefiles then build cores. Second, change the Makefile.WiiU linker targets from old linker libraries (ld, scripts, asms) that are bundled with retroarch to the standard Wii U Toolchain (wut) style targets. Third, we need to deal with the static core linking scripts specific to WiiU, since each core is a separate executable.
[CORES] First part, build the cores without error and successfully generate libretro_xyz_wiiu.a libraries.
* install devkitpro per devkitpro's platform-specific instructions (I used mac os package)
* install PPC and toolchain per instructions
sudo dkp-pacman -Syu devkitPPC wut-tools
export DEVKITPRO=/opt/devkitpro
export DEVKITPPC=/opt/devkitpro/devkitPPC
# my mac version
/opt/devkitpro/devkitPPC/bin/powerpc-eabi-gcc --version
powerpc-eabi-gcc (devkitPPC release 38) 10.2.0
* install extra stuff some of the WiiU cores will need.
% sudo dkp-pacman -Syu ppc-libpng libogc
Make sure cores build first. Checkout per retroarch wiki.
git clone.../libretro-super.git (sorry, Noobs not allowed to post urls)
$ cd libretro-super
$ ./libretro-fetch.sh
Most important step: Find and removed all instances of the -mwup flag. From looking through devpro team posts, wikis, old code submits, It sounds this older (unsupported) approach required projects such as retroarch to copy and ship WiiU linker libraries/scripts with their projects. The new approach is to rely on linker scripts officially owned and supported by Devkitpro, and deployed using package managers. The first part of this migration is ensure the deprecated -mwup flag is stripped. All you need to do is ensure the cores build, and the libretro_xyz_wiiu.a files get compiled without error.
# expect this error out of the box: powerpc-eabi-g++: error: unrecognized command-line option '-mwup'
# small tweak - makefiles for cores "fbneo" & "lutro" seem to need this to locate gnu archiver binary (AR). All makefiles should be fixed to rely on $DEVKITPPC/bin
$ export PATH=$PATH:$DEVKITPPC/bin
# mass change - remove all references of -muwp
$ grep -irl '\-mwup' .
# manually changes the files you want or pipe to sed -i for in place changes. (I did this manually. There are recipes on the web, but Noobs like me can't post urls )
$ ./libretro-build-wiiu.sh
If you made all the changes, this produces an output of "N core(s) successfully processed:" and No "cores failed". If this doesn't work, I don't see much point in continuing.
== Planned =
[Makefile.WiiU] Second part, I'll need to update Makefile.wiiu to conform with modern DevkitPro / wut makefile target format.
* check out retroarch per retroarch (sorry, Noobs can't post URLS, so adding "...". See WiiU retroarch wiki)
git clone .../ /RetroArch.git retroarch
cd retroarch
## this will break with familar linker errors called out by QuarkTheAwesome (libretro/RetroArch/issues/6781 on github com - sorry, Noob's can't post full URLs)
make -f Makefile.wiiu
TBD work, but I'll continue if no-one points me to this being solved already (and time permits)
* Open Makefile.wiiu
* Open devkitPro/wut/tree/master/samples/make (sorry, Noobs can't post URLS. This path is on github com)
* Refactor Makefile.wiiu to conform to example WUT target format.
[Distscripts] Third part (probably)
(TIL) The wiki for WiiU retroarch release notes that retroarch for WiiU is special. Specifically WiiU statically links all core libraries into executables. Other platforms like linux and windows load the cores as dynamic libraries. WiiU handles this extra step through a custom "dist script" solution. TBD - learn work needed to adapt WUT link syntax to dist scripts. Open question: Why does WiiU need distscripts? Would it be cleaner/easier to just rely on libretro-super documentation + an extra makefile build rule?
Last edited by hito16,