-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[mlir][python] declare _PyClassMethod_New
undefined at link time
#121597
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
Conversation
@llvm/pr-subscribers-mlir Author: Maksim Levental (makslevental) Changes
See iree-org/iree#19591 (comment). Full diff: https://github.com/llvm/llvm-project/pull/121597.diff 1 Files Affected:
diff --git a/mlir/cmake/modules/AddMLIRPython.cmake b/mlir/cmake/modules/AddMLIRPython.cmake
index 9d4e06c7909c81..2bcabab6f9c5e3 100644
--- a/mlir/cmake/modules/AddMLIRPython.cmake
+++ b/mlir/cmake/modules/AddMLIRPython.cmake
@@ -686,6 +686,12 @@ function(add_mlir_python_extension libname extname)
endif()
target_compile_options(${libname} PRIVATE ${eh_rtti_enable})
+ if(APPLE)
+ # NanobindAdaptors.h uses PyClassMethod_New to build `pure_subclass`es but nanobind
+ # doesn't declare this API as undefined in its linker flags. so we need to declare it as such
+ # for downstream users that do not do something like -undefined dynamic_lookup
+ set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-U -Wl,_PyClassMethod_New")
+ endif()
# Configure the output to match python expectations.
set_target_properties(
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/143/builds/4553 Here is the relevant piece of the build log for the reference
|
NanobindAdaptors.h
usesPyClassMethod_New
to buildpure_subclass
es but nanobind doesn't declare this API as undefined in its linker flags. So we need to declare it as such for downstream users that do not do something like-undefined dynamic_lookup
See iree-org/iree#19591 (comment).