changeset 44203702a57a in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=44203702a57a
description:
        SWIG: Make gem5 compile and link with swig 2.0.4

        To make gem5 compile and run with swig 2.0.4 a few minor fixes are
        necessary, the fail label issues by swig must not be treated as an
        error by gcc (tested with gcc 4.2.1), and the vector wrappers must
        have SWIGPY_SLICE_ARG defined which happens in pycontainer.swg,
        included through std_container.i. By adding the aforementioned include
        to the vector wrappers everything seems to work.

diffstat:

 src/SConscript          |  2 +-
 src/python/m5/params.py |  3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)

diffs (26 lines):

diff -r e4001326a5ba -r 44203702a57a src/SConscript
--- a/src/SConscript    Mon Jan 09 18:08:20 2012 -0600
+++ b/src/SConscript    Mon Jan 09 18:08:20 2012 -0600
@@ -851,8 +851,8 @@
         swig_env.Append(CCFLAGS='-Wno-uninitialized')
         swig_env.Append(CCFLAGS='-Wno-sign-compare')
         swig_env.Append(CCFLAGS='-Wno-parentheses')
+        swig_env.Append(CCFLAGS='-Wno-unused-label')
         if compareVersions(env['GCC_VERSION'], '4.6.0') != -1:
-            swig_env.Append(CCFLAGS='-Wno-unused-label')
             swig_env.Append(CCFLAGS='-Wno-unused-but-set-variable')
 
     werror_env = new_env.Clone()
diff -r e4001326a5ba -r 44203702a57a src/python/m5/params.py
--- a/src/python/m5/params.py   Mon Jan 09 18:08:20 2012 -0600
+++ b/src/python/m5/params.py   Mon Jan 09 18:08:20 2012 -0600
@@ -256,6 +256,9 @@
         self.ptype.cxx_predecls(code)
         code('%}')
         code()
+        # Make sure the SWIGPY_SLICE_ARG is defined through this inclusion
+        code('%include "std_container.i"')
+        code()
         self.ptype.swig_predecls(code)
         code()
         code('%include "std_vector.i"')
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to