10000 BLD: Fix flags added to compiler line for old GCC on MS. · DWesl/numpy@6ffbcb2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6ffbcb2

Browse files
committed
BLD: Fix flags added to compiler line for old GCC on MS.
It may be worth broadening the platform list, since I believe the error this tries to fix is in the MS ABI/CRT rather than in the Cygwin runtime.
1 parent eca1e27 commit 6ffbcb2

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

setup.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,8 @@ def build_a_library(self, build_info, lib_name, libraries):
276276
build_info['extra_compiler_args'] = args
277277
if _is_old_gcc_on_cygwin(self):
278278
args = build_info.get('extra_compiler_args') or []
279-
args.append(
280-
'-fno-asynchronous-unwind-tables '
281-
'-ffixed-xmm16 -ffixed-xmm17 -ffixed-xmm18 -ffixed-xmm19 '
282-
'-ffixed-xmm20 -ffixed-xmm21 -ffixed-xmm22 -ffixed-xmm23 '
283-
'-ffixed-xmm24 -ffixed-xmm25 -ffixed-xmm26 -ffixed-xmm27 '
284-
'-ffixed-xmm28 -ffixed-xmm29 -ffixed-xmm30 -ffixed-xmm31'
285-
)
279+
args.append('-fno-asynchronous-unwind-tables')
280+
args.extend('-ffixed-xmm{0:02d}'.format(i) for i in range(16, 32))
286281
build_info['extra_compiler_args'] = args
287282
build_clib.build_a_library(self, build_info, lib_name, libraries)
288283

@@ -293,13 +288,8 @@ def build_extension(self, ext):
293288
ext.extra_compile_args.append('-std=c99')
294289
if _is_old_gcc_on_cygwin(self):
295290
if '-ffixed-xmm' not in ext.extra_compile_args:
296-
ext.extra_compile_args.append(
297-
'-fno-asynchronous-unwind-tables '
298-
'-ffixed-xmm16 -ffixed-xmm17 -ffixed-xmm18 -ffixed-xmm19 '
299-
'-ffixed-xmm20 -ffixed-xmm21 -ffixed-xmm22 -ffixed-xmm23 '
300-
'-ffixed-xmm24 -ffixed-xmm25 -ffixed-xmm26 -ffixed-xmm27 '
301-
'-ffixed-xmm28 -ffixed-xmm29 -ffixed-xmm30 -ffixed-xmm31'
302-
)
291+
ext.extra_compile_args.append('-fno-asynchronous-unwind-tables')
292+
ext.extra_compile_args.extend('-ffixed-xmm{0:02d}'.format(i) for i in range(16, 32))
303293
build_ext.build_extension(self, ext)
304294
return new_build_clib, new_build_ext
305295

0 commit comments

Comments
 (0)
0