ld report warnings with `-undefined dynamic_lookup` in macOs when linking with python
When building codes with pybind11, we noticed that the linker reports below warnings:
[ 95%] Linking CXX shared module test_xxx.cpython-310-darwin.so
ld: warning: -undefined dynamic_lookup may not work with chained fixups
However -undefined dynamic_lookup
is not a linker argument added by me. After some search, I find it is added by CMake in https://gitlab.kitware.com/cmake/cmake/-/blob/master/Modules/FindPython/Support.cmake#L3356 and it seems related to this issue: #18100 (closed).
Generally I would like to avoid using undefined dynamic_lookup
, so is there a way to disable the behavior to add -undefined dynamic_lookup
?