File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -586,11 +586,15 @@ pybuilddir.txt: $(BUILDPYTHON)
586586 exit 1 ; \
587587 fi
588588
589+ # This is shared by the math and cmath modules
590+ Modules/_math.o: Modules/_math.c Modules/_math.h
591+ $(CC) -c $(CCSHARED) $(PY_CORE_CFLAGS) -o $@ $<
592+
589593# Build the shared modules
590594# Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for
591595# -s, --silent or --quiet is always the first char.
592596# Under BSD make, MAKEFLAGS might be " -s -v x=y".
593- sharedmods: $(BUILDPYTHON) pybuilddir.txt
597+ sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
594598 @case "$$MAKEFLAGS" in \
595599 *\ -s*|s*) quiet="-q";; \
596600 *) quiet="";; \
Original file line number Diff line number Diff line change @@ -671,6 +671,10 @@ Build
671671- Issue #24986: It is now possible to build Python on Windows without errors
672672 when external libraries are not available.
673673
674+ - Issue #24421: Compile Modules/_math.c once, before building extensions.
675+ Previously it could fail to compile properly if the math and cmath builds
676+ were concurrent.
677+
674678- Issue #25798: Update OS X 10.5 installer to use OpenSSL 1.0.2e.
675679
676680Windows
Original file line number Diff line number Diff line change @@ -582,13 +582,17 @@ def detect_modules(self):
582582
583583 # array objects
584584 exts .append ( Extension ('array' , ['arraymodule.c' ]) )
585+
586+ shared_math = 'Modules/_math.o'
585587 # complex math library functions
586- exts .append ( Extension ('cmath' , ['cmathmodule.c' , '_math.c' ],
587- depends = ['_math.h' ],
588+ exts .append ( Extension ('cmath' , ['cmathmodule.c' ],
589+ extra_objects = [shared_math ],
590+ depends = ['_math.h' , shared_math ],
588591 libraries = math_libs ) )
589592 # math library functions, e.g. sin()
590- exts .append ( Extension ('math' , ['mathmodule.c' , '_math.c' ],
591- depends = ['_math.h' ],
593+ exts .append ( Extension ('math' , ['mathmodule.c' ],
594+ extra_objects = [shared_math ],
595+ depends = ['_math.h' , shared_math ],
592596 libraries = math_libs ) )
593597
594598 # time libraries: librt may be needed for clock_gettime()
You can’t perform that action at this time.
0 commit comments