Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 192323 - dev-libs/gmp-4.2.1-rc1 fails to cross compile
Summary: dev-libs/gmp-4.2.1-rc1 fails to cross compile
Status: VERIFIED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-12 17:25 UTC by Christopher Friedt
Modified: 2008-01-18 13:18 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 Christopher Friedt 2007-09-12 17:25:36 UTC
gmp has a configure script that follows the non-convention of using a CC_FOR_BUILD variable instead determining it automatically by either a --build= parameter or a CBUILD environment variable. This patch has fixed that issue:

--- gmp-4.2.1-r1.ebuild.old     2007-09-12 13:15:26.000000000 -0400
+++ gmp-4.2.1-r1.ebuild 2007-09-12 13:16:17.000000000 -0400
@@ -50,6 +50,10 @@
                [ "${ABI}" = "n32" ] && export GMPABI=n32
        fi
 
+       tc-is-cross-compiler && \
+               export CC_FOR_BUILD="${CBUILD}-gcc" && \
+               export CC="${CHOST}-gcc"
+
        econf \
                --localstatedir=/var/state/gmp \
                --disable-mpfr \

Reproducible: Always
Comment 1 SpanKY gentoo-dev 2007-09-13 07:25:13 UTC
use the toolchain-funcs eclass

really though, the configure script should be fixed
Comment 2 Christopher Friedt 2007-09-13 16:49:10 UTC
You're very right, i just started doing that... 

The patch should be:

--- gmp-4.2.1-r1.ebuild.old     2007-09-12 13:15:26.000000000 -0400
+++ gmp-4.2.1-r1.ebuild 2007-09-12 13:16:17.000000000 -0400
@@ -50,6 +50,10 @@
                [ "${ABI}" = "n32" ] && export GMPABI=n32
        fi

+       tc-is-cross-compiler && \
+               export CC_FOR_BUILD="$(tc-getBUILD_CC)" && \
+               export CC="$(tc-getCC)"
+
        econf \
                --localstatedir=/var/state/gmp \
                --disable-mpfr \


(In reply to comment #1)
> use the toolchain-funcs eclass
> 
> really though, the configure script should be fixed
> 

Comment 3 SpanKY gentoo-dev 2007-09-13 20:16:06 UTC
usually using those funcs are only when executing another command ... if you're just exporting, use:
tc-export CC

also, no point in quoting:
foo=$(moo)
Comment 4 SpanKY gentoo-dev 2007-10-06 23:30:29 UTC
gmp-4.2.1 cross-compiles just fine for me, and reading the GMP_PROG_CC_FOR_BUILD macro in acinclude.m4 looks like it does the right thing