From olivleh1@kartoffel.salatschuessel.net  Wed Apr  8 14:15:53 2009
Return-Path: <olivleh1@kartoffel.salatschuessel.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A864A1065670
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  8 Apr 2009 14:15:53 +0000 (UTC)
	(envelope-from olivleh1@kartoffel.salatschuessel.net)
Received: from kartoffel.salatschuessel.net (f048156135.adsl.alicedsl.de [78.48.156.135])
	by mx1.freebsd.org (Postfix) with ESMTP id 208778FC0C
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  8 Apr 2009 14:15:52 +0000 (UTC)
	(envelope-from olivleh1@kartoffel.salatschuessel.net)
Received: from kartoffel.salatschuessel.net (localhost [127.0.0.1])
	by kartoffel.salatschuessel.net (8.14.3/8.14.3) with ESMTP id n38EG3Mp001895
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 8 Apr 2009 16:16:03 +0200 (CEST)
	(envelope-from olivleh1@kartoffel.salatschuessel.net)
Received: (from olivleh1@localhost)
	by kartoffel.salatschuessel.net (8.14.3/8.14.3/Submit) id n38EG2bV001894;
	Wed, 8 Apr 2009 16:16:02 +0200 (CEST)
	(envelope-from olivleh1)
Message-Id: <200904081416.n38EG2bV001894@kartoffel.salatschuessel.net>
Date: Wed, 8 Apr 2009 16:16:02 +0200 (CEST)
From: Oliver Lehmann <lehmann@ans-netz.de>
Reply-To: Oliver Lehmann <lehmann@ans-netz.de>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: endianess detection wrong in devel/boost
X-Send-Pr-Version: 3.113
X-GNATS-Notify: churanov.port.maintainer@gmail.com

>Number:         133487
>Category:       ports
>Synopsis:       endianess detection wrong in devel/boost
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    lwhsu
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Apr 08 14:20:01 UTC 2009
>Closed-Date:    Tue May 12 10:36:34 UTC 2009
>Last-Modified:  Tue May 12 10:40:03 UTC 2009
>Originator:     Oliver Lehmann
>Release:        FreeBSD 7.1-STABLE amd64
>Organization:
>Environment:
System: FreeBSD kartoffel.salatschuessel.net 7.1-STABLE FreeBSD 7.1-STABLE #0: Sun Mar 8 02:58:44 CET 2009 olivleh1@kartoffel.salatschuessel.net:/usr/obj/usr/src/sys/KARTOFFEL amd64


>Description:
	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
>Fix:

--- ./boost/detail/endian.hpp.orig      2009-04-08 16:12:11.000000000 +0200
+++ ./boost/detail/endian.hpp   2009-04-08 16:13:28.000000000 +0200
@@ -42,6 +42,18 @@
 #  error Unknown machine endianness detected.
 # endif
 # define BOOST_BYTE_ORDER __BYTE_ORDER
+#elif defined (__FreeBSD__)
+# include <machine/endian.h>
+# if (_BYTE_ORDER == _LITTLE_ENDIAN)
+#  define BOOST_LITTLE_ENDIAN
+# elif (_BYTE_ORDER == _BIG_ENDIAN)
+#  define BOOST_BIG_ENDIAN
+# elif (_BYTE_ORDER == _PDP_ENDIAN)
+#  define BOOST_PDP_ENDIAN
+# else
+#  error Unknown machine endianness detected.
+# endif
+# define BOOST_BYTE_ORDER _BYTE_ORDER
 #elif defined(_BIG_ENDIAN)
 # define BOOST_BIG_ENDIAN
 # define BOOST_BYTE_ORDER 4321



>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Wed Apr 8 14:20:13 UTC 2009 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=133487 

From: Edwin Groothuis <edwin@FreeBSD.org>
To: churanov.port.maintainer@gmail.com
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/133487: endianess detection wrong in devel/boost
Date: Wed, 8 Apr 2009 14:20:11 UT

 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

From: Alexander Churanov <alexanderchuranov@gmail.com>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: ports/133487: endianess detection wrong in devel/boost
Date: Mon, 27 Apr 2009 17:19:21 +0400

 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 
Responsible-Changed-By: lwhsu 
Responsible-Changed-When: Mon May 11 20:15:40 UTC 2009 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=133487 
State-Changed-From-To: feedback->closed 
State-Changed-By: lwhsu 
State-Changed-When: Tue May 12 10:36:33 UTC 2009 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=133487 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/133487: commit references a PR
Date: Tue, 12 May 2009 10:36:37 +0000 (UTC)

 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"
 
>Unformatted:
