Skip to content

powerpc{,64,64le} clang triplet includes elfv{1,2} with rust 1.90.0 #1581

@sertonix

Description

@sertonix

Recently firefox started failing to compile on powerpc with errors like warning: [email protected]: clang-20: error: version 'elfv2' in target triple 'powerpc64le-alpine-linux-muslelfv2' is invalid.

If I understood the issue correctly this happens since rust-lang/rust#142321 cause elfv2 (and elfv1) are appended to the target triplet when creating the clang target.

This patch fixed compilation of firefox but I would like advice if this is the right way to fix the compilation failure. One thing I wondered is if -mabi=elfv1 and -mabi=elfv2 should be passed explicitly to ensure the compiler uses the correct abi.

--- a/third_party/rust/cc/src/target/llvm.rs
+++ b/third_party/rust/cc/src/target/llvm.rs
@@ -98,6 +98,7 @@
             "llvm" | "softfloat" | "uwp" | "vec-extabi" => "",
             "ilp32" => "_ilp32",
             "abi64" => "",
+            "elfv1" | "elfv2" => "",
             abi => abi,
         };
         Cow::Owned(match (vendor, env, abi) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions