This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients ammar2, cstratak, hroncok, methane, pablogsal, serhiy.storchaka, vstinner
Date 2019-12-19.15:15:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> I have seen people using LD_PRELOAD (...) to interpose faster versions of some functions or to collect metrics (although there are better ways).

IMHO if someone has to go so far into "hacking" Python, they should recompile Python with specific options. I'm not sure that using LD_PRELOAD to get "faster versions of some functions" is the best approach in term of performance, but I expect it to be convenient :-)

> I think it will add to the complexity of the --with-optimizations flag which already implies PGO and LTO.

It doesn't enable LTO, only PGO :-) We had to disable LTO because of multiple compiler bugs last years.

> I am sure some C API functions are purposed to be overridden.

Is it a theorical use case, or are you aware of such use case being currently used in the wild?

Ammar Askar:
> Just for a quick datapoint: llvm/clang do this by default and you need an explicit `-fsemantic-interposition` to disable it

Oh, that's really interesting, thanks!
Date User Action Args
2019-12-19 15:15:21vstinnersetrecipients: + vstinner, methane, serhiy.storchaka, cstratak, ammar2, hroncok, pablogsal
2019-12-19 15:15:21vstinnersetmessageid: <>
2019-12-19 15:15:21vstinnerlinkissue38980 messages
2019-12-19 15:15:21vstinnercreate