Added this issue as a comment on a possible duplicate, before I noticed the previous timestamps were around 2 years ago. See attached logs
Created attachment 444018 [details] build.log
Created attachment 444020 [details] emerge --info
Please attach that Makefile to this bug report.
Created attachment 444022 [details] Requested Makefile.
The configure script is very creative: AC_ARG_WITH(dbg-main, AC_HELP_STRING([--with-dbg-main], [location of dbg-main.sh]), DBGR_MAIN=$withval) AC_SUBST(DBGR_MAIN) if test -z "$DBGR_MAIN" ; then DBGR_MAIN=`strings $SH_PROG$EXEEXT | grep bashdb-main.inc` if test -z "$DBGR_MAIN" ; then AC_MSG_ERROR([I didn't find bashdb-main.inc in your bash. If you have the right version of bash, set it with the --with-dbg-main option]) fi fi So the configure script expects that there is exactly one match of bashdb-main.inc in the bash executable. However, OP's executable has two matches because it has debug info. This leads to the observed corruption of the Makefile.
*** Bug 596428 has been marked as a duplicate of this bug. ***
Bumping version after finding a duplicate bug against r2.
Created attachment 449426 [details, diff] Fix for the configure script
fixed instead by just passing the configure script the path: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e5c3e67e5230051c3b6690ef8da675466e2f540