Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross-compile for aarch64-linux-gnu #532

Open
arya-pathak opened this issue Apr 26, 2024 · 0 comments
Open

Cross-compile for aarch64-linux-gnu #532

arya-pathak opened this issue Apr 26, 2024 · 0 comments

Comments

@arya-pathak
Copy link

arya-pathak commented Apr 26, 2024

Has this crate successfully been compiled for aarch64-linux-gnu? I have installed the crate, switched to nightly, added the target and wrote a build script. Here are the contents of build.rs:

fn main() {
    println!("cargo:rustc-link-lib=gdal");
}

The crates seem to be compiling fine but it breaks at the linking stage. The compiled C binaries of GDAL are for the x86_64 target. Error message:

  = note: /usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: skipping incompatible /lib/../lib/libgdal.so when searching for -lgdal
          /usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: skipping incompatible /lib/../lib/libgdal.a when searching for -lgdal
          /usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: skipping incompatible /usr/lib/../lib/libgdal.so when searching for -lgdal
          /usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: skipping incompatible /usr/lib/../lib/libgdal.a when searching for -lgdal
          /usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: skipping incompatible /lib/libgdal.so when searching for -lgdal
          /usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: skipping incompatible /lib/libgdal.a when searching for -lgdal
          /usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: skipping incompatible /usr/lib/libgdal.so when searching for -lgdal
          /usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: skipping incompatible /usr/lib/libgdal.a when searching for -lgdal
          /usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: cannot find -lgdal: No such file or directory
          /usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: skipping incompatible /lib/../lib/libgdal.so when searching for -lgdal
          /usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: skipping incompatible /usr/lib/../lib/libgdal.so when searching for -lgdal
          /usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: skipping incompatible /lib/libgdal.so when searching for -lgdal
          /usr/lib/gcc-cross/aarch64-linux-gnu/11/../../../../aarch64-linux-gnu/bin/ld: skipping incompatible /usr/lib/libgdal.so when searching for -lgdal
          collect2: error: ld returned 1 exit status

More details on the issue can be found here.

How can I fix this?

cc: @rkshthrmsh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant