Symptoms are strikingly similar to what was described in Bug 242630 for lang/ruby26. Specifically, miniruby is built and linked, and then in the next step it is used to try to autogenerate a header file leading to abnormal termination. (This time it's Signal 10) The solution also seems to be similar: When compiling ruby27 on FreeBSD 12 on 32-bit powerpc, the base system gcc 4.2 should be used. The build completes normally. Specifically, the final patch which was proposed for that bug (https://svnweb.freebsd.org/ports/head/lang/ruby26/Makefile?r1=524729&r2=524728&pathrev=524729) also applies for this port.
^Triage: Request feedback from committer of ports r524729
I agree that forward porting the commit from 2.6 to 2.7 should probably fix build. However, I have deleted all 12.{1,2,3}-related setups since I moved exclusively to 13.0. As such, I don't fix ANY regressions related the old GCC-based releases and since no one else does, you're essentially on your own. Please upgrade to at least 13.0-RELEASE, since things pretty much work there and I regularly do bulk Poudriere builds and fix regressions.
FreeBSD 12.2 is long EOL, and the remaining lifetime of lang/ruby27 (if any) is questionable.