Re: lang/rust/Makefile for 1.82.0 has wrong llvm:min= value [I got that incorrect]; more

From: Mark Millard <marklmi_at_yahoo.com>
Date: Fri, 15 Nov 2024 04:27:11 UTC
On Nov 14, 2024, at 19:30, Tatsuki Makino <tatsuki_makino@hotmail.com> wrote:

> Since option PORT_LLVM is not turned on in the official version, it seems that there is no problem with using of the bundle llvm.
> However, if we want to use llvm instead of a bundle on an architecture where the compiler causes problems, that version is no longer supported and we need to rewrite the version number there.
> 
> … Is that what you mean? :)

When I got into this area it was because someone on discord was getting
errors like:

ld.lld: error: ../../../x86_64-unknown-freebsd/release/libgkrust.a(ews_xpcom-da5573b2cf91b84e.ews_xpcom.c68a27d7391ba4aa-cgu.0.rcgu.o): Unknown attribute kind (91) (Producer: 'LLVM19.1.1-rust-1.82.0-stable' Reader: 'LLVM 17.0.6') clang++: error: linker command failed with exit code 1 (use -v to see invocation)

For the example, in essence, LLVM 17's "Reader" was reporting finding LLVM 19
content, which, to LLVM 17, had an example of "Unknown attribute kind (91)".
(LLVM 19's "Reader" likely would not have classified it that way.)

So rust's internal LLVM 19 toolchain was generating output that LLVM 17's
toolchain could not handle but was being told to process.

This tends to suggest that using older linkers (or such) to link rust output
that internally used a newer LLVM toolchain sometimes fails to be compatible.

That leaves 3 basic options (stated for the specfics of the
example in question):

) Have everything involved use a LLVM 19 toolchain matching lang/rust 's
   internal LLVM 19 toolchain, here LLVM 19.1.1 .

) Have lang/rust use the devel/llvm* toolchain that matches the
   context, here LLVM 17.0.6 .

) Use some other LLVM toolchain vintage for everything involved, say a 
   devel/llvm18 toolchain.

(Those are options that avoid doing some sort of detailed
compatibility analysis across differing toolchain versions
in order to pick some possibly mixed set of versions.)

===
Mark Millard
marklmi at yahoo.com