--- Begin Message ---
- To: submit@bugs.debian.org
- Subject: mesa: nasty smelly hack to make mesa work with glibc 2.4
- From: Colin Watson <cjwatson@debian.org>
- Date: Fri, 14 Jul 2006 14:38:23 +0100
- Message-id: <20060714133823.GX16866@riva.ucam.org>
Package: mesa
Version: 6.4.2-1
Severity: normal
Tags: patch
mesa's libGLU defines its own dprintf() function for debugging purposes.
Unfortunately, when _GNU_SOURCE is defined glibc also defines a
dprintf() which prints to a file descriptor. (Its man page notes that
it's badly named, but it's too late now.) Since nowadays g++ forces
_GNU_SOURCE, these symbols clash and you get a nasty mess in your build
log:
http://librarian.launchpad.net/3405259/buildlog_ubuntu-edgy-powerpc.mesa_6.4.2-1ubuntu2_FAILEDTOBUILD.txt.gz
I note that all the builds for Debian succeeded while Ubuntu's failed,
so I'm guessing it's to do with the fact that Ubuntu's using glibc 2.4.
Anyway, the attached nasty fix avoids this problem by redefining mesa's
dprintf to gludprintf, after including <stdio.h> to make sure glibc's
version is already defined. A better solution would be to rename it
completely upstream, but I wanted to avoid having to carry a huge diff.
I don't know if you're interested in this patch, but I thought I'd send
it to you to see what you thought.
Thanks,
--
Colin Watson [cjwatson@debian.org]
diff -u mesa-6.4.2/debian/changelog mesa-6.4.2/debian/changelog
--- mesa-6.4.2/debian/changelog
+++ mesa-6.4.2/debian/changelog
@@ -1,3 +1,12 @@
+mesa (6.4.2-1ubuntu3) edgy; urgency=low
+
+ * src/glu/sgi/libnurbs/interface/mystdio.h,
+ src/glu/sgi/libnurbs/nurbtess/mystdio.h: Grotesque hack to avoid dprintf
+ symbol clash with glibc while avoiding a huge diff to all of libGLU; we
+ redefine it to gludprintf.
+
+ -- Colin Watson <cjwatson@ubuntu.com> Fri, 14 Jul 2006 14:19:52 +0100
+
mesa (6.4.2-1ubuntu2) edgy; urgency=low
* Drop lesstif* again.
only in patch2:
unchanged:
--- mesa-6.4.2.orig/src/glu/sgi/libnurbs/interface/mystdio.h
+++ mesa-6.4.2/src/glu/sgi/libnurbs/interface/mystdio.h
@@ -43,6 +43,8 @@
#define __glumystdio_h_
#ifdef STANDALONE
+#include <stdio.h>
+#define dprintf gludprintf
inline void dprintf( char *, ... ) { }
#endif
@@ -51,11 +53,15 @@
#include <stdio.h>
#define dprintf printf
#else
+#include <stdio.h>
+#define dprintf gludprintf
inline void dprintf( char *, ... ) { }
#endif
#endif
#ifdef GLBUILD
+#include <stdio.h>
+#define dprintf gludprintf
inline void dprintf( char *, ... ) { }
#endif
only in patch2:
unchanged:
--- mesa-6.4.2.orig/src/glu/sgi/libnurbs/nurbtess/mystdio.h
+++ mesa-6.4.2/src/glu/sgi/libnurbs/nurbtess/mystdio.h
@@ -43,6 +43,8 @@
#define __glumystdio_h_
#ifdef STANDALONE
+#include <stdio.h>
+#define dprintf gludprintf
inline void dprintf( char *, ... ) { }
#endif
@@ -51,11 +53,15 @@
#include <stdio.h>
#define dprintf printf
#else
+#include <stdio.h>
+#define dprintf gludprintf
inline void dprintf( char *, ... ) { }
#endif
#endif
#ifdef GLBUILD
+#include <stdio.h>
+#define dprintf gludprintf
inline void dprintf( char *, ... ) { }
#endif
--- End Message ---
--- Begin Message ---
- To: 378231-done@bugs.debian.org
- Subject: Re: Bug#378231: mesa: nasty smelly hack to make mesa work with glibc 2.4
- From: Julien Cristau <jcristau@debian.org>
- Date: Fri, 20 Apr 2007 20:00:30 +0200
- Message-id: <20070420180028.GA14512@patate.is-a-geek.org>
- In-reply-to: <20060714133823.GX16866@riva.ucam.org>
- References: <20060714133823.GX16866@riva.ucam.org>
Version: 6.5.1-0.1
On Fri, Jul 14, 2006 at 14:38:23 +0100, Colin Watson wrote:
> mesa's libGLU defines its own dprintf() function for debugging purposes.
> Unfortunately, when _GNU_SOURCE is defined glibc also defines a
> dprintf() which prints to a file descriptor. (Its man page notes that
> it's badly named, but it's too late now.) Since nowadays g++ forces
> _GNU_SOURCE, these symbols clash and you get a nasty mess in your build
> log:
>
> http://librarian.launchpad.net/3405259/buildlog_ubuntu-edgy-powerpc.mesa_6.4.2-1ubuntu2_FAILEDTOBUILD.txt.gz
>
Thanks, this bug has been fixed in a NMU a while ago, I'm now closing it
properly in the bts.
Cheers,
Julien
--- End Message ---