From owner-freebsd-ports@freebsd.org Wed May 18 07:31:23 2016 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74FCFB4092A for ; Wed, 18 May 2016 07:31:23 +0000 (UTC) (envelope-from matthias.andree@gmx.de) 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 DEA1C1253; Wed, 18 May 2016 07:31:22 +0000 (UTC) (envelope-from matthias.andree@gmx.de) Received: from mandree.no-ip.org ([78.49.13.133]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0M09Ee-1bqdJl1RpE-00uKeG; Wed, 18 May 2016 09:31:05 +0200 Received: from [IPv6:::1] (localhost6.localdomain6 [IPv6:::1]) by apollo.emma.line.org (Postfix) with ESMTP id 7942E23D274; Wed, 18 May 2016 09:30:41 +0200 (CEST) Subject: Re: Why clang++37 behaves differently on 9.3 and 10.3? To: freebsd-ports@freebsd.org References: <57346A14.6010402@rawbw.com> From: Matthias Andree Cc: yuri@rawbw.com, jbeich@freebsd.org Message-ID: <573C1A20.8070307@gmx.de> Date: Wed, 18 May 2016 09:30:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K0:hsaowmm9wG0ZB756/ZMA7gwBLQcdMsdDBpgH6f69LZItbsiYc+z BkVGeT9WRW+6wBc+mFcBfSgLKTVh7ATNnPaLYtPedD665y3l4BnjAXwWPqp1+GV8XS/9PG6 WyITbSYAPL3xuNeGFT2clq7+lWzp8ZArBwYYUx1GpBZSDkdmjyrKnYcXP+LiIv/2sPc8TkD wDM2PM6HNeDzzEMw0Oi6A== X-UI-Out-Filterresults: notjunk:1;V01:K0:K9yj7JYVEes=:/Q7M7lUU9bHa+FeZbvyOeD 01COk/MYzgAIEqcuQmQtj+V59ksH9I/t4DQLlxBUubUX/i3Q0eZ3dfR5/OGEOnFmX379IAw4x 9s09f6vTdLwu+gvCP0SFqFgMCVSO75rShB86Sn0u/wrs5ktu/4Sh+HwI4wUOFM8iUUgHHfnPr QWlz26evTzUX++SKFmv8ofNpDc7s5Pav53/68Clg23TFVypQlcQXTeBTf2z9MxbjK5/v8r3LF 46T/H0RL90h+D0B1/CNXdoH1BhbhKsVMK0+q+jvV3iweWgmQjW89ezf0GKTTuLZHDM8uZYsvz dGxRUnlxOHC+vIGtHifm8oy3X40FLf1rEpNUbjzXBN7+jgDYgnL9w5JhErNhlPq8pudEg33TZ 5/gzZW+XUTlI+Zom6dNX7ZfxfsLuryIoC9zNLr7CoObQn+DTBQL6UwmoQwsKUDP3r1IjGWa3t x2FqcbynqcY3Ok4J7yzAVu3krhk94iuu8tucKmwxMRPmdpx4fLAdx1iXGcfqIfLOBJZfxgS8B b0OQb/xOu7O15B8znUq1dJWBn1AShCy+V98Nymi8IF5QrCtY9D70UI1kk+bRk3dmw2BIXpjHZ 8YR+Tx0jI7rJC3ty/yT3OO7vynP5v7nVMQATrvURgG8MxhYhuMfV8hbB+GV3CPeVRZNC8i1RH xE3P9NQjPsdZ5gy6jhLPORRtFbj8chhIL80J1PtXEY2rBF2A2YauHi/4lvaOMihK34uNPmA3J PnOAfN/Ov/CsCuOBP+Go7ZJu6Ip5A1pMf5WCjqR2Q0pacYzIAPfZK2Zqc9MeeFJlLfhCAI2yT CHUh5IVuiKAq1GHwAnCNKywXebahw== X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 May 2016 07:31:23 -0000 Am 12.05.2016 um 19:59 schrieb Dimitry Andric: > On 12 May 2016, at 13:33, Yuri wrote: >> >> clang++37 compiles this simple program fine on 10.3, but fails on 9.3. >> >> Why does it behave differently on different OS versions? >> >> It looks like it ignores -std=3Dc++11 on 9.3. >=20 > You cannot compile for C++11 on a 9.x installation, because clang will > use libstdc++ by default there, and the version of libstdc++ in the > 9.x base system is not C++11 compatible. >=20 > To be able to use C++11, you must install libc++ first, using for > example: [...] > On FreeBSD 10.x, clang and libc++ are the defaults, and C++11 can be > used out of the box. [...] (Not meaning to pollute bugzilla yet, hence by mail -- feel free to upload whichever portions of this to the PR that you feel like, unless you contort the context. Everyone be aware of Jan's CPPFLAGS hints in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D209467#c5 that rawtherapee does not currently set explicitly.) I was wondering... for the rawtherapee build in the ports framework I'm doing this (shown below), namely, force the port to use *libc++ with GCC* (I need(ed) to force GCC because clang used to lack OpenMP support, and I needed to match the C++ standard library to what the base system provides by default, that's why it is under the COMPILER_FEATURES check). I think the original idea was from Baptiste Daroussin. I was wondering if it would work for Yuri as well on 9.3 (where graphics/rawtherapee would not normally use it because libc++ isn't part of COMPILER_FEATURES there). The key will certainly be -nostdinc++ to get GNU libstdc++ out of the way and the flags to pull the ports libc++ i= n. The additional difficulty will be that the third-party requisite C++ libraries, if any, would likely have to be recompiled the same way. Mixing and matching GNU libstdc++ and libc++ in the same executable won't work (because these two libraries only agree on the API more or less, but neither the ABI nor the internal structure layouts). 62 .if ${COMPILER_FEATURES:Mlibc++} 63 LDFLAGS+=3D -L/usr/local/lib/c++ 64 CXXFLAGS+=3D -nostdinc++ -isystem /usr/local/include/c++/v1 65 CFLAGS+=3D -isystem /usr/local/include/c++/v1 66 BUILD_DEPENDS+=3D ${LOCALBASE}/lib/c++/libstdc++.so:${PORTSDIR}/devel/libc++ 67 .endif