2024-02-08 00:28:52

by Nathan Chancellor

[permalink] [raw]
Subject: Prebuilt LLVM 18.1.0-rc2 uploaded

Hi all,

I have built and uploaded a prebuilt version of LLVM 18.1.0-rc2 to
https://mirrors.edge.kernel.org/pub/tools/llvm/.

As with Linux -rc releases, this is not the final version that will
ship. If you run across any issues, especially ones that were not
present in earlier LLVM releases, please consider reporting them to us
so that we have a chance to investigate and fix them before the final
release.

Cheers,
Nathan


2024-02-10 16:36:27

by Miguel Ojeda

[permalink] [raw]
Subject: Re: Prebuilt LLVM 18.1.0-rc2 uploaded

On Thu, Feb 8, 2024 at 1:28 AM Nathan Chancellor <[email protected]> wrote:
>
> I have built and uploaded a prebuilt version of LLVM 18.1.0-rc2 to
> https://mirrors.edge.kernel.org/pub/tools/llvm/.
>
> As with Linux -rc releases, this is not the final version that will
> ship. If you run across any issues, especially ones that were not
> present in earlier LLVM releases, please consider reporting them to us
> so that we have a chance to investigate and fix them before the final
> release.

I took a look at the LLVM 18 prerelease to see if these would work
with Rust for e.g. CI and other users (instead of using the
LLVM-provided apt ones, for instance), and noticed it does not bundle
`libclang.so`.

Would it be possible to include it so that we can use `bindgen` and
thus enable Rust with them?

I understand they are intended to be minimal toolchains, but if you
think it would not be an unreasonable overhead, then it would be great
to have it.

Either way, thanks for these toolchains, Nathan!

Cheers,
Miguel

2024-02-12 23:49:04

by Nathan Chancellor

[permalink] [raw]
Subject: Re: Prebuilt LLVM 18.1.0-rc2 uploaded

Hi Miguel,

On Sat, Feb 10, 2024 at 05:36:01PM +0100, Miguel Ojeda wrote:
> On Thu, Feb 8, 2024 at 1:28 AM Nathan Chancellor <[email protected]> wrote:
> >
> > I have built and uploaded a prebuilt version of LLVM 18.1.0-rc2 to
> > https://mirrors.edge.kernel.org/pub/tools/llvm/.
> >
> > As with Linux -rc releases, this is not the final version that will
> > ship. If you run across any issues, especially ones that were not
> > present in earlier LLVM releases, please consider reporting them to us
> > so that we have a chance to investigate and fix them before the final
> > release.
>
> I took a look at the LLVM 18 prerelease to see if these would work
> with Rust for e.g. CI and other users (instead of using the
> LLVM-provided apt ones, for instance), and noticed it does not bundle
> `libclang.so`.
>
> Would it be possible to include it so that we can use `bindgen` and
> thus enable Rust with them?
>
> I understand they are intended to be minimal toolchains, but if you
> think it would not be an unreasonable overhead, then it would be great
> to have it.

Absolutely, I am more than happy to include libclang.so and anything
else that would be useful for the kernel. Everything gets built but I
only install what has felt needed for the kernel, so there is no real
overhead aside from package size, which obviously should not increase
much with this change. I've added the targets to my build scripts and
kicked off a set of builds. If they finish successfully, I will upload
them so that you can test them out and make sure they will work.

Thanks for bringing this up and giving them a go, cheers!
Nathan

2024-02-13 02:53:14

by Nathan Chancellor

[permalink] [raw]
Subject: Re: Prebuilt LLVM 18.1.0-rc2 uploaded

On Mon, Feb 12, 2024 at 04:48:52PM -0700, Nathan Chancellor wrote:
> Hi Miguel,
>
> On Sat, Feb 10, 2024 at 05:36:01PM +0100, Miguel Ojeda wrote:
> > On Thu, Feb 8, 2024 at 1:28 AM Nathan Chancellor <[email protected]> wrote:
> > >
> > > I have built and uploaded a prebuilt version of LLVM 18.1.0-rc2 to
> > > https://mirrors.edge.kernel.org/pub/tools/llvm/.
> > >
> > > As with Linux -rc releases, this is not the final version that will
> > > ship. If you run across any issues, especially ones that were not
> > > present in earlier LLVM releases, please consider reporting them to us
> > > so that we have a chance to investigate and fix them before the final
> > > release.
> >
> > I took a look at the LLVM 18 prerelease to see if these would work
> > with Rust for e.g. CI and other users (instead of using the
> > LLVM-provided apt ones, for instance), and noticed it does not bundle
> > `libclang.so`.
> >
> > Would it be possible to include it so that we can use `bindgen` and
> > thus enable Rust with them?
> >
> > I understand they are intended to be minimal toolchains, but if you
> > think it would not be an unreasonable overhead, then it would be great
> > to have it.
>
> Absolutely, I am more than happy to include libclang.so and anything
> else that would be useful for the kernel. Everything gets built but I
> only install what has felt needed for the kernel, so there is no real
> overhead aside from package size, which obviously should not increase
> much with this change. I've added the targets to my build scripts and
> kicked off a set of builds. If they finish successfully, I will upload
> them so that you can test them out and make sure they will work.

