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=c++11 on 9.3.
> 
> 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.
> 
> 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=209467#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++ in.

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).

<https://svnweb.freebsd.org/ports/head/graphics/rawtherapee/Makefile?view=markup&pathrev=395090#l62>

62      .if ${COMPILER_FEATURES:Mlibc++}
63      LDFLAGS+=       -L/usr/local/lib/c++
64      CXXFLAGS+=      -nostdinc++ -isystem /usr/local/include/c++/v1
65      CFLAGS+=        -isystem /usr/local/include/c++/v1
66      BUILD_DEPENDS+=
${LOCALBASE}/lib/c++/libstdc++.so:${PORTSDIR}/devel/libc++
67      .endif
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[email protected]"

Reply via email to