You are not logged in.

#1 2020-07-14 03:06:33

pentomasis
Member
Registered: 2019-10-17
Posts: 15

Cross-compiling Rust for Pinephone [aarch64-unknown-linux-gnu]

Hello,
I am trying to cross-compile the examples from the Relm crate. I got the gcc cross-compiler and added the target via rustup

sudo pacman -S aarch64-linux-gnu-gcc
rustup target add aarch64-unknown-linux-gnu

Compiling the hello world example and running it on the Pinephone worked like a charm. When I try to compile the examples of the Relm crate with
PKG_CONFIG_ALLOW_CROSS=1 cargo build --examples --target=aarch64-unknown-linux-gnu
I get multiple errors

= note: /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgtk-3
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgdk-3
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lz
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lpangocairo-1.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lpango-1.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lharfbuzz
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -latk-1.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lcairo-gobject
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lcairo
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgdk_pixbuf-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgio-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgobject-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lglib-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -latk-1.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgobject-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lglib-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgdk-3
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lz
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lpangocairo-1.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lpango-1.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lharfbuzz
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgdk_pixbuf-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lcairo-gobject
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lcairo
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgobject-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lglib-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lpango-1.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgobject-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lglib-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lharfbuzz
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgdk_pixbuf-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgobject-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lglib-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgio-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgobject-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lglib-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgobject-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lglib-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lcairo-gobject
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lcairo
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgobject-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lglib-2.0
          /usr/lib/gcc/aarch64-linux-gnu/10.1.0/../../../../aarch64-linux-gnu/bin/ld: cannot find -lglib-2.0
          collect2: error: ld returned 1 exit status

How can I get it to cross-compile?
Thank you for your help smile

Offline

#2 2020-07-18 00:49:12

pentamassiv
Member
Registered: 2020-07-17
Posts: 2

Re: Cross-compiling Rust for Pinephone [aarch64-unknown-linux-gnu]

Hi,
you need to add the missing libraries. Usually this can be done by installing a package that provides these libraries. Unfortunately aarch64-linux-gnu-gtk3 is not available in the repos. I am trying to publish it to the AUR but I am a beginner myself so it might take a long time. In the meantime check out the solution in this thread at the Pinephone Forum.

Offline

Board footer

Powered by FluxBB