Add missing C++ ABI linker flag for AIX#1578
Conversation
5b99f73 to
0c26f41
Compare
0c26f41 to
cb41efc
Compare
|
Hmm does enabling |
It correctly identifies libc++ but the issue is that it fails to identify and link libc++abi which contains symbols for things such as exception handling. |
That's strange, based on my experience of using c++ with gcc/clang, using the c++ compiler automatically link in stdc++ and other stuff required, including exception handling. cc @madsmtm wdyt |
|
Still not sure if aix needs cxxabi, because usually linking with libstdc++ or libcxx is suffice Maybe you didn't add cxxabi to LD_LIBRARY_PATH or it's not in the path where the dynamic linkr can find? |
madsmtm
left a comment
There was a problem hiding this comment.
I tend to think it's fine to add this, AIX is kind of a weird target (with a whole other set of C compilers), not surpised that it requires something like this.
But I guess we could ping powerpc64-ibm-aix target maintainers and see what they think?
@daltenty @gilamn5tr @amy-kwan
Btw @uyoyo0, what compiler are you using? Is this only a problem when using XL, or is it needed when using Clang too?
| } | ||
| } | ||
| // On aix we must also link libc++abi when using libc++ | ||
| if self.get_target()?.os == "aix" { |
There was a problem hiding this comment.
Nit:
| if self.get_target()?.os == "aix" { | |
| if target.os == "aix" { |
This PR resolves a linking failure when building C++ code on AIX. For example, when working with a downstream crate like
cxx,cargo testfails during the linking stage with the following error:The current implementation links against libc++ but we additionally need it to link against libc++abi which is what this patch does.