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

Exec format failure even when using build_helper=qemu? #48348

Closed
ghost opened this issue Jan 23, 2024 · 1 comment
Closed

Exec format failure even when using build_helper=qemu? #48348

ghost opened this issue Jan 23, 2024 · 1 comment

Comments

@ghost
Copy link

ghost commented Jan 23, 2024

Hello, while i was cross-compiling neko for aarch64 i found out that the package wouldn't build because of the following error:

FAILED: bin/test.n /builddir/neko-2.3.0/build/bin/test.n
cd /builddir/neko-2.3.0/src && LD_LIBRARY_PATH=/builddir/neko-2.3.0/build/bin NEKOPATH=/builddir/neko-2.3.0/build/bin /builddir/neko-2.3.0/build/bin/neko /builddir/neko-2.3.0/build/bin/nekoc.n
tools/test.neko && /usr/libexec/xbps-src/bin/cmake -E copy tools/test.n /builddir/neko-2.3.0/build/bin && /usr/libexec/xbps-src/bin/cmake -E remove tools/test.n
/bin/sh: line 1: /builddir/neko-2.3.0/build/bin/neko: cannot execute binary file: Exec format error

From what i know, Exec format error means that you are trying to run a binary on the wrong architecture, so my guess was that while cross-building, the package tried to run the output aarch64 binary on x86_64.
With this in mind i tried adding build_helper="qemu" to my template, since as the manual says "sets additional variables for the cmake and meson build styles to allow executing cross-compiled binaries inside qemu." but this didn't change anything and i still get the same Exec format error.

If it helps somehow, this is the output of using file on the binary:
masterdir/builddir/neko-2.3.0/build/bin/neko: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=0a0af44a623fcda62165dafa047cb407d167f28f, for GNU/Linux 3.7.0, not stripped

@sgn
Copy link
Member

sgn commented Jan 24, 2024

You may want to read the commit message of chewing/libchewing@7d8ee49

In order to do that, the command must start with
a target built by CMake.

IOW, this is broken https://github.com/HaxeFoundation/neko/blob/c852db0004dafb21515b51ef0c79fd927a74b005/CMakeLists.txt#L437

@sgn sgn closed this as completed Jan 24, 2024
@sgn sgn closed this as not planned Won't fix, can't repro, duplicate, stale Jan 24, 2024
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