Hi All,<br><br>I'm having difficulty replicating this solution on my own platform (Ubuntu quantal i386 under a VMware host, but with real USB wifi radio).<br><br>That is, removing the O2 compile option and recompiling olsrd does not seem to yield a working olsrd for me.  I'm presently trying this out on a real host instead (i.e. no virtualization), but that is slowly opening a delightful can of worms w/r/t/ to thge newer Ubuntus dropping legacy video driver support and other such pleasantness.<br>
<br>If the problem's source has been conclusively narrowed down to the -O2 (and even -fPIE?) flag added by Hans' patch 310-hardening-fixes.patch, could Hans just release an updated olsrd package in his PPA, with those flags removed, as an interim workaround for anyone not able to compile their own?<br>
<br><div class="gmail_quote">On Sat, Mar 9, 2013 at 12:34 PM, Mikael Nordfeldth <span dir="ltr"><<a href="mailto:mmn@hethane.se" target="_blank">mmn@hethane.se</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2013-03-08 19:27, Hans-Christoph Steiner skrev:<br>
<div class="im">> That would be quite useful if you have the time!  Another thing that might the<br>
> whole process easier is to 'git bisect', if you are familiar with that..<br>
> Right now, Debian squeeze and wheezy have 0.6.2, and Ubuntu has 0.6.1 and 0.6.3:<br>
><br>
> <a href="http://packages.debian.org/search?keywords=olsrd" target="_blank">http://packages.debian.org/search?keywords=olsrd</a><br>
> <a href="http://packages.ubuntu.com/search?keywords=olsrd" target="_blank">http://packages.ubuntu.com/search?keywords=olsrd</a><br>
><br>
> So the idea is to find out which version of these we can rely on, and which we<br>
> need to use replacements.<br>
<br>
</div>Gah. This seems way more advanced than what I can explain with my<br>
knowledge. Nevertheless, I did find what caused my error, the -O2 gcc<br>
optimization switch as patched by Debian package "hardening fixes":<br>
<br>
1. I tried compiling various olsrd versions. All worked.<br>
2. I tried compiling 0.6.3-5~quantal from 'apt-get source'. It didn't work.<br>
3. I tried compiling the 0.6.3.orig source (same as above, without<br>
debian patches) It worked.<br>
4. None of the patches contained any networking code (except the json<br>
plugin, but disabling it didn't have any effect anyway)<br>
5. I found that removing the -O2 switch on line 227 in Makefile.inc, as<br>
patched by 310-hardening-fixes.patch resolved my invalid argument<br>
sendto(v4) issue:<br>
<br>
 %.o: %.c<br>
        @echo "[CC] $<"<br>
-       $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<<br>
+       $(CC) -O2 $(CFLAGS) $(CPPFLAGS) -fPIE -c -o $@ $<<br>
<br>
<br>
Reverting this (and even leaving the -fPIE there but removing -O2) makes<br>
the resulting binary functional.<br>
<br>
<br>
So the specific problem was caused by the -O2 parameter to gcc, I guess<br>
making it a compiling/linking issue. I don't know enough about this<br>
myself though, so I'm attaching ('O2-opts') the output of what that<br>
level of optimizations means if anyone is interested (gcc -c -Q -O2<br>
--help=optimizers)<br>
<br>
More info on my build environment is below:<br>
<br>
$ gcc -v<br>
Using built-in specs.<br>
COLLECT_GCC=gcc<br>
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper<br>
Target: x86_64-linux-gnu<br>
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro<br>
4.7.2-2ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs<br>
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr<br>
--program-suffix=-4.7 --enable-shared --enable-linker-build-id<br>
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext<br>
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7<br>
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu<br>
--enable-libstdcxx-debug --enable-libstdcxx-time=yes<br>
--enable-gnu-unique-object --enable-plugin --enable-objc-gc<br>
--disable-werror --with-arch-32=i686 --with-tune=generic<br>
--enable-checking=release --build=x86_64-linux-gnu<br>
--host=x86_64-linux-gnu --target=x86_64-linux-gnu<br>
Thread model: posix<br>
gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1)<br>
<br>
<br>
$ uname -a<br>
Linux plexi 3.5.0-25-generic #39-Ubuntu SMP Mon Feb 25 18:26:58 UTC 2013<br>
x86_64 x86_64 x86_64 GNU/Linux<br>
<br>_______________________________________________<br>
Commotion-dev mailing list<br>
<a href="mailto:Commotion-dev@lists.chambana.net">Commotion-dev@lists.chambana.net</a><br>
<a href="https://lists.chambana.net/mailman/listinfo/commotion-dev" target="_blank">https://lists.chambana.net/mailman/listinfo/commotion-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Ben West<div><a href="http://gowasabi.net" target="_blank">http://gowasabi.net</a><br><a href="mailto:ben@gowasabi.net" target="_blank">ben@gowasabi.net</a><br>314-246-9434<br>
</div>