Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__cxa_new_handler missing in libc++abi from 3.6 #23612

Closed
jeremyhu mannequin opened this issue Apr 15, 2015 · 7 comments
Closed

__cxa_new_handler missing in libc++abi from 3.6 #23612

jeremyhu mannequin opened this issue Apr 15, 2015 · 7 comments
Labels
bugzilla Issues migrated from bugzilla libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Comments

@jeremyhu
Copy link
Mannequin

jeremyhu mannequin commented Apr 15, 2015

Bugzilla Link 23238
Resolution FIXED
Resolved on Apr 15, 2015 13:55
Version unspecified
OS All
CC @majnemer,@mclow,@rnk

Extended Description

libc++abi from the 3.6.0 tarball is not binary compatible with older versions and will break the system if installed on OSX.

I noticed this when updating libcxxabi in MacPorts.

libc++abi from 3.5.1 contains the symbol ___cxa_new_handler whereas 3.6.0 contains the C++ mangled symbol __ZSt17__cxa_new_handler instead

@jeremyhu
Copy link
Mannequin Author

jeremyhu mannequin commented Apr 15, 2015

Looking at the src differences, this is certainly caused by this change:

-extern "C" new_handler __cxa_new_handler = 0;
+new_handler __cxa_new_handler = 0;

@jeremyhu
Copy link
Mannequin Author

jeremyhu mannequin commented Apr 15, 2015

Fallout from

commit 5660f752e7eebc1b2cfd62ed1c1c12da75efc727
Author: Reid Kleckner [email protected]
Date: Fri Oct 3 20:03:47 2014 +0000

Use __atomic_exchange_n instead of Clang's __sync_swap

Also remove an extra extern "C" from a global variable redeclaration.
This allows building libcxxabi with GCC on my system.

Reviewers: majnemer

Differential Revision: http://reviews.llvm.org/D5604

git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@219012 91177308-0d34-0410-b5e6-96231b3b80d8

@rnk
Copy link
Collaborator

rnk commented Apr 15, 2015

Hm, I was relying on the extern "C" from the header, but the variable is declared in namespace std so it doesn't redeclare the extern "C" variable.

@rnk
Copy link
Collaborator

rnk commented Apr 15, 2015

Amusingly, Howard explicitly added the extern "C" in r155763, and I undid it. >_<

I reverted that change in r235013. libcxxabi isn't close to warning-free with gcc anyway.

I think we should probably fix the ABI in 3.6.1 and MacPorts can carry a local patch to 3.6.0?

@llvmbot
Copy link
Member

llvmbot commented Apr 15, 2015

That sounds good. Jeremy's already patched it for us.

https://trac.macports.org/changeset/135084

@rnk
Copy link
Collaborator

rnk commented Apr 15, 2015

Sounds good, so fixed in r235013.

@jeremyhu
Copy link
Mannequin Author

jeremyhu mannequin commented Apr 15, 2015

Thanks for the quick turnaround, Reid.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 9, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

No branches or pull requests

2 participants