[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#378231: marked as done (mesa: nasty smelly hack to make mesa work with glibc 2.4)



Your message dated Fri, 20 Apr 2007 20:00:30 +0200
with message-id <20070420180028.GA14512@patate.is-a-geek.org>
and subject line Bug#378231: mesa: nasty smelly hack to make mesa work with glibc 2.4
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
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 ---
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 ---

Reply to: