Current-Users archive

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

Re: MKLLVMRT=yes failure on macOS



At Sat, 22 Mar 2025 14:31:04 -0700, "Greg A. Woods" <woods%planix.ca@localhost> wrote:
Subject: Re: MKLLVMRT=yes failure on macOS
>
> At Sat, 22 Mar 2025 12:53:48 -0700, "Greg A. Woods" <woods%planix.ca@localhost> wrote:
> Subject: MKLLVM=yes failure on macOS
>
> Sorry, that should have been MKLLVMRT=yes of course.

Oy -- it doesn't matter.  As I should have guessed building LLVM as a
cross compiler requires libLLVMSupport, so....

MKLLVMRT=yes is the minimum way to encounter this error, but MKLLVM
triggers it as well.

Now for a digression:

> I think I was confused about the meaning of MKLLVM -- it appears
> useless, or counter-productive at least, on macOS, no?

Hmmm.... OK, now I see a bit more how this works -- it's rather poorly
documented, at least for anyone who doesn't deeply understand
toolchains, cross compiling, and so on, as these variables don't have
the "normal" meaning of other MK* and HAVE_* make variables.

The HAVE_LLVM (and HAVE_PCC and HAVE_GCC) are also somewhat poorly
documented and have confusing multiple meanings.

MKLLVM, in addition to building and installing Clang/LLVM for the
release, also means to use the in-tree clang as the host cross compiler.
I guess this makes sense in some respects, but it's a confusing overload
and not consistent with other MKcompiler settings.

I would have separated it as with PCC and HAVE_PCC and left MKLLVM as
doing just and only what other MK* variables do, i.e. just to mean build
and install the thing in the release.

However I'd have called the "build as tools" controls something more
like HOST_USE_* to avoid other confusions with normal HAVE_* make vars,
though on the other hand there is also the precedent of MKCROSSGDB.

The main meaning for HAVE_PCC and HAVE_GCC for EXTERNAL_TOOLCHAIN, and
the warning from mk.conf(5), is OK.

However HAVE_LLVM doesn't mean the same as HAVE_GCC or HAVE_PCC!

Now if you're not confused yet, how about in the Postfix and xedit/lisp
Makefiles where we have HAVE_PCC being (mis?/ab?)used.  There are
similar occurrences of HAVE_LLVM being used, and a mess of uses of
HAVE_GCC.

There are a few places where HAVE_compiler is used to actually set
compiler options, which is what they're documented as being for.  Except
it should never be used for -D (defining a macro on the command line) --
CPP expressions should be used with the pre-defined macros supplied by
the compiler!

Now in some places where HAVE_compiler is used it is used along with a
test of ACTIVE_CC, and in some places without -- so that's also
confusing.

Also some uses of HAVE_compiler look at its value, presumably to see
which version is being used, but that's not documented anywhere I can
find.

Anyway, I can't build the in-tree LLVM on macOS.

--
					Greg A. Woods <gwoods%acm.org@localhost>

Kelowna, BC     +1 250 762-7675           RoboHack <woods%robohack.ca@localhost>
Planix, Inc. <woods%planix.com@localhost>     Avoncote Farms <woods%avoncote.ca@localhost>

Attachment: pgpkRgFUtHEQg.pgp
Description: OpenPGP Digital Signature



Home | Main Index | Thread Index | Old Index