Review Board 2.0.15


SWIG: Make gem5 compile and link with swig 2.0.4

Review Request #941 - Created Dec. 18, 2011 and submitted

Information
Andreas Hansson
gem5
default
Reviewers
Default
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.
util/regress all passing (disregarding t1000 and eio)
Posted (Dec. 19, 2011, 2:54 a.m.)



  
src/SConscript (Diff revision 1)
 
 
Both of these need to be protected bythis if. no-unused-label isn't an option in gcc 4.4 on earlier.
  1. That is very odd. Using gcc 4.2.1 (stock XCode 4.2) I get a warning about an unused "fail" label, and with this switch enabled, the warning is not treated as an error and compilation succeeds. In other words, it most definitely seems to be a recognised option by gcc 4.2.1 on Mac. 
    
    Any ideas?
  2. After some digging...it definitely exists on gcc 4.2.2 (and I also tried gcc 4.1.2 and this also works)
    > gcc -dumpversion
    4.2.2
    > gcc -Werror -Wall -c -o test.o test.cc
    cc1plus: warnings being treated as errors
    test.cc: In function 'int main(int, char**)':
    test.cc:4: warning: label 'label' defined but not used
    > gcc -Werror -Wall -Wno-unused-label -c -o test.o test.cc
    > 
    
  3. Actually, I seem to stand corrected, I could find it mentioned in gcc documentation back to 4.1 (at least the -Wunused-label variant.
    
    Ali
    
Ship it!
Posted (Dec. 21, 2011, 6:33 a.m.)



  
Ship it!
Posted (Jan. 4, 2012, 12:36 p.m.)