From owner-freebsd-ports@FreeBSD.ORG Wed Sep 24 18:57:29 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EC0AF2F for ; Wed, 24 Sep 2014 18:57:29 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB50AB97 for ; Wed, 24 Sep 2014 18:57:27 +0000 (UTC) Received: from mandree.no-ip.org ([78.48.23.0]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MBrCt-1XONJ20Arf-00ApHB; Wed, 24 Sep 2014 20:57:19 +0200 Received: from [IPv6:::1] (localhost6.localdomain6 [IPv6:::1]) by apollo.emma.line.org (Postfix) with ESMTP id D08B623D30C; Wed, 24 Sep 2014 20:57:17 +0200 (CEST) Message-ID: <5423140D.8080005@gmx.de> Date: Wed, 24 Sep 2014 20:57:17 +0200 From: Matthias Andree User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 MIME-Version: 1.0 To: freebsd-ports@freebsd.org Subject: Re: Need help compiling use of std::vector References: <5422DD61.4030808@ShaneWare.Biz> In-Reply-To: <5422DD61.4030808@ShaneWare.Biz> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:J63TLj+rRMXagPgwvXCyOL/rlkg0W7eFLdFk51w5VCF5vAJKTyX BrpNTuSz7IoMm2L/2qemMdZe1gWhWxSd9IlC8ZGKFa4+vEcHVikGmtWfnWgaGDLSP7ZO2sH 5B5DL0phSJ3q1eXCjRAdJnSJMpKBFdUsAk4ZIbQhKDnvcGfN2AUiuq45mejShAPiTgbn0Qq OGF+960ZasTUsE7UHNQEg== X-UI-Out-Filterresults: notjunk:1; Cc: Konstantin Belousov X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2014 18:57:29 -0000 Am 24.09.2014 um 17:04 schrieb Shane Ambler: > I am trying to compile the new version of a port I maintain and have > trouble related to std::vector. The code producing the error can be > boiled down to the following test case, which compiles as 64bit but > fails as 32bit. > > #include > #include > > int main(int argc, char *argv[]) > { > int num_layers = 3; > std::vector layers (num_layers, NULL); > > exit(0); > } > > So that should create a vector containing 3 items initially set to NULL. > > 10.0 compiles ok - both 32 and 64 bit. (libc++) > 8.4, 9.2 and 9.3 compiles 64bit but fails on 32bit. (libstdc++) > > Using the above code > clang++ -m32 test.cpp > fails with > > /usr/include/c++/4.2/bits/stl_algobase.h:641:15: error: assigning to > 'const char *' from incompatible type 'const int' I don't think "-m32" compilation has ever worked properly for C++ on the older FreeBSD releases, where older includes 9.3. You're probably better off trying to build with 32-bit chroots or jails on your 64-bit host, like poudriere or Tinderbox are doing (but I'm not sure if they support setting up 32-bit jails on 64-bit computers). See here so it's a long-standing thing, and for "recent" developments: -so that would have been for 10-CURRENT at the time, and hints that the headers weren't pure enough for -m32 and similar tricks. I am not aware that this effort was ever MFH'd. I am Cc'ing Konstantin Belousov in case he wants to shed more light on this issue. HTH