DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] config: add 32-bit cross-compilation x86 target
@ 2024-09-04 13:57 Bruce Richardson
  2024-09-06 15:34 ` Medvedkin, Vladimir
  2024-09-06 16:12 ` [PATCH v2 0/4] simplify doing 32-bit DPDK builds Bruce Richardson
  0 siblings, 2 replies; 7+ messages in thread
From: Bruce Richardson @ 2024-09-04 13:57 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

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.richardson@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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] config: add 32-bit cross-compilation x86 target
  2024-09-04 13:57 [PATCH] config: add 32-bit cross-compilation x86 target Bruce Richardson
@ 2024-09-06 15:34 ` Medvedkin, Vladimir
  2024-09-06 16:12 ` [PATCH v2 0/4] simplify doing 32-bit DPDK builds Bruce Richardson
  1 sibling, 0 replies; 7+ messages in thread
From: Medvedkin, Vladimir @ 2024-09-06 15:34 UTC (permalink / raw)
  To: Bruce Richardson, dev

Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>

On 04/09/2024 14:57, Bruce Richardson wrote:
> 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.richardson@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'

-- 
Regards,
Vladimir


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 0/4] simplify doing 32-bit DPDK builds
  2024-09-04 13:57 [PATCH] config: add 32-bit cross-compilation x86 target Bruce Richardson
  2024-09-06 15:34 ` Medvedkin, Vladimir
@ 2024-09-06 16:12 ` Bruce Richardson
  2024-09-06 16:12   ` [PATCH v2 1/4] config: add 32-bit x86 debian cross-compilation file Bruce Richardson
                     ` (3 more replies)
  1 sibling, 4 replies; 7+ messages in thread
From: Bruce Richardson @ 2024-09-06 16:12 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

To make it easier to build and test DPDK on 32-bit x86 add a set of
cross-compile ini files for a number of common linux distributions.
This avoids the user having to remember strange meson incantations
with '-m32' in various args values and with the PKG_CONFIG_LIBDIR
overridden in the environment.

Bruce Richardson (4):
  config: add 32-bit x86 debian cross-compilation file
  config: add fedora 32-bit x86 cross-compile file
  config: add arch 32-bit cross-compilation file
  devtools/test-meson-builds: use cross files for 32bit build

 config/x86/cross-32bit-arch.ini   | 22 ++++++++++++++++++++++
 config/x86/cross-32bit-debian.ini | 22 ++++++++++++++++++++++
 config/x86/cross-32bit-fedora.ini | 22 ++++++++++++++++++++++
 devtools/test-meson-builds.sh     | 13 +++++--------
 4 files changed, 71 insertions(+), 8 deletions(-)
 create mode 100644 config/x86/cross-32bit-arch.ini
 create mode 100644 config/x86/cross-32bit-debian.ini
 create mode 100644 config/x86/cross-32bit-fedora.ini

--
2.43.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/4] config: add 32-bit x86 debian cross-compilation file
  2024-09-06 16:12 ` [PATCH v2 0/4] simplify doing 32-bit DPDK builds Bruce Richardson
@ 2024-09-06 16:12   ` Bruce Richardson
  2024-09-06 16:12   ` [PATCH v2 2/4] config: add fedora 32-bit x86 cross-compile file Bruce Richardson
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Bruce Richardson @ 2024-09-06 16:12 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson, Vladimir Medvedkin

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.

Note, unlike previous cross files, this file has a .ini extension which
means that editors use correct syntax highlighting on it.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
---
 config/x86/cross-32bit-debian.ini | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 config/x86/cross-32bit-debian.ini

diff --git a/config/x86/cross-32bit-debian.ini b/config/x86/cross-32bit-debian.ini
new file mode 100644
index 0000000000..2f6e4714cb
--- /dev/null
+++ b/config/x86/cross-32bit-debian.ini
@@ -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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 2/4] config: add fedora 32-bit x86 cross-compile file
  2024-09-06 16:12 ` [PATCH v2 0/4] simplify doing 32-bit DPDK builds Bruce Richardson
  2024-09-06 16:12   ` [PATCH v2 1/4] config: add 32-bit x86 debian cross-compilation file Bruce Richardson
@ 2024-09-06 16:12   ` Bruce Richardson
  2024-09-06 16:12   ` [PATCH v2 3/4] config: add arch 32-bit cross-compilation file Bruce Richardson
  2024-09-06 16:12   ` [PATCH v2 4/4] devtools/test-meson-builds: use cross files for 32bit build Bruce Richardson
  3 siblings, 0 replies; 7+ messages in thread
From: Bruce Richardson @ 2024-09-06 16:12 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Add cross-compilation target for building 32-bit x86 DPDK on Fedora or
RHEL.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/x86/cross-32bit-fedora.ini | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 config/x86/cross-32bit-fedora.ini

diff --git a/config/x86/cross-32bit-fedora.ini b/config/x86/cross-32bit-fedora.ini
new file mode 100644
index 0000000000..fd407cc7fb
--- /dev/null
+++ b/config/x86/cross-32bit-fedora.ini
@@ -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/pkgconfig'
+
+[built-in options]
+c_args = '-m32'
+c_link_args = '-m32'
+cpp_args = '-m32'
+cpp_link_args = '-m32'
+libdir = 'lib'
-- 
2.43.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 3/4] config: add arch 32-bit cross-compilation file
  2024-09-06 16:12 ` [PATCH v2 0/4] simplify doing 32-bit DPDK builds Bruce Richardson
  2024-09-06 16:12   ` [PATCH v2 1/4] config: add 32-bit x86 debian cross-compilation file Bruce Richardson
  2024-09-06 16:12   ` [PATCH v2 2/4] config: add fedora 32-bit x86 cross-compile file Bruce Richardson
@ 2024-09-06 16:12   ` Bruce Richardson
  2024-09-06 16:12   ` [PATCH v2 4/4] devtools/test-meson-builds: use cross files for 32bit build Bruce Richardson
  3 siblings, 0 replies; 7+ messages in thread
From: Bruce Richardson @ 2024-09-06 16:12 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

Add a 32-bit cross file for x86 for Arch linux

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 config/x86/cross-32bit-arch.ini | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 config/x86/cross-32bit-arch.ini

diff --git a/config/x86/cross-32bit-arch.ini b/config/x86/cross-32bit-arch.ini
new file mode 100644
index 0000000000..b88244d1ef
--- /dev/null
+++ b/config/x86/cross-32bit-arch.ini
@@ -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/lib32/pkgconfig'
+
+[built-in options]
+c_args = '-m32'
+c_link_args = '-m32'
+cpp_args = '-m32'
+cpp_link_args = '-m32'
+libdir = 'lib32'
-- 
2.43.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 4/4] devtools/test-meson-builds: use cross files for 32bit build
  2024-09-06 16:12 ` [PATCH v2 0/4] simplify doing 32-bit DPDK builds Bruce Richardson
                     ` (2 preceding siblings ...)
  2024-09-06 16:12   ` [PATCH v2 3/4] config: add arch 32-bit cross-compilation file Bruce Richardson
@ 2024-09-06 16:12   ` Bruce Richardson
  3 siblings, 0 replies; 7+ messages in thread
From: Bruce Richardson @ 2024-09-06 16:12 UTC (permalink / raw)
  To: dev; +Cc: Bruce Richardson

When testing the 32-bit x86 build, use a cross-file rather than using
args and pkgconfig environment variable. The advantage of using the
cross-file is that the paths are saved across runs. Without this patch,
while the '-m32' args settings are preserved between meson runs, the
PKG_CONFIG_LIBDIR value from environment is not, which can cause
rebuilds of the build-32b directory to fail if meson needs to do
a reconfiguration first.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 devtools/test-meson-builds.sh | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index d71bb1ded0..4fff1f7177 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -253,21 +253,18 @@ build build-x86-generic cc skipABI -Dcheck_includes=true \
 
 # 32-bit with default compiler
 if check_cc_flags '-m32' ; then
+	target_override='i386-pc-linux-gnu'
 	if [ -d '/usr/lib/i386-linux-gnu' ] ; then
-		# 32-bit pkgconfig on Debian/Ubuntu
-		export PKG_CONFIG_LIBDIR='/usr/lib/i386-linux-gnu/pkgconfig'
+		# 32-bit pkgconfig on Debian/Ubuntu, use cross file
+		build build-32b $srcdir/config/x86/cross-32bit-debian.ini ABI
 	elif [ -d '/usr/lib32' ] ; then
 		# 32-bit pkgconfig on Arch
-		export PKG_CONFIG_LIBDIR='/usr/lib32/pkgconfig'
+		build build-32b $srcdir/config/x86/cross-32bit-arch.ini ABI
 	else
 		# 32-bit pkgconfig on RHEL/Fedora (lib vs lib64)
-		export PKG_CONFIG_LIBDIR='/usr/lib/pkgconfig'
+		build build-32b $srcdir/config/x86/cross-32bit-fedora.ini ABI
 	fi
-	target_override='i386-pc-linux-gnu'
-	build build-32b cc ABI -Dc_args='-m32' -Dc_link_args='-m32' \
-			-Dcpp_args='-m32' -Dcpp_link_args='-m32'
 	target_override=
-	unset PKG_CONFIG_LIBDIR
 fi
 
 # x86 MinGW
-- 
2.43.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-09-06 16:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-04 13:57 [PATCH] config: add 32-bit cross-compilation x86 target Bruce Richardson
2024-09-06 15:34 ` Medvedkin, Vladimir
2024-09-06 16:12 ` [PATCH v2 0/4] simplify doing 32-bit DPDK builds Bruce Richardson
2024-09-06 16:12   ` [PATCH v2 1/4] config: add 32-bit x86 debian cross-compilation file Bruce Richardson
2024-09-06 16:12   ` [PATCH v2 2/4] config: add fedora 32-bit x86 cross-compile file Bruce Richardson
2024-09-06 16:12   ` [PATCH v2 3/4] config: add arch 32-bit cross-compilation file Bruce Richardson
2024-09-06 16:12   ` [PATCH v2 4/4] devtools/test-meson-builds: use cross files for 32bit build Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).