Ticket #14460: 14460_gcc_bug.patch

File 14460_gcc_bug.patch, 1.1 KB (added by Jeroen Demeyer, 10 years ago)
  • setup.py

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1366060337 -7200
    # Node ID 693490ad0dd2ea0747ddb4c957ee9869f145ef0f
    # Parent  7bf8686fe09f2a79667c845465a09eee962a3b61
    Work around GCC-4.8.0 bug
    
    diff --git a/setup.py b/setup.py
    a b  
    11#!/usr/bin/env python
    22
    3 import os, sys, time, errno, platform
     3import os, sys, time, errno, platform, subprocess
    44from distutils.core import setup
    55from distutils.extension import Extension
    66from glob import glob, fnmatch
     
    7171if DEVEL:
    7272    extra_compile_args.append('-ggdb')
    7373
     74# Work around GCC-4.8.0 bug which miscompiles some sig_on() statements,
     75# as witnessed by a doctest in sage/libs/gap/element.pyx if the
     76# compiler flag -Og is used. See also
     77# * http://trac.sagemath.org/sage_trac/ticket/14460
     78# * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56982
     79if subprocess.call("""$CC --version | grep -i 'gcc.* 4[.][89]' >/dev/null """, shell=True) == 0:
     80    extra_compile_args.append('-fno-tree-dominator-opts')
     81
    7482# Generate interpreters
    7583
    7684sage.ext.gen_interpreters.rebuild(os.path.join(SAGE_SRC, 'sage', 'ext', 'interpreters'))