Συντάκτης: Craig Silverstein Ημερομηνία: Προς: ph10 Υ/ο: pcre-dev, 664 Αντικείμενο: Re: [pcre-dev] [Bug 664] ABI breakage in PCRE 7.6
OK, Philip, here's a patch that should fix the ABI problem on os x
(and other mach-based systems). It still needs to be tested, but
according to my research it should be correct.
--cut here--
Index: pcrecpp.cc
===================================================================
--- pcrecpp.cc (revision 327)
+++ pcrecpp.cc (working copy)
@@ -62,8 +62,15 @@
// RE class. This works on GCC >= 3, at least. We could probably have
// a more inclusive test if we ever needed it.
#if defined(__GNUC__) && __GNUC__ >= 3
+#if defined(__ELF__)
extern Arg no_arg __attribute__((alias("_ZN7pcrecpp2RE6no_argE")));
+#elif defined(__MACH__)
+// Mach (or at least OS X), doesn't support strong aliases, so make it
+// weak. This is a smidge less safe in theory (conceivably, someone
+// could override this symbol in their own binary), but perfectly ok.
+extern Arg no_arg __attribute__((weak, alias("__ZN7pcrecpp2RE6no_argE")));
#endif
+#endif
// If a regular expression has no error, its error_ field points here
static const string empty_string;