Using gmp-5.0.4, I encountered a configure failure stating "could not find a working compiler" (and after fixing that, "C++ compiler not available"). After inspecting config.log, I determined that the problem is that the test for a working compiler assumes that LDFLAGS are optional for successfully producing an output file. On my test system, if $LDFLAGS are not passed, then the link will fail. Adding the below sed expression in src_prepare allows the build to complete successfully. sed -i \ -e 's|\$cc \$cflags |&$LDFLAGS |' \ -e 's|\$CXX \$CPPFLAGS |&$LDFLAGS |' \ -e 's|"\$CC \$CFLAGS |&$LDFLAGS |' \ configure For upstream purposes, the sed should instead patch configure.in and acinclude.m4. However, since Gentoo does not regenerate configure from configure.in, my local changes for the ebuild edit configure directly. Some of the changes it introduces are on lines where $LDFLAGS are not used, but this does not harm the build. I think the only critical hunk in acinclude.m4 is around line 3683. I no longer have the config.log, but I can revert the fix and generate a new one if you feel that is necessary. The error in config.log indicated that the compiler failed to find libc.so. Since libc.so is not in my binutils default search path, any link that fails to use my $LDFLAGS (where I have -L/path/to/libc) will fail in this way. I originally sent this to the upstream mailing list <gmp-bugs@gmplib.org>, but it appears not to have gotten through, so I am reporting it here in the hope that it can be fixed here first, then pushed upstream.
yes, please post the config.log as an attachment