To simplify building 32-bit binaries on 64-bit system, we can supply a cross-compilation file which provides the relevant compiler flags and settings needed - '-m32' compile/link flag, and appropriate PKG_CONFIG_LIBDIR value. This latter setting will depend upon the layout format of the particular OS/distro in use, so initially add a cross file with paths set for Debian or Ubuntu systems.
Signed-off-by: Bruce Richardson <bruce.richard...@intel.com> --- The generation of 32-bit cross-files for other distros is left as an exercise for the reader! I suspect that for Fedora/RHEL and Arch variants that only the "pkg_config_libdir" and "libdir" setting should be adjusted. However, I don't currently have a machine set up to test that assumption, so getting the ball rolling for now with just this patch to get feedback. --- config/x86/cross-debian-32bit | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 config/x86/cross-debian-32bit diff --git a/config/x86/cross-debian-32bit b/config/x86/cross-debian-32bit new file mode 100644 index 0000000000..2f6e4714cb --- /dev/null +++ b/config/x86/cross-debian-32bit @@ -0,0 +1,22 @@ +[binaries] +c = 'cc' +cpp = 'c++' +ar = 'ar' +strip = 'strip' +pkg-config = 'pkg-config' + +[host_machine] +system = 'linux' +cpu_family = 'x86' +cpu = 'native' +endian = 'little' + +[properties] +pkg_config_libdir = '/usr/lib/i386-linux-gnu/pkgconfig' + +[built-in options] +c_args = '-m32' +c_link_args = '-m32' +cpp_args = '-m32' +cpp_link_args = '-m32' +libdir = 'lib/i386-linux-gnu' -- 2.43.0