Subject: fix 'cannot execute binary' error Bug: 151266 Tags: cross diff -rupN a/gio/meson.build b/gio/meson.build --- a/gio/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/gio/meson.build 2023-08-07 02:01:33.032059941 +0300 @@ -997,7 +997,7 @@ glib_compile_resources = executable('gli # Cannot override those programs in cross compilation case because they are # native executables that cannot be run on the build machine. # See https://gitlab.gnome.org/GNOME/glib/issues/1859. -if meson.can_run_host_binaries() +if meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' meson.override_find_program('glib-compile-schemas', glib_compile_schemas) meson.override_find_program('glib-compile-resources', glib_compile_resources) meson.override_find_program('gio-querymodules', gio_querymodules) diff -rupN a/gio/tests/meson.build b/gio/tests/meson.build --- a/gio/tests/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/gio/tests/meson.build 2023-08-07 02:01:40.950161310 +0300 @@ -613,7 +613,7 @@ if installed_tests_enabled endforeach endif -if meson.can_run_host_binaries() +if meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' compiler_type = '--compiler=@0@'.format(cc.get_id()) diff -rupN a/glib/gnulib/gl_cv_cc_double_expbit0/meson.build b/glib/gnulib/gl_cv_cc_double_expbit0/meson.build --- a/glib/gnulib/gl_cv_cc_double_expbit0/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/glib/gnulib/gl_cv_cc_double_expbit0/meson.build 2023-08-07 02:05:38.103290099 +0300 @@ -71,7 +71,7 @@ int main () gl_cv_cc_double_expbit0_word = -1 gl_cv_cc_double_expbit0_bit = -1 -if meson.can_run_host_binaries() +if meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' run_result = cc.run(double_exponent_test, name : 'where to find the exponent in a \'double\'') if run_result.compiled() and run_result.returncode() == 0 diff -rupN a/glib/gnulib/gl_cv_func_frexpl_works/meson.build b/glib/gnulib/gl_cv_func_frexpl_works/meson.build --- a/glib/gnulib/gl_cv_func_frexpl_works/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/glib/gnulib/gl_cv_func_frexpl_works/meson.build 2023-08-07 02:06:32.450255730 +0300 @@ -104,7 +104,7 @@ int main() } ''' -if meson.can_run_host_binaries() +if meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' run_result = cc.run(frexpl_test, name : 'frexpl works', dependencies : [libm]) diff -rupN a/glib/gnulib/gl_cv_func_frexp_works/meson.build b/glib/gnulib/gl_cv_func_frexp_works/meson.build --- a/glib/gnulib/gl_cv_func_frexp_works/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/glib/gnulib/gl_cv_func_frexp_works/meson.build 2023-08-07 02:05:16.958361266 +0300 @@ -76,7 +76,7 @@ int main() return result; }''' -if meson.can_run_host_binaries() +if meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' run_result = cc.run(frexp_test, name : 'frexp works', dependencies : [libm]) diff -rupN a/glib/gnulib/gl_cv_func_ldexpl_works/meson.build b/glib/gnulib/gl_cv_func_ldexpl_works/meson.build --- a/glib/gnulib/gl_cv_func_ldexpl_works/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/glib/gnulib/gl_cv_func_ldexpl_works/meson.build 2023-08-07 02:07:31.356127343 +0300 @@ -33,7 +33,7 @@ int main() } ''' -if meson.can_run_host_binaries() +if meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' run_result = cc.run(ldexpl_test, name : 'ldexpl works', dependencies : [libm]) diff -rupN a/glib/gnulib/gl_cv_func_printf_directive_a/meson.build b/glib/gnulib/gl_cv_func_printf_directive_a/meson.build --- a/glib/gnulib/gl_cv_func_printf_directive_a/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/glib/gnulib/gl_cv_func_printf_directive_a/meson.build 2023-08-07 02:07:00.353563291 +0300 @@ -79,7 +79,7 @@ glibc_printf_directive_a_test = ''' int main () { return 0; } ''' -if meson.can_run_host_binaries() +if meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' run_result = cc.run(printf_directive_a_test, name : 'printf supports the \'a\' and \'A\' directives') gl_cv_func_printf_directive_a = run_result.compiled() and run_result.returncode() == 0 diff -rupN a/glib/gnulib/gl_cv_func_printf_directive_f/meson.build b/glib/gnulib/gl_cv_func_printf_directive_f/meson.build --- a/glib/gnulib/gl_cv_func_printf_directive_f/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/glib/gnulib/gl_cv_func_printf_directive_f/meson.build 2023-08-07 02:06:18.573583911 +0300 @@ -29,7 +29,7 @@ int main () } ''' -if meson.can_run_host_binaries() +if meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' run_result = cc.run(printf_directive_f_test, name : 'printf supports the \'F\' directive') gl_cv_func_printf_directive_f = run_result.compiled() and run_result.returncode() == 0 diff -rupN a/glib/gnulib/gl_cv_func_printf_directive_ls/meson.build b/glib/gnulib/gl_cv_func_printf_directive_ls/meson.build --- a/glib/gnulib/gl_cv_func_printf_directive_ls/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/glib/gnulib/gl_cv_func_printf_directive_ls/meson.build 2023-08-07 02:07:11.930786522 +0300 @@ -62,7 +62,7 @@ int main () } ''' -if meson.can_run_host_binaries() +if meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' run_result = cc.run(printf_directive_ls_test, name : 'printf supports the \'ls\' directive') gl_cv_func_printf_directive_ls = run_result.compiled() and run_result.returncode() == 0 diff -rupN a/glib/gnulib/gl_cv_func_printf_enomem/meson.build b/glib/gnulib/gl_cv_func_printf_enomem/meson.build --- a/glib/gnulib/gl_cv_func_printf_enomem/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/glib/gnulib/gl_cv_func_printf_enomem/meson.build 2023-08-07 02:06:02.307485126 +0300 @@ -54,7 +54,7 @@ int main() } ''' -if meson.can_run_host_binaries() +if meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' run_result = cc.run(printf_enomem_test, name : 'printf survives out-of-memory conditions') gl_cv_func_printf_enomem = run_result.compiled() and run_result.returncode() == 0 diff -rupN a/glib/gnulib/gl_cv_func_printf_flag_grouping/meson.build b/glib/gnulib/gl_cv_func_printf_flag_grouping/meson.build --- a/glib/gnulib/gl_cv_func_printf_flag_grouping/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/glib/gnulib/gl_cv_func_printf_flag_grouping/meson.build 2023-08-07 02:07:20.348767473 +0300 @@ -20,7 +20,7 @@ int main () return 0; }''' -if meson.can_run_host_binaries() +if meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' run_result = cc.run(printf_flag_grouping_test, name : 'printf supports the grouping flag') gl_cv_func_printf_flag_grouping = run_result.compiled() and run_result.returncode() == 0 diff -rupN a/glib/gnulib/gl_cv_func_printf_flag_leftadjust/meson.build b/glib/gnulib/gl_cv_func_printf_flag_leftadjust/meson.build --- a/glib/gnulib/gl_cv_func_printf_flag_leftadjust/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/glib/gnulib/gl_cv_func_printf_flag_leftadjust/meson.build 2023-08-07 02:05:50.940211391 +0300 @@ -22,7 +22,7 @@ int main () } ''' -if meson.can_run_host_binaries() +if meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' run_result = cc.run(printf_flag_leftadjust_test, name : 'printf supports the left-adjust flag correctly') gl_cv_func_printf_flag_leftadjust = run_result.compiled() and run_result.returncode() == 0 diff -rupN a/glib/gnulib/gl_cv_func_printf_flag_zero/meson.build b/glib/gnulib/gl_cv_func_printf_flag_zero/meson.build --- a/glib/gnulib/gl_cv_func_printf_flag_zero/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/glib/gnulib/gl_cv_func_printf_flag_zero/meson.build 2023-08-07 02:05:07.690583921 +0300 @@ -23,7 +23,7 @@ int main () } ''' -if meson.can_run_host_binaries() +if meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' run_result = cc.run(printf_flag_zero_test, name : 'printf supports the zero flag correctly') gl_cv_func_printf_flag_zero = run_result.compiled() and run_result.returncode() == 0 diff -rupN a/glib/gnulib/gl_cv_func_printf_infinite/meson.build b/glib/gnulib/gl_cv_func_printf_infinite/meson.build --- a/glib/gnulib/gl_cv_func_printf_infinite/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/glib/gnulib/gl_cv_func_printf_infinite/meson.build 2023-08-07 02:07:39.524168214 +0300 @@ -77,7 +77,7 @@ int main () } ''' -if meson.can_run_host_binaries() +if meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' run_result = cc.run(printf_infinite_double_test, name : 'printf supports infinite \'double\' arguments') gl_cv_func_printf_infinite = run_result.compiled() and run_result.returncode() == 0 diff -rupN a/glib/gnulib/gl_cv_func_printf_infinite_long_double/meson.build b/glib/gnulib/gl_cv_func_printf_infinite_long_double/meson.build --- a/glib/gnulib/gl_cv_func_printf_infinite_long_double/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/glib/gnulib/gl_cv_func_printf_infinite_long_double/meson.build 2023-08-07 02:07:51.531288247 +0300 @@ -167,7 +167,7 @@ int main () ''' if gl_cv_func_printf_long_double - if meson.can_run_host_binaries() + if meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' run_result = cc.run(printf_infinite_long_double_test, name : 'printf supports infinite \'long double\' arguments') gl_cv_func_printf_infinite_long_double = (run_result.compiled() and run_result.returncode() == 0) diff -rupN a/glib/gnulib/gl_cv_func_printf_long_double/meson.build b/glib/gnulib/gl_cv_func_printf_long_double/meson.build --- a/glib/gnulib/gl_cv_func_printf_long_double/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/glib/gnulib/gl_cv_func_printf_long_double/meson.build 2023-08-07 02:05:26.066176958 +0300 @@ -30,7 +30,7 @@ int main () } ''' -if meson.can_run_host_binaries() +if meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' run_result = cc.run(printf_long_double_test, name : 'printf supports \'long double\' arguments') gl_cv_func_printf_long_double = run_result.compiled() and run_result.returncode() == 0 diff -rupN a/glib/gnulib/gl_cv_func_printf_precision/meson.build b/glib/gnulib/gl_cv_func_printf_precision/meson.build --- a/glib/gnulib/gl_cv_func_printf_precision/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/glib/gnulib/gl_cv_func_printf_precision/meson.build 2023-08-07 02:06:41.358119249 +0300 @@ -37,7 +37,7 @@ int main () } ''' -if meson.can_run_host_binaries() +if meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' run_result = cc.run(printf_precision_test, name : 'printf supports large precisions') gl_cv_func_printf_precision = run_result.compiled() and run_result.returncode() == 0 diff -rupN a/glib/tests/meson.build b/glib/tests/meson.build --- a/glib/tests/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/glib/tests/meson.build 2023-08-07 02:01:54.206982512 +0300 @@ -375,7 +375,7 @@ executable('testing-helper', 'testing-he ) # some testing of gtester functionality -if meson.can_run_host_binaries() and host_system != 'windows' +if meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' and host_system != 'windows' xmllint = find_program('xmllint', required: false) if xmllint.found() tmpsample_xml = custom_target('tmpsample.xml', diff -rupN a/gmodule/meson.build b/gmodule/meson.build --- a/gmodule/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/gmodule/meson.build 2023-08-07 02:01:26.643591782 +0300 @@ -25,7 +25,7 @@ if g_module_impl == 'G_MODULE_IMPL_DL' if cc.get_id() == 'msvc' or cc.get_id() == 'clang-cl' message('Building for MSVC: assuming that symbols are prefixed with underscore') g_module_need_uscore = 1 - elif meson.can_run_host_binaries() + elif meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' # FIXME: communicate result via stdout instead of return value, so non-0 return is not printed in bold red rres = cc.run(dlopen_dlsym_test_code, dependencies : libdl_dep, diff -rupN a/meson.build b/meson.build --- a/meson.build 2022-08-06 01:24:47.000000000 +0300 +++ b/meson.build 2023-08-07 01:56:50.379826829 +0300 @@ -15,7 +15,7 @@ if have_cxx cxx = meson.get_compiler('cpp') endif -cc_can_run = meson.can_run_host_binaries() +cc_can_run = meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' if cc.get_argument_syntax() == 'msvc' # Ignore several spurious warnings for things glib does very commonly @@ -119,7 +119,7 @@ installed_tests_template = files('tests/ installed_tests_template_tap = files('tests/template-tap.test.in') # Don’t build the tests unless we can run them (either natively, in an exe wrapper, or by installing them for later use) -build_tests = get_option('tests') and (meson.can_run_host_binaries() or installed_tests_enabled) +build_tests = get_option('tests') and (meson.can_run_host_binaries() and host_machine.cpu_family() != 'e2k' or installed_tests_enabled) # Allow the tests to be easily run under valgrind using --setup=valgrind valgrind = find_program('valgrind', required: false)