Skip to content

Failure to pass structure to external function by value on PowerPC #52297

Closed
@hhesse87

Description

@hhesse87

We have a project which makes use of the grpcio crate and want to port this from amd64 to embedded armv7 and powerpc targets. Everythings works as expected on armv7 but we get segmentation faults when calling into gRPC on powerpc, both on the actual target as well as within QEMU.

We use the armv7-unknown-linux-gnuabihf and powerpc-unknown-linux-gnu targets of rust/LLVM and the compilers shipped as crossbuild-essential-{armhf,powerpc} in Debian Stretch to build the C code and link the final executable.

We have isolated the problem to passing a structure to an external function by value and have created the attached reproducer as a minimal example triggering the issue on powerpc but working correctly on amd64 and armv7. (The reproducer also fails when the C function is compiled using Clang 3.8 as shipped with Debian.)

reproducer.tar.gz

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationC-bugCategory: This is a bug.O-PowerPCTarget: PowerPC processorsT-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