Cross compilation error fixed by explicitly passing sysroot


I'm working on a little Raspberry PI fun project. For this I've set up cargo to produce cross-compiled binaries for my PI3 following the instructions here:

And that works just great!

Now I wanted to add the ableton-link crate found here:

However this bombed on me with error-messages similar to what is discussed here:

With my limited understanding of the cross-toolchain setup I think what basically happens is that clang, which is ultimately used to spit out code that produces the binding between rust and the C-interface the binding created for the C++ library, uses my host sysroot - and falls flat on it's face.

I was able to fix this issue by explicitly passing the sysroot of the arm toolchain on my system that is used following the above cross compile setup. You can see the necessary changes here:

Now comes my question: this obviously is a hack. I also have a hard time believing that this is the way it should be - that the author of must specify this kind of flags, given that quite a few of my many dependencies seem to work just fine (e.g. nanomsg).

So my question is: what to do to fix this proper, so I can create a pull request for the betterment of the state of the Rust ecosystem?


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.