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

scripts/build: fix meson cross-compiling #2367

Merged
merged 1 commit into from
Jan 1, 2018

Conversation

CvH
Copy link
Member

@CvH CvH commented Dec 30, 2017

fixed meson build system usage while cross compiling

on behave of @Kwiboo
@lrusak pls have a look, fixed it for me

Without meson is not able to cross compile packages for different archs and creates errors like

Traceback (most recent call last):
  File "/builddir/toolchain/lib/python3.6/site-packages/meson-0.42.1-py3.6.egg/mesonbuild/mesonmain.py", line 353, in run
    app.generate()
  File "/builddir/toolchain/lib/python3.6/site-packages/meson-0.42.1-py3.6.egg/mesonbuild/mesonmain.py", line 148, in generate
    self._generate(env)
  File "/builddir/toolchain/lib/python3.6/site-packages/meson-0.42.1-py3.6.egg/mesonbuild/mesonmain.py", line 188, in _generate
    intr = interpreter.Interpreter(b, g)
  File "/builddir/toolchain/lib/python3.6/site-packages/meson-0.42.1-py3.6.egg/mesonbuild/interpreter.py", line 1338, in __init__
    self.parse_project()
  File "/builddir/toolchain/lib/python3.6/site-packages/meson-0.42.1-py3.6.egg/mesonbuild/interpreterbase.py", line 134, in parse_project
    self.evaluate_codeblock(self.ast, end=1)
  File "/builddir/toolchain/lib/python3.6/site-packages/meson-0.42.1-py3.6.egg/mesonbuild/interpreterbase.py", line 170, in evaluate_codeblock
    raise e
  File "/builddir/toolchain/lib/python3.6/site-packages/meson-0.42.1-py3.6.egg/mesonbuild/interpreterbase.py", line 164, in evaluate_codeblock
    self.evaluate_statement(cur)
  File "/builddir/toolchain/lib/python3.6/site-packages/meson-0.42.1-py3.6.egg/mesonbuild/interpreterbase.py", line 175, in evaluate_statement
    return self.function_call(cur)
  File "/builddir/toolchain/lib/python3.6/site-packages/meson-0.42.1-py3.6.egg/mesonbuild/interpreterbase.py", line 385, in function_call
    return self.funcs[func_name](node, self.flatten(posargs), kwargs)
  File "/builddir/toolchain/lib/python3.6/site-packages/meson-0.42.1-py3.6.egg/mesonbuild/interpreterbase.py", line 55, in wrapped
    return f(self, node, args, kwargs)
  File "/builddir/toolchain/lib/python3.6/site-packages/meson-0.42.1-py3.6.egg/mesonbuild/interpreterbase.py", line 77, in wrapped
    return f(s, node_or_state, args, kwargs)
  File "/builddir/toolchain/lib/python3.6/site-packages/meson-0.42.1-py3.6.egg/mesonbuild/interpreter.py", line 1789, in func_project
    self.add_languages(proj_langs, True)
  File "/builddir/toolchain/lib/python3.6/site-packages/meson-0.42.1-py3.6.egg/mesonbuild/interpreter.py", line 1906, in add_languages
    (comp, cross_comp) = self.detect_compilers(lang, need_cross_compiler)
  File "/builddir/toolchain/lib/python3.6/site-packages/meson-0.42.1-py3.6.egg/mesonbuild/interpreter.py", line 1875, in detect_compilers
    comp.sanity_check(self.environment.get_scratch_dir(), self.environment)
  File "/builddir/toolchain/lib/python3.6/site-packages/meson-0.42.1-py3.6.egg/mesonbuild/compilers/c.py", line 235, in sanity_check
    return self.sanity_check_impl(work_dir, environment, 'sanitycheckc.c', code)
  File "/builddir/toolchain/lib/python3.6/site-packages/meson-0.42.1-py3.6.egg/mesonbuild/compilers/c.py", line 228, in sanity_check_impl
    pe = subprocess.Popen(cmdlist)
  File "/builddir/toolchain/lib/python3.6/subprocess.py", line 709, in __init__
    restore_signals, start_new_session)
  File "/builddir/toolchain/lib/python3.6/subprocess.py", line 1344, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/builddir/libmpdclient-2.13/.armv7ve-libreelec-linux-gnueabi/meson-private/sanitycheckc.exe'

@lrusak
Copy link
Member

lrusak commented Dec 30, 2017

@CvH although I don't really like it it will have to do for now until meson matures and hopefully can specify a cross another way. Would you mind putting in a comment above about why this is needed 👍

@CvH
Copy link
Member Author

CvH commented Jan 1, 2018

@lrusak updated

@CvH CvH mentioned this pull request Jan 1, 2018
@chewitt chewitt merged commit faecb9f into LibreELEC:master Jan 1, 2018
@CvH CvH deleted the 9.0-meson-cross branch January 1, 2018 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants