From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Apr 8 14:20:02 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 922FF106577A for ; Wed, 8 Apr 2009 14:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 027358FC1D for ; Wed, 8 Apr 2009 14:20:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n38EK1as001851 for ; Wed, 8 Apr 2009 14:20:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n38EK14K001850; Wed, 8 Apr 2009 14:20:01 GMT (envelope-from gnats) Resent-Date: Wed, 8 Apr 2009 14:20:01 GMT Resent-Message-Id: <200904081420.n38EK14K001850@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Oliver Lehmann Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A864A1065670 for ; 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 ; 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 ; 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 To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/133487: endianess detection wrong in devel/boost X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Oliver Lehmann List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Apr 2009 14:20:03 -0000 >Number: 133487 >Category: ports >Synopsis: endianess detection wrong in devel/boost >Confidential: no >Severity: non-critical >Priority: high >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Apr 08 14:20:01 UTC 2009 >Closed-Date: >Last-Modified: >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 #include #include 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 +# 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: >Unformatted: