rgommers commented on PR #41872: URL: https://github.com/apache/arrow/pull/41872#issuecomment-2276282541
> I think it would be good to add for Python wheels. It does make the wheel a bit smaller, supposedly has runtime performance benefits, and I see SciPy / NumPy use hidden symbol visibility, at least with GNU compilers. Yes indeed. We use it also with Clang on macOS, and with any other compilers that support the `-fvisibility=hidden` (C) and `-fvisibility-inlines-hidden` (C++) flags. In addition, we use a linker script to hide all symbols except `PyInit_*` from extension modules: https://github.com/scipy/scipy/blob/76bf366486b0583dca789823878b80d610eb571b/meson.build#L131-L143 And there's a [script to check the hiding is complete](https://github.com/scipy/scipy/blob/main/tools/check_pyext_symbol_hiding.sh) that we run in CI. We originally started doing that after we got bug reports of symbol clashes for embedding use cases (https://github.com/scipy/scipy/pull/8451), and then expanded it for robustness and binary size reasons after we switched to Meson. Binary size gain is nice, but the robustness is even more important - symbol clashes are rare, but also very painful to resolve (IIRC we had one with GDAL in conda-forge right before we improved the hiding with Meson). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
