[pcre-dev] [Bug 664] ABI breakage in PCRE 7.6

Top Page
Delete this message
Author: Craig Silverstein
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 664] ABI breakage in PCRE 7.6
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=664




--- Comment #19 from Craig Silverstein <csilvers@???> 2008-03-24 19:28:07 ---
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;


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email