From 199563f825a341f17c09eb3a68b62597db740a46 Mon Sep 17 00:00:00 2001 From: Ralf Schmitt Date: Tue, 31 Jan 2012 20:36:07 +0100 Subject: [PATCH] workaround compiler bug on RHEL 3 / CentOS 3 compile with -Os on RHEL 3 / CentOS 3 see https://github.com/python-greenlet/greenlet/issues/4 --- setup.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 68955dc1..63cecaea 100755 --- a/setup.py +++ b/setup.py @@ -1,10 +1,12 @@ #! /usr/bin/env python -import sys, os, glob +import sys, os, glob, platform -# workaround segfaults on openbsd. see +# workaround segfaults on openbsd and RHEL 3 / CentOS 3 . see # https://bitbucket.org/ambroff/greenlet/issue/11/segfault-on-openbsd-i386 -if sys.platform == "openbsd4" and os.uname()[-1] == "i386": +# https://github.com/python-greenlet/greenlet/issues/4 +if ((sys.platform == "openbsd4" and os.uname()[-1] == "i386") + or ".EL-i686-with-redhat-3." in platform.platform()): os.environ["CFLAGS"] = ("%s %s" % (os.environ.get("CFLAGS", ""), "-Os")).lstrip() try: