mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #24421: Compile _math.c separately to avoid race condition
This commit is contained in:
parent
a63897164e
commit
c9deece272
3 changed files with 17 additions and 5 deletions
|
@ -586,11 +586,15 @@ pybuilddir.txt: $(BUILDPYTHON)
|
||||||
exit 1 ; \
|
exit 1 ; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# This is shared by the math and cmath modules
|
||||||
|
Modules/_math.o: Modules/_math.c Modules/_math.h
|
||||||
|
$(CC) -c $(CCSHARED) $(PY_CORE_CFLAGS) -o $@ $<
|
||||||
|
|
||||||
# Build the shared modules
|
# Build the shared modules
|
||||||
# Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for
|
# Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for
|
||||||
# -s, --silent or --quiet is always the first char.
|
# -s, --silent or --quiet is always the first char.
|
||||||
# Under BSD make, MAKEFLAGS might be " -s -v x=y".
|
# Under BSD make, MAKEFLAGS might be " -s -v x=y".
|
||||||
sharedmods: $(BUILDPYTHON) pybuilddir.txt
|
sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
|
||||||
@case "$$MAKEFLAGS" in \
|
@case "$$MAKEFLAGS" in \
|
||||||
*\ -s*|s*) quiet="-q";; \
|
*\ -s*|s*) quiet="-q";; \
|
||||||
*) quiet="";; \
|
*) quiet="";; \
|
||||||
|
|
|
@ -671,6 +671,10 @@ Build
|
||||||
- Issue #24986: It is now possible to build Python on Windows without errors
|
- Issue #24986: It is now possible to build Python on Windows without errors
|
||||||
when external libraries are not available.
|
when external libraries are not available.
|
||||||
|
|
||||||
|
- Issue #24421: Compile Modules/_math.c once, before building extensions.
|
||||||
|
Previously it could fail to compile properly if the math and cmath builds
|
||||||
|
were concurrent.
|
||||||
|
|
||||||
- Issue #25798: Update OS X 10.5 installer to use OpenSSL 1.0.2e.
|
- Issue #25798: Update OS X 10.5 installer to use OpenSSL 1.0.2e.
|
||||||
|
|
||||||
Windows
|
Windows
|
||||||
|
|
12
setup.py
12
setup.py
|
@ -582,13 +582,17 @@ class PyBuildExt(build_ext):
|
||||||
|
|
||||||
# array objects
|
# array objects
|
||||||
exts.append( Extension('array', ['arraymodule.c']) )
|
exts.append( Extension('array', ['arraymodule.c']) )
|
||||||
|
|
||||||
|
shared_math = 'Modules/_math.o'
|
||||||
# complex math library functions
|
# complex math library functions
|
||||||
exts.append( Extension('cmath', ['cmathmodule.c', '_math.c'],
|
exts.append( Extension('cmath', ['cmathmodule.c'],
|
||||||
depends=['_math.h'],
|
extra_objects=[shared_math],
|
||||||
|
depends=['_math.h', shared_math],
|
||||||
libraries=math_libs) )
|
libraries=math_libs) )
|
||||||
# math library functions, e.g. sin()
|
# math library functions, e.g. sin()
|
||||||
exts.append( Extension('math', ['mathmodule.c', '_math.c'],
|
exts.append( Extension('math', ['mathmodule.c'],
|
||||||
depends=['_math.h'],
|
extra_objects=[shared_math],
|
||||||
|
depends=['_math.h', shared_math],
|
||||||
libraries=math_libs) )
|
libraries=math_libs) )
|
||||||
|
|
||||||
# time libraries: librt may be needed for clock_gettime()
|
# time libraries: librt may be needed for clock_gettime()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue