-
Notifications
You must be signed in to change notification settings - Fork 124
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
No Linux ARM64 executable for "serial". Install script doesn't detect and flag the situation. #189
Comments
Workaround: Run it via Terminal on MacOS, you'll get the error but you can override it through your settings, privacy, ignoring the security warning. (Click the question mark on your MacOS "refuse to open" dialog for more info). Naturally, make sure that you first install android-platform-tools on Homebrew on your Mac. |
I appreciate the thought, but I didn't have trouble installing on macOS. Ran into this when trying to do a reinstall via a different platform (Linux on ARM64) as I was trying to solve a problem (which turned out to be issue #151). So reported b/c there's no serial executable for someone doing a native install on that platform (not a Mac VM), and no alert in the install script that it's not going to work (the install script could know that). |
Great, I wasn't able to make it happen at first, my workaround was through a VM but that didn't work as you stated. Just happy I was able to fix it on my own here. Working my way through learning new stuff here... |
ah yea it would be worth adding a notification about arm based linux to the install script (a good pull request even!). For now are you able to compile serial by hand and run it that way? |
Had a go at this (never compiled any rust before), got an executable out of it, but it won't make the Orbic reboot - stuck there during install. Not a problem for me as I'd installed with the Mac prior to this. |
Tried again (with a little more info) to build serial for ARM64. I got some kind of executable out of it, but it appears the platform-tools that's getting downloaded is x86. I could be wrong, but that would make sense. |
I played around with this yesterday and was able to build a functional ARM64 binary for Linux on my x86_64 machine and an arm64 machine with these changes: diff --git a/.cargo/config.toml b/.cargo/config.toml
index 318eb3d..559d0d0 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -2,6 +2,10 @@
linker = "arm-linux-gnueabihf-gcc"
rustflags = ["-C", "target-feature=+crt-static"]
+[target.aarch64-unknown-linux-gnu]
+linker = "aarch64-unknown-linux-gnu-gcc"
+rustflags = ["-C", "target-feature=+crt-static"]
+
# optimizations to reduce the binary size
[profile.release]
strip = true create with import <nixpkgs>
{
crossSystem = {
config = "aarch64-unknown-linux-gnu";
};
};
mkShell {
buildInputs = [
glibc.static
stdenv
gcc
];
inputsFrom = [glibc cargo];
} rayhunter/serial % nix-shell
rayhunter/serial $ cargo build --release --target aarch64-unknown-linux-gnu
[snip]
Finished `release` profile ...
rayhunter/serial $ file ../target/aarch64-unknown-linux-gnu/release/serial
../target/aarch64-unknown-linux-gnu/release/serial: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=fe8ff210d5be764a36204ad09208b484a93f123f, for GNU/Linux 3.10.0, with debug_info, not stripped I confirmed that the serial binary works to put the device into debug mode and reboots it with I was also able to just run rayhunter/serial % rustup target add aarch64-unknown-linux-gnu
rayhunter/serial % cargo build --release --target aarch64-unknown-linux-gnu I learned nix for this, someone more familiar with nix could probably help make this more robust. I also have used it to build armv7l-unknown-linux-gnueabihf targets. I haven't been able to get it working with Note, this will install gcc from source, but only the first time. |
You'll need rustup installed on your system, that's not handled in nix ^ -- and ofc you'll need nix. |
Honestly though we may be able to sidestep needing gcc for the serial binary now that libusb is gone. I'll poke around. |
Trying to install on a Ubuntu VM on Apple Silicon (ARM64):
./install-common.sh: line 20: ./serial-ubuntu-latest/serial: cannot execute binary file: Exec format error
The text was updated successfully, but these errors were encountered: