<div dir="ltr">Dear all,<br><br>> @fixeria: re the C compiler used on the FreeBSD build slave:<br>> it is actually, apparently:<br>><br>> FreeBSD clang version 3.4.1<br>> 20140512<br>> x86_64-unknown-freebsd10.3<br>><br>> At least that's what a libosmocore ./configure step shows in<br>> its config.log.<br><br>I would like to start a little discussion about FreeBSD build<br>slave. As it turned out, every new commit is being checked on<br>clang compiler too! It was a bit unexpectedly to me, because<br>we already discussed about this in Gerrit:<br><br><a href="https://gerrit.osmocom.org/#/c/2100/">https://gerrit.osmocom.org/#/c/2100/</a><br><br>> Max:<br>> > Do we officially support anything besides gcc?<br>> <br>> Harald:<br>> > not really, but then it is also nice to be portable. My vote<br>> > would be to merge the current patch under discussion, but open<br>> > a ticket as a reminder that this should be made more portable.<br>> > I suppose mplayer/ffmpeg/fftw or other libs with heavily<br>> > optimized algorithms also have a solution to that.<br><br>Recently I decided to dig into FreeBSD's world, because one of my<br>changes in Gerrit does build fine on Debian slave, but doesn't on<br>FreeBSD. So, I spent a whole night with my laptop and finally<br>installed and configured FreeBSD first time in my experience.<br><br><a href="https://gerrit.osmocom.org/#/c/2100/">https://gerrit.osmocom.org/#/c/2100/</a><br><br>I am running 11.0 STABLE, and by default it comes with clang as<br>default compiler. There is no GCC installed by default. I tried<br>to build my change with different versions of clang and found the<br>following interesting facts:<br><br> - Recent clang-4.0 does support the __builtin_cpu_supports call,<br>   so runtime CPU detection should work in this case too. I don't<br>   know if it works in other versions. So, I suggest to add a new<br>   <a href="http://configure.ac">configure.ac</a> task, which would check whether compiler supports<br>   this call or not.<br><br> - Regarding to my change, it builds fine on several tested clang<br>   versions: clang-3.4.2, clang-3.9, clang-4.0. And I see two<br>   possible reasons, why the build fails on FreeBSD:<br><br>     1) Version 3.4.1 is pretty dated, and we cat try to upgrade it.<br>     2) Clang compiles the source code in a different way, when some<br>        SIMD flags are provided. But target CPU doesn't support some<br>        of provided SIMD flags. Now in both OsmoTRX and libosmocore<br>        we only check whether compiler supports some SIMD flags, but<br>        we don't check whether these flags are supported by current<br>        build machine CPU. So, lack of the last check and specific<br>        optimization / compilation way of clang may cause the fail.<br>        I still need to know supported SIMD features of FreeBSD<br>        build machine to confirm or refute this assumption.<br><br>I also have an idea: what if we could build our projects with several<br>compilers (GCC and clang) and with their several versions (the three<br>latest for example) on Jenkins at the same time? I think, it would be<br>great to keep our projects as portable as possible.<br><br>With best regards,<br>Vadim Yanitskiy.<br></div>