pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Installing clang alongside GCC on NetBSD 9

Jason Bacon <> writes:

> With C there are very few potential problems because the ABI is simple
> and hasn't changed much in the last 30 years.

My impression is also that the ABI is stable.

> With C++, it's complicated and I don't claim to understand all the
> issues in detail.  C++ is still evolving rapidly and different major
> versions of GCC do not guarantee ABI compatibility or even API
> compatibility in all cases.

I am not a C++ expert, but my understanding is that the system and
calling convention ABI is stable but that libstdc++ is not.  But all C++
programs use that.

> That said, FreeBSD ports mixes clang++ and g++ objects
> regularly. Ports that use openmp or Fortran still depend on GCC
> packages (though this may change soon) while the libraries they depend
> on are almost all built with clang.  In some cases this is reversed,
> i.e. libraries are build with GCC and the dependent program with
> clang. There are potential problems with this, but it usually just
> works with the default GCC port (currently gcc9) and solutions exist
> in the ports infrastructure for other cases, such as allowing the
> maintainer to force use of libc++ or libstdc++ or control which C++
> standard is used by the compiler.

Interesting.   I guess there is "usually works" and "sound", not the
same :-)

> I'm not sure about Fortran, but I suspect the ABI is much simpler than
> C++ so it's less problematic mixing in object code built with
> gfortran.

My impression is that the Fortran ABI is even more stable the C.

Home | Main Index | Thread Index | Old Index