This isn't about me being the swig expert :) This is about the fact that I don't think cstddef is an available header in older installations of linux. If someone has access to rhel5 or ubuntu 8.04, it'd be worth checking those. If we've actually advanced our compiler requirement to GCC 4.3, then we should say so.
If the older versions have it or it's not necessary, then great, but if they are necessary, it's easy enough to add a conf.CheckHeader for cstddef in the SConstruct file. That would create conf/has_cstddef.hh which you could include and then use an #if HAS_CSTDDEF to wrap the #include. Nate On Sun, Nov 27, 2011 at 6:47 PM, Gabe Black <[email protected]> wrote: > This is an automatically generated e-mail. To reply, visit: > http://reviews.m5sim.org/r/913/ > > On November 27th, 2011, 4:18 p.m., *Nathan Binkert* wrote: > > I don't think cstddef exists on older machines which is why we include > inttypes.h. Perhaps we need to add something to swig to find out if it > exists so you can stick an #ifdef around this include. > > You're the resident SWIG expert so I'm fine with it getting fixed however > you think is best. We should fix it relatively soon, though, since I think > this may have been what some people on the mailing list were running into. > > > - Gabe > > On November 27th, 2011, 2:19 a.m., Gabe Black wrote: > Review request for Default, Ali Saidi, Gabe Black, Steve Reinhardt, and > Nathan Binkert. > By Gabe Black. > > *Updated 2011-11-27 02:19:23* > Description > > SWIG/base: Ensure that ptrdiff_t is available for SWIG by including cstddef. > > SWIG happily uses ptrdiff_t without including the file that defines it > explicitly. Certain newer versions of gcc apparently changed how that file > would be included transitively, so SWIG generated files may fail to build with > those gccs. This problem was supposedly solved with SWIG 2.0.3, I think, but > it seems to still exist in other places. I'm fixing it now because it was > triggered by the new fault injection code which was added somewhat recently. > Rather than counting on SWIG to do the right thing, I'm including cstddef in > base/types.hh so that it's more likely to get picked up in the right places. > This fixes the immediate problem but isn't a foolproof solution. > > Diffs > > - src/base/types.hh (c226cd1e5e5e) > > View Diff <http://reviews.m5sim.org/r/913/diff/> > _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
