qemu, and using gcc45+ compilers on systems set up with LibCxxOnOlderSystems and libc++

Lawrence Velázquez larryv at macports.org
Sun Sep 11 20:35:02 PDT 2016


> On Sep 11, 2016, at 11:25 PM, Ken Cunningham <ken.cunningham.webuse at gmail.com> wrote:
> 
> I am not totally sure how to use gcc* versions, building cxx code, when my system has been set up for LibCxxOnOlderSystems, and all the installed ports to date link against libc++.
> 
> I _think_ I can just 
> 
> sudo port install gcc49
> 
> for example. This would build gcc49 using clang, and I believe that command would link gcc itself against libc++, which I guess is no big deal and maybe a fine thing.

No, that does not happen. g++ uses its own C++ standard library and runtime.

> Then - assuming that goes OK - when I try to build something with gcc49, according to this page:
> 
> <http://libcxx.llvm.org/docs/UsingLibcxx.html#using-libc-with-gcc>
> 
> I would do something like this with the flags to keep gcc on trac with libc++.
> 
> 
> g++ -nostdinc++ -I<libcxx-install-prefix>/include/c++/v1 \
>       test.cpp -nodefaultlibs -lc++ -lc++abi -lm -lc -lgcc_s -lgcc
> 
> Have to set that collection into the CXX flags and LDFLAGS, I would think.
> 
> Just a bit nervous about blowing things up...
> 
> Any thoughts, comments, or experience much appreciated....

Someone else can elaborate if they want, but all I'll say at the moment is that we have encountered an obscene amount of trouble involving g++, libstdc++, and libc++, and a long time ago we basically decided that g++ was dead to us.

vq


More information about the macports-users mailing list