Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Sep 2023 17:37:21 +0200
From:      Jan Beich <jbeich@FreeBSD.org>
To:        Emmanuel Vadot <manu@bidouilliste.com>
Cc:        Gleb Popov <arrowd@freebsd.org>, "Tobias C. Berner" <tcberner@freebsd.org>, ports-committers@freebsd.org, dev-commits-ports-all@freebsd.org, dev-commits-ports-main@freebsd.org
Subject:   Re: git: 4df0e66a3662 - main - llvm.mk: add export/noexport to handle CC/CXX/CPP exports
Message-ID:  <r0n2-2ifi-wny@FreeBSD.org>
In-Reply-To: <msxq-5dgh-wny@FreeBSD.org> (Jan Beich's message of "Wed, 13 Sep 2023 16:56:30 %2B0200")
References:  <202309130518.38D5INm2018105@gitrepo.freebsd.org> <CALH631mauenLxm13nmEo9SCyqGMu2yRJ9C-gjjJ9yS4Wg0L33g@mail.gmail.com> <20230913102352.b641f29cd7cb76f2937d1a61@bidouilliste.com> <zg1q-fhbp-wny@FreeBSD.org> <msxq-5dgh-wny@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Jan Beich <jbeich@FreeBSD.org> writes:

> Jan Beich <jbeich@FreeBSD.org> writes:
>
>> Emmanuel Vadot <manu@bidouilliste.com> writes:
>>
>>> On Wed, 13 Sep 2023 08:55:48 +0300
>>> Gleb Popov <arrowd@freebsd.org> wrote:
>>>
>>>> On Wed, Sep 13, 2023 at 8:20?AM Tobias C. Berner <tcberner@freebsd.org> wrote:
>>>> >
>>>> > +  USES=llvm.mk now supports 'export' (default) and 'noexport' arguments.
>>>> > +  When export is set, CC, CXX and CPP will be set to the path corresponding
>>>> > +  to the chosen llvm-version.
>>>> 
>>>> The choice for the default seems strange to me. Now every port that
>>>> has USES=llvm will be switching to building with a non-base compiler.
>>>> Is this really a sensible default?
>>>
>>>  Isn't that what you want when you add USES=llvm ?
>>
>> Changing CC is USES=compiler job. Contributors starting using USES=llvm
>> for changing Clang version because USES=compiler is poorly maintained.
>>
>> I predominantly add USES=llvm to satisfy libLLVM (mesa-devel, rpcs3) or
>> libclang (USES=cargo + CARGO_CRATES=bindgen). In a few cases when I need
>> newer Clang (for C++20 std:ranges, C++23) I also need newer libc++ but
>> devel/llvm* maintainer refuses to provide libc++ (bug 260139).
>>
>> Forcing CC/CXX/CPP without testing all consumers has a chance of
>> introducing regressions. For example, when using LTO it's important to
>> make sure CMake doesn't pick up /usr/bin/llvm-ar or /usr/bin/llvm-ranlib
>> because those may not support LLVM bitcode used by devel/llvm*.
>>
>> https://cgit.freebsd.org/ports/commit/?id=5e71e4d45129
>> https://cgit.freebsd.org/ports/commit/?id=2ce01a07d7c9
>>
>> While the affected ports had LTO enabled by default there's also
>> WITH_LTO knob handled by /usr/ports/Mk/Features/lto.mk.
>
> D37747 had TEST PLAN with "Actually test", SUMMARY with "Heavily WIP",
> said :lib wasn't affected and limited port Clang to older base Clang.
> The mini exp-run by a reviewer was limited to "the specific ports of interest"
> thus didn't cover all consumers (let alone all ports). For example,
> I've discovered this broke one of my ports:
>
> https://cgit.freebsd.org/ports/commit/?id=391f28644973

and https://cgit.freebsd.org/ports/commit/?id=07fe3d738b39

> The commit message is no better: didn't mention the new default is "export".
> For example, FreeBSD >= 14.0 now uses port Clang 15 instead of base Clang 16.
> This may degrade optimization slightly, assuming Clang improves each version.

WITH_CCACHE_BUILD is also pessimized. Besides different Clang version,
different Clang binary name (bin/clang15 vs. llvm15/bin/clang) there's
also relative (using ccache via symlink in PATH) vs. absolute path.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?r0n2-2ifi-wny>