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

meson 1.6.1 cross compiling: Could not invoke sanity test executable #14151

Open
trantien1997 opened this issue Jan 17, 2025 · 4 comments
Open

Comments

@trantien1997
Copy link

trantien1997 commented Jan 17, 2025

I am cross-compiling glib packages with meson. After upgrading to meson 1.6.1 I see the following error:

-----
Sanity check compile stderr:

-----
Running test binary command:  /home/sw/build/objs/armv7_common/glib/meson-private/sanitycheckc.exe

../../../../../glib/meson.build:1:0: ERROR: Could not invoke sanity test executable: [Errno 8] Exec format error: '/home/sw/build/objs/armv7_common/glib/meson-private/sanitycheckc.exe'.

This is my libcxx.ini:

c = '/usr/bin/arm-linux-gnueabi-gcc'
cpp = '/usr/bin/arm-linux-gnueabi-g++'
ar = '/usr/bin/arm-linux-gnueabi-ar'
strip = '/usr/bin/arm-linux-gnueabi-strip'
pkg-config = '/usr/bin/arm-linux-gnueabi-pkg-config'  # Thay thế pkgconfig
ld = '/usr/bin/arm-linux-gnueabi-ld'
cmake = '/usr/bin/cmake'
ninja = '/usr/bin/ninja'

[host_machine]
system = 'linux'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'

[built-in options]
# Compiler flags
c_args = [
    '-march=armv7-a', '-mabi=aapcs-linux', '-msoft-float',
    '-O2', '-fPIC', '-fPIE', '-fno-omit-frame-pointer',
    '-mapcs-frame', '-mno-sched-prolog', '-D__GLIBC__', '-D_FILE_OFFSET_BITS=64']
cpp_args = [
    '-stdlib=libc++', '-march=armv7-a', '-mabi=aapcs-linux',
    '-msoft-float', '-O2', '-fPIC', '-fPIE', '-fno-omit-frame-pointer',
    '-mapcs-frame', '-mno-sched-prolog', '-D__GLIBC__', '-D_FILE_OFFSET_BITS=64']

c_link_args = [
    '-march=armv7-a', '-mabi=aapcs-linux', '-msoft-float',
    '-fPIC', '-fPIE', '-pie']
cpp_link_args = [
    '-stdlib=libc++', '-march=armv7-a', '-mabi=aapcs-linux',
    '-msoft-float', '-fPIC', '-fPIE', '-pie']

# Tùy chọn skip sanity check
; skip_sanity_check = true

And I changed

[host_machine]
system = 'linux'
cpu_family = 'arm'
cpu = 'armv7-a'
endian = 'little'

I get error when I run meson compile -C. The errors are presented in meson-log.txt

meson-log.txt

Could you please help me check and fix libcxx.ini

@thesamesam
Copy link
Collaborator

Passing things like -D__GLIBC__ is a bit suspicious/odd.

Anyway, for your actual issue, can you show the full log from meson setup? It looks like you don't have an exe-wrapper setup, but you need one for glib/gobject-introspection?

What version of Meson worked before? Does it work if you downgrade to it now?

@trantien1997
Copy link
Author

trantien1997 commented Jan 20, 2025

Passing things like -D__GLIBC__ is a bit suspicious/odd.

Anyway, for your actual issue, can you show the full log from meson setup? It looks like you don't have an exe-wrapper setup, but you need one for glib/gobject-introspection?

What version of Meson worked before? Does it work if you downgrade to it now?

Hi @thesamesam
I don't know why meson gen condition to check the size of char:

Image
I think the condition is true will be that sizeof(char) >= 1
Currently I need to upgrade glib from 2.50 to 2.83 (old version use autoconfig but new version switch to meson tool)

@thesamesam
Copy link
Collaborator

I wouldn't overthink the char thing -- if anything, it's a useful proxy for whether we can compile anything at all. Can you answer my questions from earlier?

@eli-schwartz
Copy link
Member

The meson-log.txt that you uploaded doesn't appear to be the one that was for your cross build with the error. There's nothing to analyze there...

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

3 participants