The endianess detection in boost/detail/endian.hpp is not working for FreeBSD because on FreeBSD _BIG_ENDIAN and _LITTLE_ENDIAN is defined all the time. If _GLIBC_ is not defined, the hpp file checks first if _BIG_ENDIAN is defined and this is the case the endianess for boost is set to BIG_ENDIAN and the check ends. The hpp file should check if _BYTE_ORDER is defined for FreeBSD and how it is defined (See Fix section) How-To-Repeat: create the following C file: #include <stdio.h> #include <machine/endian.h> #include <boost/detail/endian.hpp> int main() { printf("%d\n",BOOST_BYTE_ORDER); } and compile it with cc -I/usr/local/include cfile Execute now a.out and you'll get always 4321
Maintainer of devel/boost, Please note that PR ports/133487 has just been submitted. If it contains a patch for an upgrade, an enhancement or a bug fix you agree on, reply to this email stating that you approve the patch and a committer will take care of it. The full text of the PR can be found at: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/133487 -- Edwin Groothuis via the GNATS Auto Assign Tool edwin@FreeBSD.org
State Changed From-To: open->feedback Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Resolution: Suggest applying this patch and keeping it until updating to boost-1.38. Analysis: The root cause of the issue is boost matching endianess using method of GNU libc, which is not compatible with the way BSDs define endianess. They've fixed this in 1.38 by applying a patch from NetBSD. See https://svn.boost.org/trac/boost/ticket/1922 for details. Future directions: The fix applied in 1.38 is to match against CPU architecture if matching using GNU method fails. This may re-introduce bugs for platforms, not specifically listed in boost header file. Suggest proposing the patch, attached to this issue, for permanent inclusion into boost libraries. Alexander Churanov, maintainer of devel/boost
Responsible Changed From-To: freebsd-ports-bugs->lwhsu I'll take it.
State Changed From-To: feedback->closed Committed. Thanks!
lwhsu 2009-05-12 10:36:22 UTC FreeBSD ports repository Modified files: devel/boost Makefile Added files: devel/boost/files patch-boost__detail__endian.hpp Log: - Add a patch to fix endianess detection PR: ports/133487 Submitted by: Oliver Lehmann <lehmann AT ans-netz.de> Approved by: Alexander Churanov <alexanderchuranov AT gmail.com> (maintainer) Revision Changes Path 1.45 +1 -0 ports/devel/boost/Makefile 1.1 +21 -0 ports/devel/boost/files/patch-boost__detail__endian.hpp (new) _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"