From owner-freebsd-ports@FreeBSD.ORG Tue Apr 29 20:47:01 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 6F898FAA for ; Tue, 29 Apr 2014 20:47:01 +0000 (UTC) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B2E117B1 for ; Tue, 29 Apr 2014 20:47:00 +0000 (UTC) Received: by mail-vc0-f169.google.com with SMTP id im17so1026008vcb.14 for ; Tue, 29 Apr 2014 13:46:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=lAc54Bjw1LCfaI4QYVBuPTDDlsMI1GNgr0ZRuCa7114=; b=l0qip+Jlk1ltxMN/+AEh0bpPZTSIhA2Z1F2jWHl1eygenXFV6uocZC/2b64rTHon/I V33x+ulW6gJ6xHZE0RoUxbc1sJFQl0Qc/7mGkeKtAhFfZnt+yTAIs/Iq7qfzmqaZKqow VDXwXRKu4ob9YG4LguNkLV6pTELy09qt53gmhrVxbZLKc3xfk6+HFNjairMeJH+YKXKZ 7+aGZQvdYoya6VmD3P/V5efoviBg6s4RXvc+Jo+y6+WTr19DabCA9DwsqBWxarrSPRxf cAmyTYlHKHIT1xmkSDcKRwe7DmkPRisVdH5IH3XXh0xtzbKTCnQ/FAyfhrxv85uRQOln cv1g== X-Gm-Message-State: ALoCoQkEqrFvlVAEsNZsGV/+91gLohnSS/3cJKAQV35hnDMPu6P749w6WX2MSbcYYCeoLUfg0CzK X-Received: by 10.52.117.237 with SMTP id kh13mr28651vdb.96.1398803992101; Tue, 29 Apr 2014 13:39:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.178.139 with HTTP; Tue, 29 Apr 2014 13:39:32 -0700 (PDT) X-Originating-IP: [209.74.10.193] In-Reply-To: <20140429100837.73a0f47d@kalimero.tijl.coosemans.org> References: <20140429100837.73a0f47d@kalimero.tijl.coosemans.org> From: Geoff Speicher Date: Tue, 29 Apr 2014 16:39:32 -0400 Message-ID: Subject: Re: USES=compiler:c++11-lib on FreeBSD 8.4 To: Tijl Coosemans Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.17 Cc: gerald@freebsd.org, freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Apr 2014 20:47:01 -0000 On Tue, Apr 29, 2014 at 4:08 AM, Tijl Coosemans wrote: > On Mon, 28 Apr 2014 22:38:55 -0400 Geoff Speicher wrote: > > Not sure if ports is the right place for this post so apologies in > advance > > if I'm not in the right place. > > > > I'm porting an application that requires c++11, and I'm trying to create > > the port on a FreeBSD 8.4 box. From everything I have read, it appears > that > > c++11 is only supported in 9.1+ when world has been built with the c++11 > > toolchain. However, the various ports switches such as > > USES=compiler:c++11-lib don't yield any warnings on 8.4, yet don't seem > to > > work either. Can anyone comment on whether or not this option is supposed > > to work on 8.4? > > > > Taking ports out of the equation for a moment, I can't compile the > > following c++11 file: > > > > // test.cpp > > #include > > #include > > > > int main() { > > int number = 10; > > std::string value; > > value = std::to_string(number); > > } > > // EOF > > > > clang++33 fails on a new c++11 include file: > > > > $ clang++33 -std=c++11 test.cpp > > test.cpp:1:10: fatal error: 'type_traits' file not found > > #include > > ^ > > 1 error generated. > > > > > > g++47 at least finds the include file but doesn't appear to define > > std::to_string as it should: > > > > $ g++47 -std=c++11 test.cpp > > test.cpp: In function 'int main()': > > test.cpp:7:11: error: 'to_string' is not a member of 'std' > > > > I also tried installing devel/libc++ and that fails trying to include > > xlocale.h, which only appears to exist in 9.1 and later. Am I missing > > something here or is c++11 simply not supported on 8.4? Assuming the > > latter, is there a way to automatically make ports fail with a meaningful > > error message on <9.0 when attempting to use c++11-lang or c++11-lib? > > On 8.x one of the gcc ports has to be used if you need a c++11 library, > but it appears that the declarations of to_string in bits/basic_string.h > are hidden behind #ifdef _GLIBCXX_USE_C99 and that macro isn't defined > on FreeBSD because we are missing a few obscure c99 functions. > I think it would be best to patch the gcc ports to force the definition > of that macro. > Thanks for responding. In the meantime, I'll just hack that flag into CXXFLAGS for this port unless you have any other suggestions.