From 0868bc1e64b16fbd07d004a514d9ace3c52a0bd6 Mon Sep 17 00:00:00 2001 From: Bert van der Weerd Date: Tue, 21 Nov 2023 16:25:34 +0100 Subject: [PATCH] fix issue #1665 - use correct rust target --- patches/rust-gentoo-musl.patch | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 patches/rust-gentoo-musl.patch diff --git a/patches/rust-gentoo-musl.patch b/patches/rust-gentoo-musl.patch new file mode 100644 index 0000000..adb8814 --- /dev/null +++ b/patches/rust-gentoo-musl.patch @@ -0,0 +1,27 @@ +diff --git a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure +index 7a2fd1ae70..7abdcaa2c1 100644 +--- a/build/moz.configure/rust.configure ++++ b/build/moz.configure/rust.configure +@@ -404,11 +404,21 @@ def detect_rustc_target( + if len(narrowed) == 1: + return narrowed[0].rust_target + +- # Finally, see if the vendor can be used to disambiguate. ++ # See if the vendor can be used to disambiguate. + narrowed = [c for c in candidates if c.target.vendor == host_or_target.vendor] + if len(narrowed) == 1: + return narrowed[0].rust_target + ++ # Finally, check for vendor gentoo in the target triple. ++ vendor_aliases = {"unknown": ("gentoo")} ++ narrowed = [ ++ c ++ for c in candidates ++ if host_or_target.vendor in vendor_aliases.get(c.target.vendor, ()) ++ ] ++ if len(narrowed) == 1: ++ return narrowed[0].rust_target ++ + return None + + rustc_target = find_candidate(candidates) \ No newline at end of file