Wednesday, May 31, 2017

HEADS UP: COMPILER (and clang report)

We now have a new mechanism for selecting C and/or C++ compilers in ports,
it's called (drum roll....) COMPILER.

This is probably the 4th iteration of wacky tries, the first 3 none of my
fellow porters understood I guess. This one is as simple as I could get it.

And it's documented in bsd.port.mk.

Simply put, ports requiring a C/C++ compiler that's not gcc 4.2.1 or more
ancient will set

COMPILER = gcc
or
COMPILER = clang

(or even both for very strange cases)

and get the C/C++ compiler from ports (either gcc 4.9 or ports/clang).

Exemption: if the base compiler is clang (officially only on aarch64
for now), it's deemed to be modern enough so it will be chosen.

By default, C and C++ are affected, but you can set
COMPILER_LANGS = c
instead to only get C (this changes build, run, wantlib depends according
to the needs of C++).


MODGCC4_ARCHS and MODCLANG_ARCHS can still be used to fine-tune that choice
(some cases require a specific compiler because of assembly).

In general, clang arches have zero choice, because the libc++ from base
does NOT mix at all with the libstdc++ used by both gcc and clang ports.

Most instances of gcc4 and clang modules for C, C++ have been converted
to COMPILER, including some stuff that doesn't yet build with base clang.

(but the number of problematic ports is steadily going down, though we
are now in the "difficult to fix area" where it takes longer to repair things.

No comments:

Post a Comment