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

Midir crosscompilation not possible #58

Open
atoav opened this issue May 26, 2020 · 2 comments
Open

Midir crosscompilation not possible #58

atoav opened this issue May 26, 2020 · 2 comments

Comments

@atoav
Copy link

atoav commented May 26, 2020

I am not sure if this is a bug or just my own fault, but I can't crosscompile for a raspberry pi when midir is a dependency (it works just fine if I comment it out in Cargo.toml).

The problem seems to happen at the linker stage (warning, really long!):

error: linking with `arm-linux-gnueabihf-gcc` failed: exit code: 1
  |
  = note: "arm-linux-gnueabihf-gcc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-L" "/home/d0/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib" "/home/d0/Coding/work/midi_to_trigger/target/arm-unknown-linux-gnueabihf/debug/deps/midi_to_trigger-8e6e7ed081b07421.25syr1jzb3exvk4y.rcgu.o" "/home/d0/Coding/work/midi_to_trigger/target/arm-unknown-linux-gnueabihf/debug/deps/midi_to_trigger-8e6e7ed081b07421.2hfogt1f3dulz1n8.rcgu.o" "/home/d0/Coding/work/midi_to_trigger/target/arm-unknown-linux-gnueabihf/debug/deps/midi_to_trigger-8e6e7ed081b07421.2kwzfdj7r6e7gc1x.rcgu.o" "/home/d0/Coding/work/midi_to_trigger/target/arm-unknown-linux-gnueabihf/debug/deps/midi_to_trigger-8e6e7ed081b07421.3lwv1peyt9qjersl.rcgu.o" "/home/d0/Coding/work/midi_to_trigger/target/arm-unknown-linux-gnueabihf/debug/deps/midi_to_trigger-8e6e7ed081b07421.4z41z2gtkawr4vib.rcgu.o" "/home/d0/Coding/work/midi_to_trigger/target/arm-unknown-linux-gnueabihf/debug/deps/midi_to_trigger-8e6e7ed081b07421.8nly3lsfi38ubgi.rcgu.o" "-o" "/home/d0/Coding/work/midi_to_trigger/target/arm-unknown-linux-gnueabihf/debug/deps/midi_to_trigger-8e6e7ed081b07421" "/home/d0/Coding/work/midi_to_trigger/target/arm-unknown-linux-gnueabihf/debug/deps/midi_to_trigger-8e6e7ed081b07421.17xjcw3dr7n7ptsr.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/home/d0/Coding/work/midi_to_trigger/target/arm-unknown-linux-gnueabihf/debug/deps" "-L" "/home/d0/Coding/work/midi_to_trigger/target/debug/deps" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/home/d0/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/home/d0/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libstd-95f5053e3555b465.rlib" "/home/d0/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libpanic_unwind-625d9a5dfe06f142.rlib" "/home/d0/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libhashbrown-4bdaee786b6ecc2f.rlib" "/home/d0/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/librustc_std_workspace_alloc-4896b2c7440385ff.rlib" "/home/d0/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libbacktrace-359913043371f425.rlib" "/home/d0/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libbacktrace_sys-3189fe54f33ba5a6.rlib" "/home/d0/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/librustc_demangle-278e49f56bc4aa04.rlib" "/home/d0/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libunwind-932bef4eba16b4ec.rlib" "/home/d0/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libcfg_if-d2a28b76ca5161ed.rlib" "/home/d0/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/liblibc-0bb253fb21b3c0c3.rlib" "/home/d0/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/liballoc-933869c77bd04128.rlib" "/home/d0/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/librustc_std_workspace_core-9b29881a4cdf4184.rlib" "/home/d0/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libcore-a7e5328f57a93d46.rlib" "-Wl,--end-group" "/home/d0/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/arm-unknown-linux-gnueabihf/lib/libcompiler_builtins-ce2041e567e5f109.rlib" "-Wl,-Bdynamic" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
  = note: /usr/lib/x86_64-linux-gnu/libdl.so: file not recognized: File format not recognized
          collect2: error: ld returned 1 exit status

I managed to compile the same thing directly on the target hardware, but it takes forever and speeding it up would be really convinient. Any ideas?

@Boddlnagg
Copy link
Owner

I have no idea what's going on there ... I'm not an expert with linking on Linux. It seems weird to me, though, that the -ldl flag passed to the ARM linker makes the linker try to load /usr/lib/x86_64-linux-gnu/libdl.so (note the x86_64) ...

@atoav
Copy link
Author

atoav commented May 28, 2020

Sadly I don't have too much experience with linkers myself, so I can't help. But it would be very cool to be able to cross compile midir to ARM targets as this would be a natural match for all kind of midi manipulators, controllers, etc. For example I am currently working on something that converts MIDI notes to modular synth/eurorack gates via GPIO.

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

No branches or pull requests

2 participants