[gnome-ostree] build: Set explicit CFLAGS/CXXFLAGS for target architecture



commit a31e921c1c737370b4e9a397ac512fdccc943536
Author: Colin Walters <walters verbum org>
Date:   Thu Nov 15 17:31:04 2012 -0500

    build: Set explicit CFLAGS/CXXFLAGS for target architecture
    
    Otherwise we're taking the default gcc tune, which may not be
    what we want.
    
    These values happen to match that of redhat-rpm-config from Fedora 17.

 src/ostbuild/pyostbuild/builtin_build.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/ostbuild/pyostbuild/builtin_build.py b/src/ostbuild/pyostbuild/builtin_build.py
index fd72d34..289000a 100755
--- a/src/ostbuild/pyostbuild/builtin_build.py
+++ b/src/ostbuild/pyostbuild/builtin_build.py
@@ -36,6 +36,9 @@ from . import snapshot
 from . import odict
 from . import vcs
 
+OPT_COMMON_CFLAGS = {'i686': '-O2 -g -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables',
+                     'x86_64': '-O2 -g -m64 -mtune=generic'}
+
 class BuildOptions(object):
     pass
 
@@ -339,6 +342,8 @@ class OstbuildBuild(builtins.Builtin):
                            '--ostbuild-meta=_ostbuild-meta.json'])
         env_copy = dict(buildutil.BUILD_ENV)
         env_copy['PWD'] = chroot_sourcedir
+        env_copy['CFLAGS'] = OPT_COMMON_CFLAGS[architecture]
+        env_copy['CXXFLAGS'] = OPT_COMMON_CFLAGS[architecture]
 
         success = run_sync(child_args, stdout=t.logfile_stream,
                            stderr=t.logfile_stream, env=env_copy,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]