ABI: Fix for undefined "___cxa_deleted_virtual" symbol in MacOSX
Patch from Eddie Elizondo. Reviewed as D37830 (https://reviews.llvm.org/D37830).
On MacOSX the following program:
struct S { virtual void f() = delete; };
int main() { new S; }
Fails with the following error:
Undefined symbols for architecture x86_64:
"___cxa_deleted_virtual"
This adds a fix to export the needed symbols.
Test:
> lit -sv test/libcxx/language.support/cxa_deleted_virtual.pass.cpp
> Testing Time: 0.21s
> Expected Passes : 1
llvm-svn: 313500
diff --git a/libcxx/lib/abi/CHANGELOG.TXT b/libcxx/lib/abi/CHANGELOG.TXT
index b979b46..f29966e 100644
--- a/libcxx/lib/abi/CHANGELOG.TXT
+++ b/libcxx/lib/abi/CHANGELOG.TXT
@@ -16,6 +16,16 @@
Version 5.0
-----------
+* rTBD - Fix undefined "___cxa_deleted_virtual" symbol in macosx
+
+ x86_64-linux-gnu
+ ----------------
+ No changes
+
+ x86_64-apple-darwin16.0
+ -----------------------
+ Symbol added: ___cxa_deleted_virtual
+
* r296729 - Remove std::num_get template methods which should be inline
These functions should never have had visible definitions in the dylib but
diff --git a/libcxx/lib/abi/x86_64-apple-darwin16.abilist b/libcxx/lib/abi/x86_64-apple-darwin16.abilist
index 5d91c4b..4e212b1 100644
--- a/libcxx/lib/abi/x86_64-apple-darwin16.abilist
+++ b/libcxx/lib/abi/x86_64-apple-darwin16.abilist
@@ -2323,6 +2323,8 @@
{'type': 'I', 'is_defined': True, 'name': '___cxa_current_exception_type'}
{'type': 'U', 'is_defined': False, 'name': '___cxa_current_primary_exception'}
{'type': 'U', 'is_defined': False, 'name': '___cxa_decrement_exception_refcount'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_deleted_virtual'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_deleted_virtual'}
{'type': 'U', 'is_defined': False, 'name': '___cxa_demangle'}
{'type': 'I', 'is_defined': True, 'name': '___cxa_demangle'}
{'type': 'U', 'is_defined': False, 'name': '___cxa_end_catch'}
diff --git a/libcxx/lib/libc++abi.exp b/libcxx/lib/libc++abi.exp
index 87035b2..879b4dd 100644
--- a/libcxx/lib/libc++abi.exp
+++ b/libcxx/lib/libc++abi.exp
@@ -12,6 +12,7 @@
___cxa_guard_release
___cxa_rethrow
___cxa_pure_virtual
+___cxa_deleted_virtual
___cxa_begin_catch
___cxa_throw
___cxa_vec_cctor
diff --git a/libcxx/lib/libc++abi2.exp b/libcxx/lib/libc++abi2.exp
index eb088f3..0059eb4 100644
--- a/libcxx/lib/libc++abi2.exp
+++ b/libcxx/lib/libc++abi2.exp
@@ -12,6 +12,7 @@
___cxa_guard_release
___cxa_rethrow
___cxa_pure_virtual
+___cxa_deleted_virtual
___cxa_begin_catch
___cxa_throw
___cxa_vec_cctor
diff --git a/libcxx/lib/libc++sjlj-abi.exp b/libcxx/lib/libc++sjlj-abi.exp
index e646df1..f494e17 100644
--- a/libcxx/lib/libc++sjlj-abi.exp
+++ b/libcxx/lib/libc++sjlj-abi.exp
@@ -12,6 +12,7 @@
___cxa_guard_release
___cxa_rethrow
___cxa_pure_virtual
+___cxa_deleted_virtual
___cxa_begin_catch
___cxa_throw
___cxa_vec_cctor
diff --git a/libcxx/test/libcxx/language.support/cxa_deleted_virtual.pass.cpp b/libcxx/test/libcxx/language.support/cxa_deleted_virtual.pass.cpp
new file mode 100644
index 0000000..e71c511
--- /dev/null
+++ b/libcxx/test/libcxx/language.support/cxa_deleted_virtual.pass.cpp
@@ -0,0 +1,15 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// Test exporting the symbol: "__cxa_deleted_virtual" in macosx
+
+struct S { virtual void f() = delete; };
+int main() { new S; }