I am writing this in response to Build failure, v27.1.0 using gcc-4.9.4, which is now locked, to offer the solution:
I don't know if this is still relevant to current Palemoon code. But it is a subtle error which results from the combination of
- Mozilla packages using deep directory structures
- Gentoo allowing its users to place PORTAGE_TMPDIR somewhere deeper than just a very short path
- Linux kernel not being able (in its default configuration) to read more than 128 bytes for a shebang
In short:
Use a shorter path for PORTAGE_TMPDIR, or compile a kernel with a higher value for BINPRM_BUF_SIZE in
/usr/src/linux/include/uapi/linux/binfmts.h