Browse Source

dselect: Do not depend on cxxabi.h to have declared __cxa_pure_virtual

The C++ ABI specifies that these functions are within the “__cxxabiv1”
namespace, and that “abi” is an alias to be used by userland. But in
this case as we are replacing the implementation we should also use the
same canonical namespace.

Signed-off-by: Guillem Jover <guillem@debian.org>
Jörg Sonnenberger 7 years ago
parent
commit
7b1b21e4c9
2 changed files with 9 additions and 1 deletions
  1. 4 0
      debian/changelog
  2. 5 1
      dselect/cxx-support.cc

+ 4 - 0
debian/changelog

@@ -3,6 +3,10 @@ dpkg (1.18.23) UNRELEASED; urgency=medium
   * Handle unmatched arch-qualified virtual packages in dpkg-genbuildinfo,
     instead of letting perl die. Closes: #849944
   * Declare .buildinfo format as stable with version 1.0.
+  * Do not depend on cxxabi.h to have declared __cxa_pure_virtual, use
+    the same “__cxxabiv1” namespace as specified in the C++ ABI, instead
+    of using the “abi” alias intended for use by userland.
+    Thanks to Jörg Sonnenberger <joerg@netbsd.org>.
   * Portability:
     - Do not redeclare sys_siglist in libcompat when the system does so.
       Thanks to Thomas Klausner <wiz@NetBSD.org>.

+ 5 - 1
dselect/cxx-support.cc

@@ -81,9 +81,13 @@ operator delete[](void *a, size_t size) DPKG_ATTR_NOEXCEPT
 }
 
 #ifdef HAVE___CXA_PURE_VIRTUAL
+namespace __cxxabiv1 {
+
 extern "C" void
-abi::__cxa_pure_virtual()
+__cxa_pure_virtual()
 {
 	internerr("pure virtual function called");
 }
+
+}
 #endif