Skip to content

Mulitple issues compiling for arm-unknown-linux-gnueabihf (armv6hf) #874

@Trayshar

Description

@Trayshar

Checklist

Describe your issue

I have multiple issues compiling for arm-unknown-linux-gnueabihf. Building my project yields

thread 'main' panicked at 'Unable to find libudev: Failure { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"libudev\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package libudev was not found in the pkg-config search path.\nPerhaps you should add the directory containing libudev.pc into the PKG_CONFIG_PATH environment variable\nNo package \'libudev\' found\n" } }'

libudev-dev is installed correctly inside the image. Re-adding the lineENV PKG_CONFIG_PATH="/usr/lib/arm-linux-gnueabihf/pkgconfig/:${PKG_CONFIG_PATH}" that was removed in #734 to my own Dockerfile fixes this for me, but leaves me with another error:

warning: etc/hidapi/linux/hid.c:44:10: fatal error: libudev.h: No such file or directory
warning:  #include <libudev.h>
warning:           ^~~~~~~~~~~
warning: compilation terminated.

I solved this by copying the header file into /x-tools/arm-unknown-linux-gnueabihf/arm-unknown-linux-gnueabihf/sysroot/usr/include/libudev.h. I believe that this is not a good solution. Is there a way to fix this in the base dockerfile itself?

What target(s) are you cross-compiling for?

aarch64-unknown-linux-gnu, arm-unknown-linux-gnueabihf, armv7-unknown-linux-gnueabihf, i686-unknown-linux-gnu, x86_64-unknown-linux-gnu

Which operating system is the host (e.g computer cross is on) running?

  • macOS
  • Windows
  • Linux / BSD
  • other OS (specify in description)

What architecture is the host?

  • x86_64 / AMD64
  • arm32
  • arm64 (including Mac M1)

What container engine is cross using?

  • docker
  • podman
  • other container engine (specify in description)

cross version

cross 0.22.0

Example

No response

Additional information / notes

All other architectures(armv7, aarch64, i686, x86) build without issues with just some commands to install "libudev-dev" in the pre-built section of my Cross.toml file, e.g.:

[target.armv7-unknown-linux-gnueabihf]
pre-build = [
    "dpkg --add-architecture armhf",
    "apt-get update",
    "apt-get install -y libudev-dev:armhf"
]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions