-
Notifications
You must be signed in to change notification settings - Fork 562
Add missing C++ ABI linker flag for AIX #1578
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
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.