FreeBSD C compiler version

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

Vadim Yanitskiy axilirator at gmail.com
Sat May 6 13:13:51 UTC 2017


Dear all,

> @fixeria: re the C compiler used on the FreeBSD build slave:
> it is actually, apparently:
>
> FreeBSD clang version 3.4.1
> 20140512
> x86_64-unknown-freebsd10.3
>
> At least that's what a libosmocore ./configure step shows in
> its config.log.

I would like to start a little discussion about FreeBSD build
slave. As it turned out, every new commit is being checked on
clang compiler too! It was a bit unexpectedly to me, because
we already discussed about this in Gerrit:

https://gerrit.osmocom.org/#/c/2100/

> Max:
> > Do we officially support anything besides gcc?
>
> Harald:
> > not really, but then it is also nice to be portable. My vote
> > would be to merge the current patch under discussion, but open
> > a ticket as a reminder that this should be made more portable.
> > I suppose mplayer/ffmpeg/fftw or other libs with heavily
> > optimized algorithms also have a solution to that.

Recently I decided to dig into FreeBSD's world, because one of my
changes in Gerrit does build fine on Debian slave, but doesn't on
FreeBSD. So, I spent a whole night with my laptop and finally
installed and configured FreeBSD first time in my experience.

https://gerrit.osmocom.org/#/c/2100/

I am running 11.0 STABLE, and by default it comes with clang as
default compiler. There is no GCC installed by default. I tried
to build my change with different versions of clang and found the
following interesting facts:

 - Recent clang-4.0 does support the __builtin_cpu_supports call,
   so runtime CPU detection should work in this case too. I don't
   know if it works in other versions. So, I suggest to add a new
   configure.ac task, which would check whether compiler supports
   this call or not.

 - Regarding to my change, it builds fine on several tested clang
   versions: clang-3.4.2, clang-3.9, clang-4.0. And I see two
   possible reasons, why the build fails on FreeBSD:

     1) Version 3.4.1 is pretty dated, and we cat try to upgrade it.
     2) Clang compiles the source code in a different way, when some
        SIMD flags are provided. But target CPU doesn't support some
        of provided SIMD flags. Now in both OsmoTRX and libosmocore
        we only check whether compiler supports some SIMD flags, but
        we don't check whether these flags are supported by current
        build machine CPU. So, lack of the last check and specific
        optimization / compilation way of clang may cause the fail.
        I still need to know supported SIMD features of FreeBSD
        build machine to confirm or refute this assumption.

I also have an idea: what if we could build our projects with several
compilers (GCC and clang) and with their several versions (the three
latest for example) on Jenkins at the same time? I think, it would be
great to keep our projects as portable as possible.

With best regards,
Vadim Yanitskiy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/openbsc/attachments/20170506/c38fdef9/attachment.htm>


More information about the OpenBSC mailing list