Alright, I reuploaded 18.1.0-rc2 with libclang.so included, please let
me know if this will work for you going forward.

Cheers,
Nathan

2024-02-13 20:37:35

by Miguel Ojeda

[permalink] [raw]
Subject: Re: Prebuilt LLVM 18.1.0-rc2 uploaded

On Tue, Feb 13, 2024 at 3:53 AM Nathan Chancellor <[email protected]> wrote:
>
> Alright, I reuploaded 18.1.0-rc2 with libclang.so included, please let
> me know if this will work for you going forward.

Thanks Nathan, that was quick!

I tried it, and it worked like a charm. bindgen reports:

$ bindgen --version --verbose
bindgen 0.65.1
Clang: ClangBuiltLinux clang version 18.1.0rc
(https://github.com/llvm/llvm-project.git
c6c86965d967886ca5a2ed8968c949cd42cdd49a)

And I built next-20240213 for LoongArch kernel with Rust enabled:

# Linux/loongarch 6.8.0-rc4 Kernel Configuration
CONFIG_CC_VERSION_TEXT="ClangBuiltLinux clang version 18.1.0rc
(https://github.com/llvm/llvm-project.git
c6c86965d967886ca5a2ed8968c949cd42cdd49a)"
CONFIG_WERROR=y
CONFIG_RUST=y
CONFIG_RUSTC_VERSION_TEXT="rustc 1.75.0 (82e1608df 2023-12-21)"
CONFIG_BINDGEN_VERSION_TEXT="bindgen 0.65.1"

I also built our rust-next branch for x86_64 and QEMU-boot tested it
with the couple Rust samples:

[ 0.000000] Linux version 6.8.0-rc1-gf090f0d0eea9
(root@02f0b7650ba6) (ClangBuiltLinux clang version 18.1.0rc
(https://github.com/llvm/llvm-project.git
c6c86965d967886ca5a2ed8968c949cd42cdd49a), ClangBuiltLinux LLD 18.1.0)
#1 SMP PREEMPT_DYNAMIC Tue Feb 13 20:14:57 UTC 2024
[ 1.788925] rust_minimal: My numbers are [72, 108, 200]

I have hooked it up into my small CI to keep using your toolchain in a
subset of the builds :)

Not sure if you pick tags for this sort of thing, but in case it is useful:

Tested-by: Miguel Ojeda <[email protected]>

Thanks again!

Cheers,
Miguel

2024-02-27 12:33:20

by Miguel Ojeda

[permalink] [raw]
Subject: Re: Prebuilt LLVM 18.1.0-rc2 uploaded

On Tue, Feb 13, 2024 at 9:37 PM Miguel Ojeda
<[email protected]> wrote:
>
> Thanks Nathan, that was quick!

Is it possible to add libclang for the older toolchains? Or are they
supposed to be immutable?

Relatedly, Connor reports KCFI not working with LLVM 18:
https://lore.kernel.org/rust-for-linux/20240227-uncertain-amaze-6197e627ad95@wendy/

Thanks!

Cheers,
Miguel

2024-02-27 15:37:53

by Nathan Chancellor

[permalink] [raw]
Subject: Re: Prebuilt LLVM 18.1.0-rc2 uploaded

On Tue, Feb 27, 2024 at 01:32:36PM +0100, Miguel Ojeda wrote:
> On Tue, Feb 13, 2024 at 9:37 PM Miguel Ojeda
> <[email protected]> wrote:
> >
> > Thanks Nathan, that was quick!
>
> Is it possible to add libclang for the older toolchains? Or are they
> supposed to be immutable?

How far back would you like it added? I don't necessarily mind
rebuilding older releases but certain entities may notice the checksums
change.

https://gitlab.com/Linaro/tuxmake/-/merge_requests/364

Not the end of the world though.

> Relatedly, Connor reports KCFI not working with LLVM 18:
> https://lore.kernel.org/rust-for-linux/20240227-uncertain-amaze-6197e627ad95@wendy/

I see now this was PEBKAC :)

Cheers,
Nathan

2024-02-27 16:51:26

by Miguel Ojeda

[permalink] [raw]
Subject: Re: Prebuilt LLVM 18.1.0-rc2 uploaded

On Tue, Feb 27, 2024 at 4:37 PM Nathan Chancellor <[email protected]> wrote:
>
> How far back would you like it added? I don't necessarily mind
> rebuilding older releases but certain entities may notice the checksums
> change.
>
> https://gitlab.com/Linaro/tuxmake/-/merge_requests/364
>
> Not the end of the world though.

