sys-devel/flex is needed to compile sys-libs/pam. this has to be in DEPENDS variable. Reproducible: Always
Assigning to maintainer, probably not valid because sys-devel/flex is in the system set.
Uh? Lars, considering I was the one opening bug #221311 that wouldn't stop it ;) But sys-devel/flex _is_ in sys-libs/pam-1.0.4 depend. You didn't provide emerge --info, if you're using an overlay that provides an alternative sys-libs/pam it's not my problem, I guess ;)
I had the same problem. I can see that flex is in depend, but portage didn't install it. Maybe a problem with portage? My problem was when I was experimenting with cross compilationm and starting with a naked system, ie. no stage files. After building my cross compiler I did a cross emergy baselayout and it died while compiling pam. After emerging flex by hand, pam compiled without problems.