# GCC port/pkg : adding a -stdlib=lib?++ option



## RJVB (Mar 31, 2018)

Hi,

As many of you will know, Mac OS X 10.9 and later use libc++ as their C++ runtime, like FreeBSD. I've been working on a GCC patch and accompanying changes to the MacPorts gcc7 port to add a -stdlib option to the compiler family, like the one clang provides, in order to make G++ a viable, full-featured alternative (if not only because choice is always good).

The result seems to work just fine on Mac; I've already built digiKam5 with g++ 7.2.0. Initial tests on Linux suggests it works there too.

The GCC devs seem to be perfectly open to integrating such an improvement provided someone (else) does the work. It wouldn't hurt to test this change on FreeBSD too, and I could certainly use a hand with drafting the best way to add the required options and defaults selection to GCC's autoconf/automake build system (something I'm not at ease with at all).

Anyone here interested in jumping aboard this ship ... maybe your GCC port/pkg already provides a similar patch?

FWIW, I'm also patching the compiler so that it invokes `as -q` (and thus the LLVM assembler) by default, instead of the fossil GNU as that Apple still ships which has no support for intrinsics introduced after the original Core2 CPU. Does FreeBSD have the same situation?


----------

