Closed mbs-c closed 3 years ago
You may have to link against libc++abi
. Normally, the compiler should do that implicitly, but I don't know what xlclang++ is and how it is different from vanilla clang.
Thanks for the quick reply. libc++abi
isn't even present on my system - I'll try to find out whether that's expected or not. To be perfectly honest, I also don't know much about this version of clang.
For now, I'm adding !defined(__ibmxl__)
to the conditions in line 49 of uncaught_exceptions.hpp
.
libc++abi
may need to be installed with a separate package. That said, if you have cxxabi.h
then you should already have the C++ ABI library installed, and it's not libc++abi
, apparently. Looks like I should disable __cxa_get_globals
for your compiler after all.
Just to be sure, could you attach your cxxabi.h
?
It's identical to this version:
libc++abi may need to be installed with a separate package.
Unfortunately, I cannot say with 100% certainty how the system I'm looking at was set up. I'm assuming we just installed the compiler package provided by IBM here, but I might be wrong.
Could you test that this code compiles, links and runs on your system:
#include <cxxabi.h>
#include <iostream>
int main()
{
std::cout << abi::__cxa_uncaught_exceptions() << std::endl;
}
I've committed a fix that disables __cxa_get_globals
, but that means that the function will be emulated with std::uncaught_exception
, which does not indicate the number of pending exceptions. I'd like to provide this functionality, if possible.
Nope, also produces a linker error. Strange.
I'll try to find out more about how this system was set up and whether we modified the installation in any way or whether that's really how the compiler is packaged.
Ok, so it seems then there's really no way to get the number of pending exceptions. In any case, thank you for the report and for testing.
I compiled Boost.Serialization as a static library with xlclang++ on AIX. When trying to link the program, I get the following error:
It seems like clang on AIX provides
cxxabi.h
, but doesn't define this symbol, so it needs a special case inuncaught_exceptions.hpp
.