-
Notifications
You must be signed in to change notification settings - Fork 10
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
calypso should be usable with libc++ on OSX (clang on OSX should use that instead of libstdc++) #82
Comments
also related: https://itanium-cxx-abi.github.io/cxx-abi/cxx-closed.html
|
maybe something like this:
also requires:
to avoid link error:
as well as adding: EDIT: exception handling doesn't work though (same error as #87) |
Good finds! This will ease fixing the OS X support. (I vaguely remember quickly looking for an alternative to |
There are slight vtable and layout differences with libstdc++: - std::type_info::can_catch has one less parameter - __cxa_exception/__cxa_dependent_exception have an extra referenceCount/primaryException field - caught pointer objects aren't expected to be deferenced i.e passed by value Parts of libcxxabi were copied, and libstdc++'s unwind-cxx.h file was also trimmed down to from now on have a self-contained C++ header file which only depends on unwind.h. Hence Calypso doesn't depend on neither systemtap-sdt-dev nor libstdc++ anymore. (SHOULD FIX, OS X build in progress, results tomorrow) Fixes issues #87, #82, #34. Thanks to @timotheecour for pointing out the existence of __shim_type_info.
Compared to libstdc++, there are slight vtable and layout differences in the libc++ ABI: - std::type_info::can_catch has one less parameter - __cxa_exception/__cxa_dependent_exception have an extra referenceCount/primaryException field - caught pointer objects aren't expected to be deferenced i.e passed by value Parts of libc++abi were copied, and libstdc++'s unwind-cxx.h file was also trimmed down. From now on the C++ header only depends on unwind.h, hence Calypso doesn't have to be built anymore against systemtap-sdt-dev and libstdc++. Although it works on Linux, this doesn't fix issues #87 and #82 on MacOS yet, which seems to be due to ABI differences. Thanks to @timotheecour for pointing out the existence of __shim_type_info.
Calypso/runtime/calypso/cpp/eh/unwind-cxx.h uses
#include <bits/atomic_word.h>
that's a libstdc++ file, but clang on OSX should use libc++ instead of libstdc++ (eg: https://discuss.codechef.com/questions/81564/bitsstdch-does-not-work-in-mac-os )
This is why we get errors such as:
NOTE: a workaround is to use gcc includes, eg: https://github.com/Syniurge/Calypso#installing-on-osx
related issues:
unwind-cxx.h should be updated to be more portable, and on OSX not depend on bits/atomic_word.h
EDIT
with the following patch:
I can build most of calypso via:
except for
__is_pointer_p
and__do_catch
missing from type_info ; indeed, this is used:/usr/include/c++/4.2.1/typeinfo
and that file contains modifications by APPLE to remove __do_catch, __is_pointer_p.
EDIT
indeed this was mentioned in https://syniurgeblog.wordpress.com/tag/c/ :
The text was updated successfully, but these errors were encountered: