Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 516104 - dev-libs/mpc [Prefix]: uses wrong preprocessor to read CC and CFLAGS from gmp.h
Summary: dev-libs/mpc [Prefix]: uses wrong preprocessor to read CC and CFLAGS from gmp.h
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://gforge.inria.fr/tracker/?grou...
Whiteboard:
Keywords: PATCH, UPSTREAM
Depends on:
Blocks:
 
Reported: 2014-07-03 08:08 UTC by Michael Haubenwallner (RETIRED)
Modified: 2020-11-08 10:01 UTC (History)
2 users (show)

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 Michael Haubenwallner (RETIRED) gentoo-dev 2014-07-03 08:08:17 UTC
While I do have this problem in Prefix on AIX, this might be a problem for multilib and cross compilation as well (like bug#510248), finding wrong CC/CFLAGS.

There's a recent upstream commit already:
https://gforge.inria.fr/scm/viewvc.php/trunk/m4/mpc.m4?root=mpc&r1=1451&r2=1450&pathrev=1451

Additionally, the ebuild will need: tc-export CPP

Thanks!
Comment 1 Michael Haubenwallner (RETIRED) gentoo-dev 2014-07-14 14:14:19 UTC
In short this can boil down to:

--- mpc-1.0.2.ebuild
+++ mpc-1.0.2.ebuild
@@ -20,10 +20,12 @@
 RDEPEND="${DEPEND}"
 
 src_prepare() {
+       sed -i -e 's/for cpp in/& "$CPP"/' configure || die # 516104
        elibtoolize # for FreeMiNT, bug #347317
 }
 
 src_configure() {
+       tc-export CPP
        econf $(use_enable static-libs static)
 }
Comment 2 SpanKY gentoo-dev 2014-07-31 06:06:38 UTC
i don't think forcing people to set CPP by hand is the right answer (using AC_PROG_CPP would be best, but i guess they don't want to deal with that)

$CXX -E would be better i think
Comment 3 Michael Haubenwallner (RETIRED) gentoo-dev 2014-07-31 07:41:38 UTC
Agreed - why $CXX -E and not $CC -E ?

However, I've just followed upstream here...
Comment 4 SpanKY gentoo-dev 2014-07-31 09:16:03 UTC
(In reply to Michael Haubenwallner from comment #3)

for the same reason upstream isn't using the sane answer in the first place -- they're trying to not require a C compiler, only a C++ compiler.
Comment 5 Michael Haubenwallner (RETIRED) gentoo-dev 2015-02-17 15:48:38 UTC
(In reply to SpanKY from comment #4)

Doesn't feel like they require a C++ compiler at all.

Instead, looks like their idea is to pull CC/CFLAGS from gmp.h first, to guide AC_PROG_CC into the "right" direction...

Maybe we just should tc-export CC (besides CFLAGS) to not use their convenience?
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2019-11-24 21:34:56 UTC
Is it still an issue with =dev-libs/mpc-1.1.0-r1? Looks like upstream bug is fixed.
Comment 7 Ted Marston 2019-11-24 22:33:26 UTC
(In reply to Sergei Trofimovich from comment #6)
> Is it still an issue with =dev-libs/mpc-1.1.0-r1? Looks like upstream bug is
> fixed.

No longer a problem for me now.
Comment 8 Michael Haubenwallner (RETIRED) gentoo-dev 2019-11-25 17:16:50 UTC
Honestly, I've almost given up on AIX and don't have a working AIX Prefix any more, and I'm not into multilib or cross compilation, so this bug indeed isn't relevant to me any more.

However, when looking at their current revision of the MPC_GMP_CC_CFLAGS macro, there still might be demand to properly set up CPP, because there is no $CC nor $CXX in their cpp candidate list:
https://scm.gforge.inria.fr/anonscm/gitweb?p=mpc/mpc.git;a=blob;f=m4/mpc.m4;h=f3c75540b814980c43896922338105bf3289007e;hb=HEAD#l126
Comment 9 Sergei Trofimovich (RETIRED) gentoo-dev 2020-11-08 10:01:18 UTC
I think for multilib ebuilds it was worked around with:

"""
commit c65f6083898968b5442eeb66afd4298a3b4264e2
Author: Michał Górny <mgorny@gentoo.org>
Date:   Fri Jun 17 09:30:26 2016 +0200

    toolchain-funcs.eclass: Assume CPP="$(tc-getCC) -E" when unset, #582822
"""