Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 410499 - dev-libs/gmp-5.0.4: check for working compiler does not respect $LDFLAGS
Summary: dev-libs/gmp-5.0.4: check for working compiler does not respect $LDFLAGS
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal minor
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-02 03:37 UTC by Kevin Pyle
Modified: 2013-02-09 07:54 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Pyle 2012-04-02 03:37:53 UTC
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.
Comment 1 SpanKY gentoo-dev 2012-04-03 03:20:26 UTC
yes, please post the config.log as an attachment