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



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@313500 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2017-09-17 20:59:43 +00:00
parent dfcb00a2c5
commit 0732dcfd0d
6 changed files with 30 additions and 0 deletions

View File

@@ -16,6 +16,16 @@ New entries should be added directly below the "Version" header.
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

View File

@@ -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'}

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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; }