'scripting error in cross compiling in get_flex_version.py

While cross compiling gstreamer using meson (meson build-cross-arm64 --cross-file=cross.txt --buildtype=debug --strip -Dgtk_doc=disabled -Dtests=disabled -Dexamples=disabled ), I have encountered the following error

In the terminal:

gst/parse/meson.build:10:0: ERROR: Command "/home/xxx/Git/gstreamer/gst/parse/get_flex_version.py /opt/xxx/sysroots/aarch64-poky-linux/usr/bin/flex" failed with status 2

I suspect the above error is due to scripting, by examining the following lines in the meson-log.txt

meson-log.txt:

/opt/xxx/sysroots/aarch64-poky-linux/usr/bin/python3: 1: /opt/xxx/sysroots/aarch64-poky-linux/usr/bin/python3: Syntax error: word unexpected (expecting ")")

Prior to compilation, I have exported my path to allow it to include where flex is located in the cross compiler

export PATH="/opt/xxx/sysroots/aarch64-poky-linux/usr/bin:$PATH"

Wondering what is the script error? The cross tool chain is using Python 3.5 though


Edit: (to provide more information)

Seem like this line in meson build having problem

flexversion_res = run_command([get_flex_version, flex], check: true)

print out

Message: flex is <ExternalProgram 'flex' -> ['/opt/xxx/sysroots/aarch64-poky-linux/usr/bin/flex']>

Message: flex version is <ExternalProgram 'get_flex_version.py' -> ['/home/xxx/Git/gstreamer/gst/parse/get_flex_version.py']>

Edit No;2 (to provide more information)

when I further investigate, the flex (/opt/xxx/sysroots/aarch64-poky-linux/usr/bin/flex) which i have given is of

flex: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.14.0, BuildID[sha1]=8a793f63a547f413f9e60e10873b6e1f815f0a38, stripped

I am cross compiling on a intel machine with ubuntu OS(Linux 5.4.0-99-generic #112~18.04.1-Ubuntu SMP Thu Feb 3 14:09:57 UTC 2022) for an arm embedded board. wonder do i need a python or bash which is arm compiled?

Regards

Regards



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source