bpo-45548: Remove _math.c workarounds for pre-C99 libm (GH-29179)

The :mod:`math` and :mod:`cmath` implementation now require a C99 compatible
``libm`` and no longer ship with workarounds for missing acosh, asinh,
expm1, and log1p functions.

The changeset also removes ``_math.c`` and moves the last remaining
workaround into ``_math.h``. This simplifies static builds with
``Modules/Setup`` and resolves symbol conflicts.

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
Co-authored-by: Brett Cannon <brett@python.org>
Signed-off-by: Christian Heimes <christian@python.org>
This commit is contained in:
Christian Heimes 2021-10-25 11:25:27 +03:00 committed by GitHub
parent 51ed2c56a1
commit fa26245a1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 51 additions and 346 deletions

View file

@ -904,18 +904,14 @@ class PyBuildExt(build_ext):
# Context Variables
self.add(Extension('_contextvars', ['_contextvarsmodule.c']))
shared_math = 'Modules/_math.o'
# math library functions, e.g. sin()
self.add(Extension('math', ['mathmodule.c'],
extra_objects=[shared_math],
depends=['_math.h', shared_math],
depends=['_math.h'],
libraries=['m']))
# complex math library functions
self.add(Extension('cmath', ['cmathmodule.c'],
extra_objects=[shared_math],
depends=['_math.h', shared_math],
depends=['_math.h'],
libraries=['m']))
# time libraries: librt may be needed for clock_gettime()