File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -35,11 +35,11 @@ def get_safe_linker_flags(module_name, build_dir):
3535 flags .append ("-Clink-arg=-Wl,--exclude-libs,ALL" )
3636
3737 elif sys .platform == "darwin" :
38- # macOS Export List
39- # Note: macOS symbols in the linker often have a leading underscore.
40- # We use -undefined dynamic_lookup to allow linking against Python symbols
38+ # macOS symbols in the linker often have a leading underscore, but rustc
39+ # already generates an exported_symbols_list for cdylib targets, so we must
40+ # NOT use -exported_symbol here as it will conflict.
41+ # We only need -undefined dynamic_lookup to allow linking against Python symbols
4142 # provided at runtime.
4243 flags .append ("-Clink-arg=-Wl,-undefined,dynamic_lookup" )
43- flags .append (f"-Clink-arg=-Wl,-exported_symbol,_PyInit_{ module_name } " )
4444
4545 return flags
You can’t perform that action at this time.
0 commit comments