diff --git a/cmake/external/pybind11.cmake b/cmake/external/pybind11.cmake index 457be2ff20e4a..27b62c968a88d 100644 --- a/cmake/external/pybind11.cmake +++ b/cmake/external/pybind11.cmake @@ -27,7 +27,7 @@ set(PYBIND_PATCH_COMMAND "") if(LINUX AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9) - set(PYBIND_TAG v2.13.6) + set(PYBIND_TAG v3.0.0) file(TO_NATIVE_PATH ${PADDLE_SOURCE_DIR}/patches/pybind/detail/internals.h.patch native_dst) # Note: [Why calling some `git` commands before `patch`?] diff --git a/patches/pybind/detail/internals.h.patch b/patches/pybind/detail/internals.h.patch index 7bd1317335950..2cc6566fed35e 100644 --- a/patches/pybind/detail/internals.h.patch +++ b/patches/pybind/detail/internals.h.patch @@ -1,22 +1,19 @@ diff --git a/include/pybind11/detail/internals.h b/include/pybind11/detail/internals.h -index 232bc32d..b6491c11 100644 +index ad2ff74c..bc4731c6 100644 --- a/include/pybind11/detail/internals.h +++ b/include/pybind11/detail/internals.h -@@ -203,11 +203,18 @@ struct internals { - PyTypeObject *static_property_type; - PyTypeObject *default_metaclass; - PyObject *instance_base; +@@ -120,7 +120,14 @@ public: + } + + private: +#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 8 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wmissing-field-initializers" +#endif - // Unused if PYBIND11_SIMPLE_GIL_MANAGEMENT is defined: - PYBIND11_TLS_KEY_INIT(tstate) - #if PYBIND11_INTERNALS_VERSION > 4 - PYBIND11_TLS_KEY_INIT(loader_life_support_tls_key) - #endif // PYBIND11_INTERNALS_VERSION > 4 + PYBIND11_TLS_KEY_INIT(mutable key_) +#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 8 +# pragma GCC diagnostic pop +#endif - // Unused if PYBIND11_SIMPLE_GIL_MANAGEMENT is defined: - PyInterpreterState *istate = nullptr; \ No newline at end of file + }; + + PYBIND11_NAMESPACE_BEGIN(detail) diff --git a/third_party/pybind b/third_party/pybind index a2e59f0e70654..ed5057ded698e 160000 --- a/third_party/pybind +++ b/third_party/pybind @@ -1 +1 @@ -Subproject commit a2e59f0e7065404b44dfe92a28aca47ba1378dc4 +Subproject commit ed5057ded698e305210269dafa57574ecf964483