Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts 0e5d4ea to fix the build on MacOSX
On Mac thread_local and __thread are not ABI compatible, in addition, thread_local comes with additional overhead, __thread seems to be the most suitable linkage to use regardless of c++/c
- Loading branch information
69190ce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krakjoe what was the original issue, could you link please? This seems to be a step back in proper modern C++ support.
Thanks.
69190ce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@weltling Linker error on macos:
If some files are compiled as C and some as C++, some will use
__thread
and somethread_local
, which is an ABI violation.69190ce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nikic thanks for the snippet. Clang on Mac is always a different beast, but in this case the issue might be to be C linkage in a C++ file. Removing U_CFUNC or rewriting
_php_intlgregcal_constructor_body
to use C linkage as well could fixed it. Unfortunately no chance to test on Mac, but used at other places like https://github.com/weltling/parle/blob/master/parle.cpp#L278 even C++14 didn't show issues. The_tsrm_ls_cache
pointer is delivered by a function call, it's per DSO, so no issues would be expected if there's a clean separation.Clearly we're anyway far from having a good C++ API and it's too bad there're not many to develop on Mac, Solaris and so on. But it makes that even more far by preventing writing a clean C++ code eventually :( At quite some places Clang is platform dependent, not sure it's possible to enforce it to be as strict as possible. The point is just, IMO, it would make sense to strive better C++ compat as it moves forward quite rapidly.
Thanks.
69190ce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.