Compilation Issue for Wii

I’m having some issues compiling RetroArch for Wii. I get the following error output


/c/devkitPro/devkitPPC/bin/powerpc-eabi-g++ -o retroarch_wii.elf -DGEKKO -DHW_RV
L -mrvl -mcpu=750 -meabi -mhard-float -Wl,-Map,retroarch_wii.elf.map,-wrap,mallo
c,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,strdup,-wrap,strndu
p,-wrap,malloc_usable_size -L/c/devkitPro/libogc/lib/wii -L. console/griffin/gri
ffin.o wii/app_booter/app_booter.binobj -lfat  -lretro_wii  -logc -lwiiuse -lbte

c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/4.6.3/../../../../powerpc-eab
i/bin/ld.exe: cannot find -lretro_wii
collect2: ld returned 1 exit status
make: *** [retroarch_wii.elf] Error 1

I beleive the issue is a lack of the ‘libretro_wii.a’ file. As per the note below from the readme.

Can anyone advise on how to generate the libretro_wii.a file and how to solve the issue I have?

I haven’t done this myself, but I think you need an emulator core. Look here: https://github.com/Themaister/RetroArch/wiki/Compilation-guide-(Linux)

Scroll down to the section “Building libretro cores”. Once you have built some cores, try to use one of those. If the general libretro-build.sh doesn’t work, try with libretro-build-wii.sh.

Thanks, I follow the logic now :slight_smile:

Are these cores called “libretro-emulator-name.SO”? And you only need to choose one and rename to “libretro_wii.a”?

I’m building every libretro core with “libretro-build.sh”, since libretro-build-wii.sh it’s not working. I would like to know if I need to compile an specific version for the Wii, since the command libretro-build.sh is only creating single files for each emulator. See screenshot:

Thanks.

Choosing one of them and renaming it to libretro_wii.a should do, that’s how I understood it at least. But as I mentioned before I haven’t compiled it myself.

libretro-emulator-name sounds right, but I don’t know about that extension. I would have to try compiling it myself to say anything for sure, but them getting the .so extension sounds odd. Are you really compiling with devkitpro?

Do you know why libretro-build-wii.sh is not working?

I’m trying to compile using Ubuntu running from an USB device.

First, I have installed GIT:

sudo apt-get install git

Then, SDL…

sudo apt-get install libsdl1.2-dev libsdl1.2debian

After that, I started to compile using the following commands:

git clone git://github.com/libretro/libretro-super.git
cd libretro-super
sh libretro-fetch.sh
sh libretro-build.sh
sh libretro-install.sh /home/ubuntu/cores

The result are those .so files.

Using libretro-build-wii.sh gives the following error, and I dont know what could be the problem.

It won’t work that way because you’re compiling it for Linux x86. You are supposed to compile for Wii.

http://devkitpro.org/wiki/Getting_Started

Are you sure that I need to create a devkitPro environment in Linux just to build the libretro cores?

If you want to build for Wii and not Linux, yes. Or you could set up a build environment in Windows instead, if you have that installed.

Thanks.

I finally managed to compile something successfully - but only the snes9x-next core.

For reference, this is what I did…

git clone https://github.com/libretro/snes9x-next.git

Then, compile the core using:

cd snes9x-next
make -f Makefile.libretro platform=wii

The result will be a “snes9x_next_libretro_wii.a” file.

Rename it to “libretro_wii.a” and put inside the RetroArch source directory.

Now, use this to create the bootloader:

make -f Makefile.wii.salamander clean pkg

And this to build the emulator itself:

make -f Makefile.wii clean pkg

Done. You can find the result files inside “RetroArch/wii/pkg”

The problem is that I can’t compile the libretro core with others emulators. When I try, the result file have a “.so” extension, and not “.a”

Renaming this “.so” file to “libretro_wii.a” doesnt seem to be enough, because I still getting an error.

Are you sure every core is supposed to accept “make -f Makefile.libretro platform=wii”?

If you get a .so extension then you are compiling the PC build and not the Wii build.

Tell me which repos these are. I’m pretty sure you’re doing something wrong - just need to know what it is.

I can compile the Wii version without a problem with the repos that have a “Makefile.libretro” file (snes9x-next and vba-next for example) - using the following command:

make -f Makefile.libretro platform=wii

Repos that only have “compile_libretro.sh” (fba-libretro), I use:

sh compile_libretro.sh make

But the result is a “fb_alpha_libretro.so” file.

With mednafen-libretro I’m only using the command “make”. And the result is also a .so extension.

I assume for most of them, you should be able to add CC=/opt/devkitpro/devkitPPC/bin/powerpc-eabi-gcc and CXX=/opt/devkitpro/devkitPPC/bin/powerpc-eabi-g++ to your $(MAKE) command and that should tell your system that it’s cross-compiling. You can also look in the Makefile and see if ‘wii’ is an option for the ‘platform=’ switch, and if so, add it, as well.

You’re doing it wrong in both cases.

For Mednafen - you have to specify both the CORE (as in - the ‘system’ core that you want to compile) and the ‘platform’ that you want to compile it for.

So if you want to compile the PC Engine core for Wii, you’d do

make core=pce-fast platform=wii

For ngp, you’d do -

make core=ngp platform=wii

and so on.

In FBA’s case you are doing it wrong as well. Go to svn-current/trunk and compile from there like this -

make -f makefile.libretro platform=wii

Could you please tell me what is the command line to compile a specific FBA core? Only CPS1, for example.

Go into svn-current/trunk/fbacores/cps1 and compile it like this -

make -f makefile.libretro platform=wii

Same applies for the other cores.

Thanks Squarepusher!

Now I can start working on those custom resolutions and submit a patch.

I’m trying to compile using the snes9x-next core with the most recent source, but am running into problems. Can someone give me some guidance?

I’ve set up the toolchain, and have the snes9x-next and retroarch source.

I’ve compiled snes9x-next with “make platform=Wii” and copied snes9x_next_libretro.a to the RetroArch folder as libretro_wii.a.

Then I compile RetroArch for Wii with “make -f Makefile.wii.salamander” (there doesn’t seem to be a Makefile.wii anymore) and I get the retroarch-salamander_wii elf/dol files. This seems somewhat correct, but the compilation occured way too fast (less than 10 seconds), and these files are too small (the .dol is only 240k).

Any suggestions?

(Actually, now that I look a little closer, it looks like what I have may be the boot.dol from the Wii nightly build. I was under the impression that I needed to compile each core into RetroArch seperately, or something…?)

Salamander is indeed the boot.dol that acts as a forwarder for the current core.

Now it’s “make -f makefile.griffin platform=wii”