On Fri Dec 05 17:30:25 2008, [email protected] wrote:
> chromatic via RT wrote:
> > [snip]
> 
>    This may not work right
> > on Mac OS X, in which case we'll need to get more clever.  
> 
> Had no negative impact on Darwin/PPC in this smolder test run:
> http://smolder.plusthree.com/app/public_projects/report_details/8453

chromatic's patch didn't fix make cover for me.  The problem appears to
be that dlfcn.h was included in a couple other places without __USE_GNU
#define'd.  It also appears that defining __USE_GNU breaks stdio.h for
our purposes.

The attached patch solves this problem by removing the extra includes of
dlfcn.h and defining __USE_GNU only for dlfcn.h, unless it's already
defined.  This allows make cover to work on Ubuntu (Hardy) x86 and
doesn't appear to break anything new on Darwin (Coke++ for testing that).

Barring feedback, I'll apply this patch after 5 days (3/26).  Testing on
win32 would be appreciated.
Index: src/exceptions.c
===================================================================
--- src/exceptions.c	(revision 37626)
+++ src/exceptions.c	(working copy)
@@ -23,13 +23,6 @@
 #include "exceptions.str"
 #include "pmc/pmc_continuation.h"
 
-#ifdef PARROT_HAS_BACKTRACE
-#  include <execinfo.h>
-#  ifdef PARROT_HAS_DLINFO
-#    include <dlfcn.h>
-#  endif
-#endif
-
 /* HEADERIZER HFILE: include/parrot/exceptions.h */
 
 /* HEADERIZER BEGIN: static */
Index: config/gen/platform/generic/dl.c
===================================================================
--- config/gen/platform/generic/dl.c	(revision 37626)
+++ config/gen/platform/generic/dl.c	(working copy)
@@ -21,10 +21,6 @@
 
 */
 
-#ifdef PARROT_HAS_HEADER_DLFCN
-#  include <dlfcn.h>
-#endif
-
 #define PARROT_DLOPEN_FLAGS RTLD_LAZY
 
 /*
Index: config/gen/config_h/feature_h.in
===================================================================
--- config/gen/config_h/feature_h.in	(revision 37626)
+++ config/gen/config_h/feature_h.in	(working copy)
@@ -145,10 +145,15 @@
 if (defined @backtrace@) {
     print OUT <<"END_PRINT";
 #define PARROT_HAS_BACKTRACE
+#include <execinfo.h>
+//__USE_GNU seems to mess up stdio.h on Linux; only include it for dlfcn.h ifndef
 #ifndef __USE_GNU
 #  define __USE_GNU
+#  include <dlfcn.h>
+#  undef __USE_GNU
+#else
+#  include <dlfcn.h>
 #endif
-#include <dlfcn.h>
 END_PRINT
 }
 
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to