Closed maximpichler closed 8 years ago
@maximpichler which compiler/version is used on OpenBSD?
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.10.3
@maximpichler sorry, I meant the c compiler. This is about the __builtin_bswap32
C compiler primitives missing even though the compiler seems to claim to be GCC-compatible...
$ gcc --version
gcc (GCC) 4.2.1 20070719
Yeah, so GCC 4.3 was when __builtin_bswap32
was added (and also when GCC moved to GPLv3), so we're a bit stuck there (I imagine that's part of the reason OpenBSD has not upgraded - aside from the fact they have their own forked modifications). Sigh.
That's strange... when searching for __builtin_bswap32
you rather find evidence that __builtin_bswap32
was added starting with GCC >= 4.2 rather than >= 4.3:
That being said, we can just tighten the version-check to check for >= 4.3
instead and call it a day :-)
The manuals suggest otherwise: https://gcc.gnu.org/onlinedocs/gcc-4.2.4/gcc/Keyword-Index.html mentions __builtin_bswap32, wheras https://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Keyword-Index.html doesn't.
Thanks for the swift fix and release!
When linking against cryptohash-sha256-0.11.100.0 (e.g. when building cabal-install) on OpenBSD, the following error occurs:
Looks like __builtin_bswap32 doesn't exist on OpenBSD (but l32toh might be an alternative): http://man.openbsd.org/OpenBSD-5.9/man3/be16toh.3