Commit a126ad0a authored by John Zhang's avatar John Zhang

use environment variable to control C backend clang optmisation level

parent a26065d5
diff --git a/rpython/translator/platform/darwin.py b/rpython/translator/platform/darwin.py
index 628c26a3ed..8827f62493 100644
--- a/rpython/translator/platform/darwin.py
+++ b/rpython/translator/platform/darwin.py
@@ -18,7 +18,7 @@ class Darwin(posix.BasePosix):
shared_only = ()
link_flags = (DARWIN_VERSION_MIN,)
- cflags = ('-O3', '-fomit-frame-pointer', DARWIN_VERSION_MIN)
+ cflags = (os.environ.get('PYPY_C_CLANG_OPT_FLAG', '-O3'), '-fomit-frame-pointer', DARWIN_VERSION_MIN)
so_ext = 'dylib'
DEFAULT_CC = 'clang'
diff --git a/rpython/translator/platform/linux.py b/rpython/translator/platform/linux.py
index 603981b718..52b162428b 100644
--- a/rpython/translator/platform/linux.py
+++ b/rpython/translator/platform/linux.py
@@ -13,7 +13,7 @@ class BaseLinux(BasePosix):
+ os.environ.get('LDFLAGS', '').split())
extra_libs = ('-lrt',)
cflags = tuple(
- ['-O3', '-pthread', '-fomit-frame-pointer',
+ [os.environ.get('PYPY_C_CLANG_OPT_FLAG', '-O3'), '-pthread', '-fomit-frame-pointer',
'-Wall', '-Wno-unused']
+ os.environ.get('CFLAGS', '').split())
standalone_only = ()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment