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.