diff -r e281a57d5b29 setup.py --- a/setup.py Tue Apr 19 08:53:14 2016 +0200 +++ b/setup.py Tue Apr 19 09:53:10 2016 +0200 @@ -620,7 +620,10 @@ # time operations and variables exts.append( Extension('time', ['timemodule.c'], libraries=time_libs) ) - exts.append( Extension('_datetime', ['_datetimemodule.c']) ) + # math_libs is needed by delta_new() that uses round() and by accum() + # that uses modf(). + exts.append( Extension('_datetime', ['_datetimemodule.c'], + libraries=math_libs) ) # random number generator implemented in C exts.append( Extension("_random", ["_randommodule.c"]) ) # bisect @@ -695,7 +698,10 @@ # Operations on audio samples # According to #993173, this one should actually work fine on # 64-bit platforms. - exts.append( Extension('audioop', ['audioop.c']) ) + + # audioop needs math_libs for floor() in multiple functions. + exts.append( Extension('audioop', ['audioop.c'], + libraries=math_libs) ) # readline do_readline = self.compiler.find_library_file(lib_dirs, 'readline') @@ -1967,8 +1973,10 @@ libraries=[], sources=sources, depends=depends) + # function my_sqrt() needs math library for sqrt() ext_test = Extension('_ctypes_test', - sources=['_ctypes/_ctypes_test.c']) + sources=['_ctypes/_ctypes_test.c'], + libraries=['m'] if host_platform != 'darwin' else []) self.extensions.extend([ext, ext_test]) if not '--with-system-ffi' in sysconfig.get_config_var("CONFIG_ARGS"):