lang/rust/Makefile for 1.82.0 has wrong llvm:min= value; more

From: Mark Millard <marklmi_at_yahoo.com>
Date: Sat, 09 Nov 2024 04:56:20 UTC
https://github.com/rust-lang/rust/pull/130487 reports . . .

QUOTE
Update the minimum external LLVM to 18 #130487

With this change, we'll have stable support for LLVM 18 and 19.
For reference, the previous increase to LLVM 17 was #122649.
END QUOTE

Note: the internal LLVM is 19 for 1.82.0 .

Also for 1.82.0 . . .

src/bootstrap/src/core/build_steps/llvm.rs <http://llvm.rs/> was updated to:

 @@ -580,11 +580,11 @@ fn check_llvm_version(builder: &Builder<'_>, llvm_config: &Path) {
     let version = command(llvm_config).arg("--version").run_capture_stdout(builder).stdout();
     let mut parts = version.split('.').take(2).filter_map(|s| s.parse::<u32>().ok());
     if let (Some(major), Some(_minor)) = (parts.next(), parts.next()) {
-        if major >= 17 {
+        if major >= 18 {
             return;
         }
     }
-    panic!("\n\nbad LLVM version: {version}, need >=17.0\n\n")
+    panic!("\n\nbad LLVM version: {version}, need >=18\n\n")
 }
 
 fn configure_cmake(


But lang/rust/Makefile has:

. . .
PORTVERSION?= 1.82.0
. . .
PORT_LLVM_USES= llvm:min=17,lib,noexport
. . .


As I understand, 17 would be rejected now and 18 or
19 is needed.


The likes of: Mk/bsd.gecko.mk having 17 would also
look to need an update:

USES+=		compiler:c++17-lang cpe elfctl gl gmake gnome iconv \
			llvm:min=17,noexport localbase \
			pkgconfig python:build desktop-file-utils

But there is also a problem folks are runing into for
use of LLVM 18 or before for www/chromium , www/firefox ,
mail/thunderbird or the like: the version of ld.lld
involved proves to be insufficient . . .

ld.lld: error: obj/third_party/rust/cxx/v1/lib/libcxx_lib.rlib(libcxx_lib.cxx.3689637c63fce5c7-cgu.0.rcgu.o): Invalid attribute group entry (Producer: 'LLVM19.1.1-rust-1.82.0-stable' Reader: 'LLVM 18.1.8')

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')

This is because lang/rust used its internal LLVM 19 and older
linkers used for www/chromium , www/firefox , mail/thunderbird
need not be able to handle output from newer LLVM versions
used in lang/rust. The above are examples of that issue.

It leads me to wonder if lang/rust should be using an external
devel/llvm* by default, set to match a default ports tree
LLVM to be used for major ports that involve lang/rust use.


NOTE: This might have some implications for lang/rust use
by parts of FreeBSD itself.

===
Mark Millard
marklmi at yahoo.com