This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] ABI: Fix for undefined "___cxa_deleted_virtual" symbol in MacOSX
ClosedPublic

Authored by eduardo-elizondo on Sep 13 2017, 2:49 PM.

Details

Summary

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

Note: The first attempt to solve it is here: D36870. This adds the fix to just MacOSX files.

Diff Detail

Event Timeline

eduardo-elizondo edited the summary of this revision. (Show Details)
EricWF edited edge metadata.Sep 13 2017, 3:21 PM

Could you please add an entry into lib/abi/CHANGELOG.TXT, as well as a test that demonstrates the initial bug. I would put it under test/libcxx/language.support/cxa_deleted_virtual.pass.cpp.

Other than that, this LGTM.

mclow.lists edited edge metadata.Sep 13 2017, 5:01 PM

I agree with what @EricWF said - needs a test.
Also you should probably close D36870 with a note that this supersedes that one.

eduardo-elizondo edited the summary of this revision. (Show Details)
> lit -sv test/libcxx/language.support/cxa_deleted_virtual.pass.cpp
> Testing Time: 0.21s
>   Expected Passes    : 1

@EricWF will the final committer update the revision number in the Changelog?

EricWF accepted this revision.Sep 14 2017, 7:45 PM

LGTM minus inline comments.

lib/abi/CHANGELOG.TXT
19

The revision will have to be updated afterwards with the commit ID that this eventually gets committed as; for now leave it as rTBD

test/libcxx/language.support/cxa_deleted_virtual.pass.cpp
10

This needs a // UNSUPPORTED: c++98, c++03 line.

This revision is now accepted and ready to land.Sep 14 2017, 7:45 PM

Addressed inline comments.
Ran tests.

eduardo-elizondo marked 2 inline comments as done.Sep 14 2017, 7:55 PM

@EricWF would you be able to commit this for me?

EricWF closed this revision.Sep 17 2017, 2:02 PM

Committed as r313500.