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

PYBIND11_PLATFORM_ABI_ID Modernization Continued (WIP) #5439

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rwgk
Copy link
Collaborator

@rwgk rwgk commented Nov 10, 2024

Description

WORK IN PROGRESS

PR #4953 already modernized the PYBIND11_BUILD_ABI for MSVC.

To be addressed in this PR:

Suggested changelog entry:

@rwgk
Copy link
Collaborator Author

rwgk commented Nov 11, 2024

With this PR at commit 14f8425 and logs_30720380481.zip downloaded from here:

$ cat *.txt | grep 'C.. Info: .* __pybind11_internals_v' | sed 's/.* __pybind11_internals_v[0-9]*/__pybind11_internals_vX/' | cut -d' ' -f1 | sort | uniq -c
     26 __pybind11_internals_vX_clang_libcpp_libcpp1__
     10 __pybind11_internals_vX_clang_libstdcpp_usecxx111__
     40 __pybind11_internals_vX_gcc_libstdcpp_usecxx111__
      2 __pybind11_internals_vX_icc_libstdcpp_usecxx111__
      6 __pybind11_internals_vX_mingw_libstdcpp_usecxx111__
      3 __pybind11_internals_vX_msvc_md_mscver19__
     34 __pybind11_internals_vX_msvc_md_mscver19_debug__
      3 __pybind11_internals_vX_msvc_mt_mscver1941__
      1 __pybind11_internals_vX_pgi_libstdcpp__

This doesn't look right, _LIBCPP_ABI_VERSION and _GLIBCXX_USE_CXX11_ABI always appear to be 1.

@robertmaynard I was trying to follow your #4953 (comment) but maybe I'm misunderstanding?

(I want to leave NVHPC for later.)

@wjakob @henryiii @isuruf @cryos for awareness.

@rwgk rwgk marked this pull request as ready for review November 11, 2024 00:43
@robertmaynard
Copy link
Contributor

With this PR at commit 14f8425 and logs_30720380481.zip downloaded from here:

$ cat *.txt | grep 'C.. Info: .* __pybind11_internals_v' | sed 's/.* __pybind11_internals_v[0-9]*/__pybind11_internals_vX/' | cut -d' ' -f1 | sort | uniq -c
     26 __pybind11_internals_vX_clang_libcpp_libcpp1__
     10 __pybind11_internals_vX_clang_libstdcpp_usecxx111__
     40 __pybind11_internals_vX_gcc_libstdcpp_usecxx111__
      2 __pybind11_internals_vX_icc_libstdcpp_usecxx111__
      6 __pybind11_internals_vX_mingw_libstdcpp_usecxx111__
      3 __pybind11_internals_vX_msvc_md_mscver19__
     34 __pybind11_internals_vX_msvc_md_mscver19_debug__
      3 __pybind11_internals_vX_msvc_mt_mscver1941__
      1 __pybind11_internals_vX_pgi_libstdcpp__

This doesn't look right, _LIBCPP_ABI_VERSION and _GLIBCXX_USE_CXX11_ABI always appear to be 1.

@robertmaynard I was trying to follow your #4953 (comment) but maybe I'm misunderstanding?

(I want to leave NVHPC for later.)

@wjakob @henryiii @isuruf @cryos for awareness.

_GLIBCXX_USE_CXX11_ABI is a boolean which represents which ABI for a set of the C++ std containers you are using ( std::string, list? ). It is an independent axis compared to __GXX_ABI_VERSION.

__GXX_ABI_VERSION _GLIBCXX_USE_CXX11_ABI Notes
102 0 Only compatible with 102. Predates _GLIBCXX_USE_CXX11_ABI
1002 0 Compatible with >= 1002 && < 2000 + CXX11 abi of 0
1002 1 Compatible with >= 1002 && < 2000 + CXX11 abi of 1
1013 0 Compatible with >= 1002 && < 2000 + CXX11 abi of 0
1013 1 Compatible with >= 1002 && < 2000 + CXX11 abi of 1

This presumes that GCC will rev the major value of __GXX_ABI_VERSION when it next breaks ABI compat

@isuruf
Copy link
Contributor

isuruf commented Nov 12, 2024

One more thing to fix would be to remove the compiler id _gcc or _clang as they are compatible with each other. I think the current checks are supposed to protect against the C standard library, but is too broad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants