Problem found when building games/libretro-mame2000 on FreeBSD 13.0-RELEASE powerpc 32 bit running on Apple Powerbook 17".
# uname -a
FreeBSD g41713 13.0-RELEASE FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f: Fri Apr 9 04:40:01 UTC 2021 firstname.lastname@example.org:/usr/obj/usr/src/powerpc.powerpc/sys/GENERIC powerpc
# cd /usr/ports/games/libretro-mame2000
root@g41713:/usr/ports/games/libretro-mame2000 # make clean
===> Cleaning for libretro-mame2000-0.20210214
root@g41713:/usr/ports/games/libretro-mame2000 # make -DBATCH install clean
===> License GPLv2 accepted by the user
===> libretro-mame2000-0.20210214 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by libretro-mame2000-0.20210214 for building
===> Extracting for libretro-mame2000-0.20210214
=> SHA256 Checksum OK for libretro-mame2000-libretro-0.20210214-e364a15_GH0.tar.gz.
===> Patching for libretro-mame2000-0.20210214
===> Converting DOS text files to UNIX text files
===> Applying FreeBSD patches for libretro-mame2000-0.20210214 from /usr/ports/games/libretro-mame2000/files
===> libretro-mame2000-0.20210214 depends on package: gmake>=4.3 - found
===> Configuring for libretro-mame2000-0.20210214
===> Building for libretro-mame2000-0.20210214
src/cpu/tms9900/99xxcore.h:444:49: note: expanded from macro 'readword'
#define readword(addr) ( TMS99XX_ICOUNT -= 2, (cpu_readmem14(addr) << 8) + cpu_readmem14((addr)+1) )
src/cpu/tms9900/99xxcore.h:3121:11: warning: implicit declaration of function 'setst_subbyte_laecop' is invalid in C99 [-Wimplicit-function-declaration]
value = setst_subbyte_laecop(readbyte(dest), readbyte(src));
src/cpu/tms9900/99xxcore.h:3136:11: warning: implicit declaration of function 'setst_addbyte_laecop' is invalid in C99 [-Wimplicit-function-declaration]
value = setst_addbyte_laecop(readbyte(dest), readbyte(src));
16 warnings and 6 errors generated.
gmake: *** [Makefile:579: src/cpu/tms9900/tms9980a.o] Error 1
gmake: Leaving directory '/usr/ports/games/libretro-mame2000/work/mame2000-libretro-e364a15'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
*** Error code 1
Created attachment 224611 [details]
It builds fine in poudriere in a pretty updated current.
14.0-CURRENT 1400013 50d31dbc6 amd64 git+https 2021-05-02 17:11:19
Would you try updating?
(In reply to Fernando Apesteguía from comment #2)
I tried again after portsnap fetch, update and make clean and the error is still present in version
# uname -a
FreeBSD g41713 13.0-RELEASE FreeBSD 13.0-RELEASE #0 releng/13.0-n244733-ea31abc261f
Unfortunately I don't have any spare machine to test in version 14.0.
Would it help if I provide a more detailed log ?
If yes, please tell me how to generate one (I'm no developer and need step by step instructions)
FWIW, src/cpu/tms9900/99xxstat.h contains PPC32 specific assembly.
If you want to try the generic C version of those functions, change the
`#if defined(__POWERPC__) && !defined(__powerpc64__)`
line to `#if 0`.
Not sure why it's failing to build though. I suspect that it's using GCC specific bits in the assembly, as I really don't recognize the way it's doing asm functions.
(In reply to Brandon Bergren from comment #4)
Following the change you proposed, build is now successful
# pkg info libretro-mame2000
Name : libretro-mame2000
Version : 0.20210214
Installed on : Wed May 5 21:27:40 2021 CEST
Origin : games/libretro-mame2000
Architecture : FreeBSD:13:powerpc
I don't know if this change should be committed, I let you decide.
Should I close the ticket ?
Nah, please leave open for the time being.
While disabling the PPC32 asm is one solution, I think it might be better to do a test build with gcc to see if that fixes the build. Tossing it onto my PPC32 poudriere now to see what happens.
By the way, my comment was bogus. I did not test in PowerPC.
It fails in the builders too: https://docs.freebsd.org/mail/current/freebsd-pkg-fallout.html
FWIW I ended up getting the same build failure as ppc64 was getting.
I think maybe what happened here is that the ppc32 code hasn't been built for a while in upstream and it got out of sync with reality.
(In reply to Brandon Bergren from comment #8)
Maybe you're right. I'm not sure how to deal with this. You can try building with https://github.com/libretro/libretro-super to see if works, as it gets from HEAD. Maybe it's possible to send a PR to upstream but I have no idea how to fix it since I don't have the knowledge nor a ppc machine myself by years.
There's not much happening in the main repository (and they'll probably will not touch further since is a relative old mame version). Should I just mark as broken for those ARCHs?