Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 6 Aug 2019 17:59:21 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        Brooks Davis <brooks@freebsd.org>
Cc:        freebsd-toolchain@freebsd.org, freebsd-ports@freebsd.org, freebsd-ppc@freebsd.org
Subject:   Re: devel/llvm90 requires math/z3 first; building math/z3 requires a c++ toolchain be in place
Message-ID:  <2A88AADC-8ED0-4FFD-85A8-34C0186D5D4F@yahoo.com>
In-Reply-To: <20190806165525.GC94703@spindle.one-eyed-alien.net>
References:  <8DB3EAA4-2B88-4180-8386-673524D27C64@yahoo.com> <20190806165525.GC94703@spindle.one-eyed-alien.net>

next in thread | previous in thread | raw e-mail | index | archive | help


On 2019-Aug-6, at 09:55, Brooks Davis <brooks at freebsd.org> wrote:

> I'd prefer to disable this dependency.  There's a knob that worked in
> the 8.0 timeframe, but the lit build now autodetects z3 when it is
> present and I've failed to find a knob to disable it.  For now, the =
easy
> workaround is probably to disable options LIT.  We could make that the
> default on non-LLVM platforms is that makes sense.
>=20
> -- Brooks

Okay.

poudriere-devel automatically built math/z3 because
I'd indicated to build devel/llvm90 . math/z3 was not
previously built: I've never had other use of it. So
my context was not one of an implicit autodetect.

It looks like that happened because of
devel/llvm90/Makefile having:

LIT_DESC=3D               Install lit and FileCheck test tools
LIT_LIB_DEPENDS=3D        libz3.so:math/z3
LIT_VARS=3D               _USES_PYTHON=3Dpython:3.6+

Of course someone that has math/z3 for other reasons
would not necessarily want it used by llvm90 materials,
so merely not listing it in LIT_LIB_DEPENDS might not
be enough to cover all contexts.

[Stop reading here if you do not care about what from
llvm90 uses z3 and some of the consequences.]

It turns out that the direct dependency is (via
reviewing ldd -a output):

/usr/local/llvm90/lib/../lib/libLLVM-9.so:
        libz3.so.0 =3D> /usr/local/lib/libz3.so.0

The indirect reference via libLLVM-9.so use
leads to most of llvm90 materials binding to
libz3.so :

# ldd /usr/local/llvm90/lib/*.so | egrep '(^/|z3)'
/usr/local/llvm90/lib/CheckerDependencyHandlingAnalyzerPlugin.so:
        libz3.so.0 =3D> /usr/local/lib/libz3.so.0 (0x807a00000)
/usr/local/llvm90/lib/CheckerOptionHandlingAnalyzerPlugin.so:
        libz3.so.0 =3D> /usr/local/lib/libz3.so.0 (0x807a00000)
/usr/local/llvm90/lib/LLVMgold.so:
        libz3.so.0 =3D> /usr/local/lib/libz3.so.0 (0x805400000)
/usr/local/llvm90/lib/SampleAnalyzerPlugin.so:
        libz3.so.0 =3D> /usr/local/lib/libz3.so.0 (0x807a00000)
/usr/local/llvm90/lib/libLLVM-9.0.0.so:
        libz3.so.0 =3D> /usr/local/lib/libz3.so.0 (0x805200000)
/usr/local/llvm90/lib/libLLVM-9.so:
        libz3.so.0 =3D> /usr/local/lib/libz3.so.0 (0x805200000)
/usr/local/llvm90/lib/libLLVM.so:
        libz3.so.0 =3D> /usr/local/lib/libz3.so.0 (0x805200000)
/usr/local/llvm90/lib/libLTO.so:
        libz3.so.0 =3D> /usr/local/lib/libz3.so.0 (0x805400000)
/usr/local/llvm90/lib/libRemarks.so:
        libz3.so.0 =3D> /usr/local/lib/libz3.so.0 (0x805400000)
/usr/local/llvm90/lib/libclang-cpp.so:
        libz3.so.0 =3D> /usr/local/lib/libz3.so.0 (0x807a00000)
/usr/local/llvm90/lib/libclang.so:
        libz3.so.0 =3D> /usr/local/lib/libz3.so.0 (0x807200000)
/usr/local/llvm90/lib/libgomp.so:
/usr/local/llvm90/lib/libiomp5.so:
/usr/local/llvm90/lib/liblldb.so:
        libz3.so.0 =3D> /usr/local/lib/libz3.so.0 (0x807e00000)
/usr/local/llvm90/lib/libomp.so:
/usr/local/llvm90/lib/libomptarget.so:

(I'll not list the /usr/local/llvm90/bin/ programs that in
turn bind to these libraries, but most end up bound to
libz3.so .)

ldd reports some of the details as far as what librraries
the libz3.so depends on:

# ldd /usr/local/lib/*z3.so
/usr/local/lib/libz3.so:
        libthr.so.3 =3D> /lib/libthr.so.3 (0x800662000)
        libomp.so =3D> /usr/lib/libomp.so (0x80068f000)
        libc++.so.1 =3D> /usr/lib/libc++.so.1 (0x8020e4000)
        libcxxrt.so.1 =3D> /lib/libcxxrt.so.1 (0x800738000)
        libm.so.5 =3D> /lib/libm.so.5 (0x80075a000)
        libgcc_s.so.1 =3D> /lib/libgcc_s.so.1 (0x80078c000)
        libc.so.7 =3D> /lib/libc.so.7 (0x800242000)

This makes clear that mixing in libstdc+++ or the
like would likely not be appropriate unless llvm90
was also using such. So a default gcc based build
of libz3.so likely would not be appropriate if
llvm90 is to also be built such that it can bind
to libz3.so if found.

> On Mon, Aug 05, 2019 at 08:45:31PM -0700, Mark Millard via =
freebsd-toolchain wrote:
>> Building math/z3 involves:
>>=20
>> # grep compiler /usr/ports/math/z3/Makefile
>> USES=3D		compiler:c++11-lang python:2.7,build
>>=20
>> But devel/llvm90 requires math/z3 to have been built before
>> devel/llvm90 is built:
>>=20
>> # pkg info -d llvm90
>> llvm90-9.0.0.r1:
>> 	libxml2-2.9.9
>> 	z3-4.8.5_1
>> 	python36-3.6.9
>> 	perl5-5.28.2
>> 	libedit-3.1.20190324,1
>> # pkg info -B llvm90
>> llvm90-9.0.0.r1:
>> 	libpython3.6m.so.1.0
>> 	libedit.so.0
>> 	libz3.so.0
>> 	libxml2.so.2
>>=20
>>=20
>> Hopefully this cycle can be avoided for system
>> clang to eventually have progressed to clang 9.
>> (I do not know the details.)
>>=20
>> For architectures still at gcc/g++ 4.2.1, some
>> alternate c++ tool chain needs to be used to
>> build libz3.so but the result needs to be
>> compatible with llvm90 later using the libz3.so's
>> content. (I do not know the details.)

=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2A88AADC-8ED0-4FFD-85A8-34C0186D5D4F>