From 63d096ddabc430ede485bc5fb8ce11bb78cb8afa Mon Sep 17 00:00:00 2001 From: Martin Panter Date: Wed, 3 Feb 2016 05:19:44 +0000 Subject: Issue #24421: Compile _math.c separately to avoid race condition --- setup.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 3ebc3deb82..de6e5ad8dc 100644 --- a/setup.py +++ b/setup.py @@ -598,13 +598,17 @@ class PyBuildExt(build_ext): # array objects exts.append( Extension('array', ['arraymodule.c']) ) + + shared_math = 'Modules/_math.o' # complex math library functions - exts.append( Extension('cmath', ['cmathmodule.c', '_math.c'], - depends=['_math.h'], + exts.append( Extension('cmath', ['cmathmodule.c'], + extra_objects=[shared_math], + depends=['_math.h', shared_math], libraries=math_libs) ) # math library functions, e.g. sin() - exts.append( Extension('math', ['mathmodule.c', '_math.c'], - depends=['_math.h'], + exts.append( Extension('math', ['mathmodule.c'], + extra_objects=[shared_math], + depends=['_math.h', shared_math], libraries=math_libs) ) # time libraries: librt may be needed for clock_gettime() -- cgit v1.2.1