Skip to content

LLVM ERROR: Do not know how to split the result of this operator! #90088

Open
@glandium

Description

@glandium

There is a family of errors related to splitting that happen when building Firefox for android. I haven't managed to get a usefully reduced testcase. The gist of it is that it involves -Clinker-plugin-lto and linking being done outside cargo, between C/C++ and rust code with the i686-linux-android or x86_64-linux-android targets. The former fails with LLVM ERROR: Do not know how to split the result of this operator!, and the latter with LLVM ERROR: Cannot select: 0x7fa32221e808: v16i8 = X86ISD::PSHUFB 0x7fa323d69d40, 0x7fa2ca5946d8, /rustc/d9aa28767287670df6cf823b94629122e04442c0/library/core/src/../../stdarch/crates/core_arch/src/x86/ssse3.rs:80:15 (...), and seems to be related to the lack of target-features in the LLVM-IR emitted by rust (that is, building my own rustc with this condition changed to true fixes the issue).

It seems to me rustc should always emit target-features, especially when using -Clinker-plugin-lto, where the LLVM that will read the LLVM bytecode doesn't necessarily have the same target definitions that rustc has.

This is how this can be reproduced:

  • hg clone https://hg.mozilla.org/mozilla-unified or git clone https://github.com/mozilla/gecko-dev
  • cd mozilla-unified or cd gecko-dev
  • mkdir ~/.mozbuild
  • ./mach --no-interactive bootstrap --application-choice mobile_android (this might fail to install openjdk-8-jdk-headless depending on your distro, you might need to find and install it yourself, and try again)
  • Restart your shell and return in the mozilla-unified or gecko-dev directory.
  • Edit mozconfig to uncomment ac_add_options --target=i686 and add ac_add_options MOZ_LTO=cross
  • Run rustup target add i686-linux-android
  • ./mach build

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-LTOArea: Link-time optimization (LTO)C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions