From 0732dcfd0d3e7764089ed9d674798e2955533fbc Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Sun, 17 Sep 2017 20:59:43 +0000 Subject: [PATCH] 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 --- lib/abi/CHANGELOG.TXT | 10 ++++++++++ lib/abi/x86_64-apple-darwin16.abilist | 2 ++ lib/libc++abi.exp | 1 + lib/libc++abi2.exp | 1 + lib/libc++sjlj-abi.exp | 1 + .../language.support/cxa_deleted_virtual.pass.cpp | 15 +++++++++++++++ 6 files changed, 30 insertions(+) create mode 100644 test/libcxx/language.support/cxa_deleted_virtual.pass.cpp diff --git a/lib/abi/CHANGELOG.TXT b/lib/abi/CHANGELOG.TXT index b979b4694..f29966e70 100644 --- a/lib/abi/CHANGELOG.TXT +++ b/lib/abi/CHANGELOG.TXT @@ -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 diff --git a/lib/abi/x86_64-apple-darwin16.abilist b/lib/abi/x86_64-apple-darwin16.abilist index 5d91c4b62..4e212b18c 100644 --- a/lib/abi/x86_64-apple-darwin16.abilist +++ b/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/lib/libc++abi.exp b/lib/libc++abi.exp index 87035b295..879b4dd14 100644 --- a/lib/libc++abi.exp +++ b/lib/libc++abi.exp @@ -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 diff --git a/lib/libc++abi2.exp b/lib/libc++abi2.exp index eb088f370..0059eb49e 100644 --- a/lib/libc++abi2.exp +++ b/lib/libc++abi2.exp @@ -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 diff --git a/lib/libc++sjlj-abi.exp b/lib/libc++sjlj-abi.exp index e646df1a4..f494e17cf 100644 --- a/lib/libc++sjlj-abi.exp +++ b/lib/libc++sjlj-abi.exp @@ -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 diff --git a/test/libcxx/language.support/cxa_deleted_virtual.pass.cpp b/test/libcxx/language.support/cxa_deleted_virtual.pass.cpp new file mode 100644 index 000000000..e71c51158 --- /dev/null +++ b/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; }