Author: ericwf
Date: Sun Sep 17 13:59:43 2017
New Revision: 313500

URL: http://llvm.org/viewvc/llvm-project?rev=313500&view=rev
Log:
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


Added:
    libcxx/trunk/test/libcxx/language.support/cxa_deleted_virtual.pass.cpp
Modified:
    libcxx/trunk/lib/abi/CHANGELOG.TXT
    libcxx/trunk/lib/abi/x86_64-apple-darwin16.abilist
    libcxx/trunk/lib/libc++abi.exp
    libcxx/trunk/lib/libc++abi2.exp
    libcxx/trunk/lib/libc++sjlj-abi.exp

Modified: libcxx/trunk/lib/abi/CHANGELOG.TXT
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/abi/CHANGELOG.TXT?rev=313500&r1=313499&r2=313500&view=diff
==============================================================================
--- libcxx/trunk/lib/abi/CHANGELOG.TXT (original)
+++ libcxx/trunk/lib/abi/CHANGELOG.TXT Sun Sep 17 13:59:43 2017
@@ -16,6 +16,16 @@ New entries should be added directly bel
 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

Modified: libcxx/trunk/lib/abi/x86_64-apple-darwin16.abilist
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/abi/x86_64-apple-darwin16.abilist?rev=313500&r1=313499&r2=313500&view=diff
==============================================================================
--- libcxx/trunk/lib/abi/x86_64-apple-darwin16.abilist (original)
+++ libcxx/trunk/lib/abi/x86_64-apple-darwin16.abilist Sun Sep 17 13:59:43 2017
@@ -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'}

Modified: libcxx/trunk/lib/libc++abi.exp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/libc%2B%2Babi.exp?rev=313500&r1=313499&r2=313500&view=diff
==============================================================================
--- libcxx/trunk/lib/libc++abi.exp (original)
+++ libcxx/trunk/lib/libc++abi.exp Sun Sep 17 13:59:43 2017
@@ -12,6 +12,7 @@ ___cxa_guard_acquire
 ___cxa_guard_release
 ___cxa_rethrow
 ___cxa_pure_virtual
+___cxa_deleted_virtual
 ___cxa_begin_catch
 ___cxa_throw
 ___cxa_vec_cctor

Modified: libcxx/trunk/lib/libc++abi2.exp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/libc%2B%2Babi2.exp?rev=313500&r1=313499&r2=313500&view=diff
==============================================================================
--- libcxx/trunk/lib/libc++abi2.exp (original)
+++ libcxx/trunk/lib/libc++abi2.exp Sun Sep 17 13:59:43 2017
@@ -12,6 +12,7 @@ ___cxa_guard_acquire
 ___cxa_guard_release
 ___cxa_rethrow
 ___cxa_pure_virtual
+___cxa_deleted_virtual
 ___cxa_begin_catch
 ___cxa_throw
 ___cxa_vec_cctor

Modified: libcxx/trunk/lib/libc++sjlj-abi.exp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/libc%2B%2Bsjlj-abi.exp?rev=313500&r1=313499&r2=313500&view=diff
==============================================================================
--- libcxx/trunk/lib/libc++sjlj-abi.exp (original)
+++ libcxx/trunk/lib/libc++sjlj-abi.exp Sun Sep 17 13:59:43 2017
@@ -12,6 +12,7 @@ ___cxa_guard_acquire
 ___cxa_guard_release
 ___cxa_rethrow
 ___cxa_pure_virtual
+___cxa_deleted_virtual
 ___cxa_begin_catch
 ___cxa_throw
 ___cxa_vec_cctor

Added: libcxx/trunk/test/libcxx/language.support/cxa_deleted_virtual.pass.cpp
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/language.support/cxa_deleted_virtual.pass.cpp?rev=313500&view=auto
==============================================================================
--- libcxx/trunk/test/libcxx/language.support/cxa_deleted_virtual.pass.cpp 
(added)
+++ libcxx/trunk/test/libcxx/language.support/cxa_deleted_virtual.pass.cpp Sun 
Sep 17 13:59:43 2017
@@ -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; }


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to