I think a reasonable set would be those versions matching the LLVM
that Rust bundles (for `rustc` versions we have since 6.1 LTS). That
is: 15, 16 and 17.

Conveniently, LLVM 15 also matches the minimum external LLVM supported
by `rustc` in 6.6 LTS.

If those are too much, LLVM 17 would already cover what 6.6 LTS' Rust bundles.

Cheers,
Miguel

2024-02-27 22:36:47

by Nathan Chancellor

[permalink] [raw]
Subject: Re: Prebuilt LLVM 18.1.0-rc2 uploaded

On Tue, Feb 27, 2024 at 05:51:04PM +0100, Miguel Ojeda wrote:
> On Tue, Feb 27, 2024 at 4:37 PM Nathan Chancellor <[email protected]> wrote:
> >
> > How far back would you like it added? I don't necessarily mind
> > rebuilding older releases but certain entities may notice the checksums
> > change.
> >
> > https://gitlab.com/Linaro/tuxmake/-/merge_requests/364
> >
> > Not the end of the world though.
>
> I think a reasonable set would be those versions matching the LLVM
> that Rust bundles (for `rustc` versions we have since 6.1 LTS). That
> is: 15, 16 and 17.
>
> Conveniently, LLVM 15 also matches the minimum external LLVM supported
> by `rustc` in 6.6 LTS.
>
> If those are too much, LLVM 17 would already cover what 6.6 LTS' Rust bundles.

15 through 17 is a reasonable rebuild request, I've added it to the
queue along with 18.1.0-rc4, which was just released. I'll message you
when I have them uploaded.

Cheers,
Nathan

2024-02-28 18:44:08

by Nathan Chancellor

[permalink] [raw]
Subject: Re: Prebuilt LLVM 18.1.0-rc2 uploaded

O Tue, Feb 27, 2024 at 02:56:05PM -0700, Nathan Chancellor wrote:
> On Tue, Feb 27, 2024 at 05:51:04PM +0100, Miguel Ojeda wrote:
> > On Tue, Feb 27, 2024 at 4:37 PM Nathan Chancellor <[email protected]> wrote:
> > >
> > > How far back would you like it added? I don't necessarily mind
> > > rebuilding older releases but certain entities may notice the checksums
> > > change.
> > >
> > > https://gitlab.com/Linaro/tuxmake/-/merge_requests/364
> > >
> > > Not the end of the world though.
> >
> > I think a reasonable set would be those versions matching the LLVM
> > that Rust bundles (for `rustc` versions we have since 6.1 LTS). That
> > is: 15, 16 and 17.
> >
> > Conveniently, LLVM 15 also matches the minimum external LLVM supported
> > by `rustc` in 6.6 LTS.
> >
> > If those are too much, LLVM 17 would already cover what 6.6 LTS' Rust bundles.
>
> 15 through 17 is a reasonable rebuild request, I've added it to the
> queue along with 18.1.0-rc4, which was just released. I'll message you
> when I have them uploaded.

This is now done, please let me know if there are any issues!

Cheers,
Nathan

2024-02-29 13:39:40

by Miguel Ojeda

[permalink] [raw]
Subject: Re: Prebuilt LLVM 18.1.0-rc2 uploaded

On Wed, Feb 28, 2024 at 7:44 PM Nathan Chancellor <[email protected]> wrote:
>
> O Tue, Feb 27, 2024 at 02:56:05PM -0700, Nathan Chancellor wrote:
> >
> > 15 through 17 is a reasonable rebuild request, I've added it to the
> > queue along with 18.1.0-rc4, which was just released. I'll message you
> > when I have them uploaded.
>
> This is now done, please let me know if there are any issues!

Thanks a ton Nathan! That was very fast.

I gave them all (15, 16, 17, 18.1.0-rc4) a test (but only x86_64), and
they worked fine -- I could boot-test in QEMU (x86_64) a Rust-enabled
kernel and load the sample modules:

CONFIG_CC_VERSION_TEXT="ClangBuiltLinux clang version 15.0.7
(https://github.com/llvm/llvm-project.git
8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)"
CONFIG_CC_VERSION_TEXT="ClangBuiltLinux clang version 16.0.6
(https://github.com/llvm/llvm-project.git
7cbf1a2591520c2491aa35339f227775f4d3adf6)"
CONFIG_CC_VERSION_TEXT="ClangBuiltLinux clang version 17.0.6
(https://github.com/llvm/llvm-project.git
6009708b4367171ccdbf4b5905cb6a803753fe18)"
CONFIG_CC_VERSION_TEXT="ClangBuiltLinux clang version 18.1.0rc
(https://github.com/llvm/llvm-project.git
461274b81d8641eab64d494accddc81d7db8a09e)"

Cheers,
Miguel