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

Binary not working on Raspbian (armv7l)? #123

Open
cip123 opened this issue Jan 14, 2023 · 1 comment
Open

Binary not working on Raspbian (armv7l)? #123

cip123 opened this issue Jan 14, 2023 · 1 comment

Comments

@cip123
Copy link

cip123 commented Jan 14, 2023

Hello, I am trying to run the arm7 binary on Raspbian GNU/Linux 11 (bullseye) and I am running into the following error

bash: ./openbooks_linux_arm: cannot execute binary file: Exec format error

Am I missing something? Isn't it supposed to work on a Raspberry Pi?

@Destreyf
Copy link

Destreyf commented Feb 4, 2023

@cip123 From what I can see on the build command (here) the arm version is built for arm64.

I'm not 100% sure, but I was under the impression that the armv7l is a 32bit, which would be why it cannot be run on that particular processor. Which Pi is this on?

It's possible to build for armv7 but I'm not sure if the resulting executable will run, here's some basic instructions:

# Get the repo at the 4.5.0 tag
git clone -b v4.5.0 https://github.com/evan-buss/openbooks.git openbooks
cd openbooks

Here's the commands I was able to run on my machine to cross compile to 32bit armv7.

# Build web ui assets
cd server/app
npm install
npm run build
cd ../../cmd/openbooks

# Build golang binary
env GOARCH=arm GOARM=7 GOOS=linux go build -o ../../build/openbooks_linux_armv7

Some notes, from attempting to build, openbooks is currently using nodejs v18 (LTS/Hydrogen), I was able to build using golang v1.19.3.

My output file has the following file openbooks_linux_armv7 data:

openbooks_linux_armv7: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, Go BuildID=o_IShGsCC4TvxpOPTfEq/1dWHVVefK_TpC8RlrxB_/EycU46G9JFhGg1AH9dxG/49FYgAO10g-ICsuJ5yu4, with debug_info, not stripped

The executable is ~16MB but I do not have a arm v7 system to test with so I don't know if the executable actually builds/runs correctly.

Hopefully this helps, if the armv7 builds work, it may be worth it to open a pull request with changes to the build system to include the armv7 build, but that's upto the community and ultimately @evan-buss to decide on supporting.

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

2 participants