This report applies to erlang-12.2.0 in prefix portage. The `$EPREFIX/usr/bin/erl' command is a symlink to $EPREFIX/usr/lib/erlang/bin/erl, which is a shellscript. This script fails when started with no arguments. A workaround seems to be to change the ROOTDIR definition in that script from the incorrect one, which goes ROOTDIR=$EPREFIX/var/tmp/portage/dev-lang/erlang-12.2.0/image/$EPREFIX/usr/lib/erlang to simply ROOTDIR=$EPREFIX/usr/lib/erlang (The shellscript does not contain literally '$EPREFIX' but rather the actual EPREFIX path.)
I tried to fix this, will also try to find a machine where it compiles so I can test the fix.
my fix of the fix fixed this. Please sync and reemerge.
Having emerged erlang again the `erl' command works fine now.