You are not logged in.

#1 2008-04-12 06:55:02

beissemj
Member
Registered: 2007-05-11
Posts: 43

GCC 4.3, GMP, and my PKGBUILD -- Who's wrong?

I'm the maintainer of the Mozart PKGBUILD, and I've run into a bit of a problem.

As of GCC 4.3, the package no longer builds because gmp.h is missing a #include, mainly <iostream>.

/usr/include/gmp.h: At global scope:
/usr/include/gmp.h:520: erreur: 'std::FILE' has not been declared

It's a mindlessly simple fix, and it's talked about here.

--- old 2007-12-09 18:15:42.000000000 +0000
+++ /usr/include/gmp.h 2007-12-09 18:16:06.000000000 +0000
@@ -22,6 +22,7 @@
 
 #if defined (__cplusplus)
 #include <iosfwd>   /* for std::istream, std::ostream, std::string */
+#include <iostream> /* for std::FILE */
 #endif

Now my question is what do I do about it? The obvious solution above  is fine, but I am no C++ guru and do not know about namespaces & preprocessor stuff. There are a few mentions of it over here but no one is really doing anything about it....

So... It's not technically a bug in GMP as far as I can tell. And GCC isn't really to blame either. I have not heard back from the Mozart-Oz devs, and I don't think permanently adding <iostream> to gmp.h is necessarily the best idea either, (at least from what I can glean from googling).

What do I do? hmm


Professor: This isn't right...It isn't even wrong...

Offline

#2 2008-04-12 07:08:10

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: GCC 4.3, GMP, and my PKGBUILD -- Who's wrong?

Include the patch to fix the pkgbuild, and inform upstream. That's all.

Last edited by brebs (2008-04-12 07:09:40)

Offline

#3 2008-04-12 07:59:34

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: GCC 4.3, GMP, and my PKGBUILD -- Who's wrong?

Not quite that straightforward. PKGBUILDS can only reference files within $startdir/src or $startdir/pkg - patching files  already installed on the system is not permitted. There is no 100%-correct way to do this in an Arch package, so it's a question of coming up with the "least worst" kludge. As it's an AUR package, I would use comments to inform users of the situation, and let them take responsibility for editing the header file.

Offline

#4 2008-04-12 08:11:10

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: GCC 4.3, GMP, and my PKGBUILD -- Who's wrong?

Oops, I missed the "/usr/include/"

What's wrong with getting the gmp package bumped to include the patch so it's gcc 4.3 compatible, then adding a dependency in your pkg on the fixed gmp version?

Offline

#5 2008-04-12 08:48:31

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: GCC 4.3, GMP, and my PKGBUILD -- Who's wrong?

If "getting the gmp package bumped" means notifying upstream and waiting for a new release, that is correct. What I meant above is that there is nothing that beissemj can do in the mozart PKGBUILD that can solve his current build problem.

Offline

#6 2008-04-12 09:05:02

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: GCC 4.3, GMP, and my PKGBUILD -- Who's wrong?

"Waiting for a new release" means pestering whoever authored the gmp PKGBUILD to add the one-liner patch to the gmp PKGBUILD, and bumping its $pkgrel.

Last edited by brebs (2008-04-12 09:05:53)

Offline

#7 2008-04-12 09:55:24

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: GCC 4.3, GMP, and my PKGBUILD -- Who's wrong?

OK, post the bug report and see what the maintainer thinks. I wouldn't recommend pestering, it tends to be ignored.

My personal €0.02 - there is no need for us to patch gmp here. Yes, we have a user who has a problem with an AUR package, and like a good Archer, he has gone out and found an interim solution, until the upstream guys work it out properly. We have no bug reports so far about any core/extra packages failing in the same way - for example, I have just rebuilt openswan against the current gcc and gmp versions with no problem.

Offline

#8 2008-04-13 04:30:39

beissemj
Member
Registered: 2007-05-11
Posts: 43

Re: GCC 4.3, GMP, and my PKGBUILD -- Who's wrong?

tomk wrote:

If "getting the gmp package bumped" means notifying upstream and waiting for a new release, that is correct. What I meant above is that there is nothing that beissemj can do in the mozart PKGBUILD that can solve his current build problem.

Alright I was kind of afraid of that. I'll pester the mozart devs some more, because I believe in theory gmp.h is correct; otherwise there would be a lot more problems like this.


Professor: This isn't right...It isn't even wrong...

Offline

#9 2008-04-13 05:04:29

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,405
Website

Re: GCC 4.3, GMP, and my PKGBUILD -- Who's wrong?

You could solve it by patching mozart source to add "#include <iostream>" above the "#include <gmp.h>" in the mozart PKGBUILD.

Offline

#10 2008-07-02 21:35:42

BinkyTheClown
Member
From: The Circus
Registered: 2008-06-11
Posts: 85
Website

Re: GCC 4.3, GMP, and my PKGBUILD -- Who's wrong?

Below is a PKGBUILD for gmp that solves the problem, at least for now:

# $Id$
# Maintainer: Thomas Baechler <thomas@archlinux.org>
# Contributor: Gustavo A. Gomez Farhat <gustavo(dot)gomez(dot)farhat(at)gmail(dot)com>
pkgname=gmp
pkgver=4.2.2
pkgrel=2
pkgdesc="A free library for arbitrary precision arithmetic"
arch=(i686 x86_64)
depends=('gcc-libs')
license=('LGPL3')
options=(!libtool)
source=(ftp://ftp.gnu.org/gnu/gmp/gmp-${pkgver}.tar.gz
        gcc-4.3-patch.diff)
md5sums=('1def49df60248a08374ecd6cdcaa5d3d' '79b022d34bfa1f67dc0b3f90598a1c5e')
url="http://www.swox.com/gmp/"

build() {
  cd ${startdir}/src/${pkgname}-${pkgver}
  ./configure --prefix=/usr --enable-cxx --build=${CHOST}
  cd ${srcdir}
  patch -p1 < ${startdir}/gcc-4.3-patch.diff
  cd ${startdir}/src/${pkgname}-${pkgver}
  make || return 1
  make DESTDIR=${startdir}/pkg install
}

The gcc-4.3-patch.diff file:

--- src/gmp-4.2.2/gmp.h 2008-07-02 10:56:32.000000000 -0500
+++ gmp.h       2008-07-02 10:37:28.000000000 -0500
@@ -22,6 +22,7 @@
 
 #if defined (__cplusplus)
 #include <iosfwd>   /* for std::istream, std::ostream, std::string */
+#include <iostream>
 #endif

I share it because I am a mozart-gecode developer and I am tired of hacking the gmp.h header sad


Heeeeeey cat!!!

Offline

Board footer

Powered by FluxBB