Skip to content
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

[EMSUSD-958] CXX ABI detection is broken #3560

Closed
abbec opened this issue Jan 16, 2024 · 12 comments
Closed

[EMSUSD-958] CXX ABI detection is broken #3560

abbec opened this issue Jan 16, 2024 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@abbec
Copy link

abbec commented Jan 16, 2024

Describe the bug
When detecting the CXX abi in FindMaya.cmake, the code uses libFoundation, which in the shipped version of Maya, has symbols stripped.

This causes maya-usd against Maya2024 to be incorrectly built using the old cxx abi (since it falls back to the old abi by default).

The error in the code is here since the expectation that libFoundation.so contains symbols is not true.

Steps to reproduce

$ nm /usr/autodesk/maya2022/lib/libFoundation.so
nm: /usr/autodesk/maya2022/lib/libFoundation.so: no symbols

Expected behavior
Maya 2024 is detected to be using the new ABI and 2022 is detected to use the old ABI.

@abbec abbec added the bug Something isn't working label Jan 16, 2024
@seando-adsk
Copy link
Collaborator

Ah sorry about that. We are missing the nm flag -D to see the dynamic symbols. I'll get a pull-request opened to fix this.

@seando-adsk
Copy link
Collaborator

@abbec This should be fixed by #3562. Can you try using the latest source from the dev branch and let me know if the problem is fixed.

Thanks, Sean

@abbec
Copy link
Author

abbec commented Jan 17, 2024

I haven't tested but I am not sure it will. findVariableReplacement is not a dynamic symbol.

@seando-adsk
Copy link
Collaborator

I ran the nm -D command on a Maya install and it did work. You could just try running this command:
nm -D libFoundation.so | grep findVariableReplacement | grep " T " and see if you get any output.

@abbec
Copy link
Author

abbec commented Jan 17, 2024

$ nm -D /usr/autodesk/maya2022/lib/libFoundation.so | grep findVariableReplacement | grep " T "
<no output>
$ nm -D /usr/autodesk/maya2024/lib/libFoundation.so | grep findVariableReplacement | grep " T "
00000000002b9970 T _ZN16TMayaEnvironment23findVariableReplacementERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE

@seando-adsk
Copy link
Collaborator

Perfect that is expected. So for Maya 2024 it will detect that it was built with the new cxx ABI and build MayaUsd with the appropriate flag.

Sean

@abbec
Copy link
Author

abbec commented Jan 17, 2024

Sure, but won't 2022 (and 2023) be indecisive? I.e. the check could just as well be version >= 2024?

But if it is expected that maya < 2024 is never built with the new ABI it is fine :)

@seando-adsk
Copy link
Collaborator

The default value is to not build with cxx abi, as seen here.

The nm output for those earlier Maya's will be empty so that is caught by the test here and the default value will be used.

Sean

@abbec
Copy link
Author

abbec commented Jan 17, 2024

I guess what I am saying is that if a hypothetical, future Maya 2022.6 is built with the new abi, the nm output would still be empty and the detection would wrongfully assume that it should use the old abi. If the new abi is never used for versions < 2024 then this is not a problem.

@seando-adsk
Copy link
Collaborator

Yes that is true, because the function findVariableReplacement was only added in 2024. Maya 2024 has the new ABI since it was built on RHEL8, where 2022/2023 were built on CentOS7. That would never change even if a new update is shipped for 2022 or 2023. So Maya < 2024 will never have the new ABI.

Sean

@santosg87
Copy link
Collaborator

@abbec is it ok to close this issue now?

@abbec
Copy link
Author

abbec commented Jan 31, 2024

Yep, thanks :)

@santosg87 santosg87 changed the title CXX ABI detection is broken [EMSUSD-958] CXX ABI detection is broken Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants