* [dpdk-dev] [PATCH V1] add meson build 32-bits on x86_64
@ 2020-04-22 9:48 xueming
2020-04-22 11:12 ` Bruce Richardson
0 siblings, 1 reply; 4+ messages in thread
From: xueming @ 2020-04-22 9:48 UTC (permalink / raw)
To: dev, thomas; +Cc: zhaoyan.chen, lihongx.ma, xueming
Add user interaction features. The default build is 64-bits.
if you want to build 32-bits on x86_64, need to pass parameters of i686.
Merge -vv and -v into the method
Signed-off-by: xueming <xuemingx.zhang@intel.com>
---
devtools/test-meson-builds.sh | 64 +++++++++++++++++++++++++++++++----
1 file changed, 58 insertions(+), 6 deletions(-)
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index e8df01759..215fc00e1 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -14,6 +14,27 @@ set -o | grep -q pipefail && set -o pipefail && PIPEFAIL=1
srcdir=$(dirname $(readlink -f $0))/..
. $srcdir/devtools/load-devel-config
+i686=false
+print_usage ()
+{
+ echo "Usage: ./$(basename $0) [-h] [OPTIONS]..."
+
+ echo '''
+ The script default build is 64-bits.
+
+ if you want to build 32-bits on x86_64, need to pass parameters of i686.
+
+ OPTIONS:
+
+ i686 build 32-bits on x86_64
+ eg: ./devtools/test-meson-build.sh i686
+
+ -vv meson build show more detail
+
+ -v meson build show details
+ '''
+}
+
MESON=${MESON:-meson}
use_shared="--default-library=shared"
builds_dir=${DPDK_BUILD_TEST_DIR:-.}
@@ -37,6 +58,36 @@ else
CCACHE=
fi
+shift $(($OPTIND - 1))
+
+if [ "$#" -ge 1 ]; then
+ for i in $@; do
+ case "$i" in
+ "i686")
+ i686=true
+ ;;
+ "x86_64")
+ echo "Use x86_64"
+ ;;
+ "-vv")
+ TEST_MESON_BUILD_VERY_VERBOSE=1
+ ;;
+ "-v")
+ TEST_MESON_BUILD_VERBOSE=1
+ ;;
+ "-h")
+ print_usage
+ exit 1
+ ;;
+ *)
+ echo "Invalid mode: $1"
+ print_usage
+ exit 1
+ ;;
+ esac
+ done
+fi
+
default_path=$PATH
default_pkgpath=$PKG_CONFIG_PATH
default_cppflags=$CPPFLAGS
@@ -51,7 +102,13 @@ load_env () # <target compiler>
export CPPFLAGS=$default_cppflags
export CFLAGS=$default_cflags
export LDFLAGS=$default_ldflags
- unset DPDK_MESON_OPTIONS
+ if [ "$i686" = "true" ]; then
+ CFLAGS='-m32'
+ export DPDK_MESON_OPTIONS="c_args=-m32 c_link_args=-m32"
+ export PKG_CONFIG_LIBDIR=$default_pkgpath
+ else
+ unset DPDK_MESON_OPTIONS
+ fi
command -v $targetcc >/dev/null 2>&1 || return 1
DPDK_TARGET=$($targetcc -v 2>&1 | sed -n 's,^Target: ,,p')
. $srcdir/devtools/load-devel-config
@@ -156,11 +213,6 @@ build () # <directory> <target compiler> <meson options>
fi
}
-if [ "$1" = "-vv" ] ; then
- TEST_MESON_BUILD_VERY_VERBOSE=1
-elif [ "$1" = "-v" ] ; then
- TEST_MESON_BUILD_VERBOSE=1
-fi
# we can't use plain verbose when we don't have pipefail option so up-level
if [ -z "$PIPEFAIL" -a -n "$TEST_MESON_BUILD_VERBOSE" ] ; then
echo "# Missing pipefail shell option, changing VERBOSE to VERY_VERBOSE"
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH V1] add meson build 32-bits on x86_64
2020-04-22 9:48 [dpdk-dev] [PATCH V1] add meson build 32-bits on x86_64 xueming
@ 2020-04-22 11:12 ` Bruce Richardson
2020-04-23 8:23 ` Zhang, XuemingX
0 siblings, 1 reply; 4+ messages in thread
From: Bruce Richardson @ 2020-04-22 11:12 UTC (permalink / raw)
To: xueming; +Cc: dev, thomas, zhaoyan.chen, lihongx.ma
On Wed, Apr 22, 2020 at 09:48:54AM +0000, xueming wrote:
> Add user interaction features. The default build is 64-bits.
> if you want to build 32-bits on x86_64, need to pass parameters of i686.
> Merge -vv and -v into the method
>
> Signed-off-by: xueming <xuemingx.zhang@intel.com>
> ---
> devtools/test-meson-builds.sh | 64 +++++++++++++++++++++++++++++++----
> 1 file changed, 58 insertions(+), 6 deletions(-)
>
I'm wondering if this would be better done using a cross-file, rather than
overriding a bunch of environment variables - the pkg-config one would be
especially relevant. A separate cross-file could be used for debian-based
and fedora-based OS's with correct 32-bit paths and parameters in each.
What do you think?
/Bruce
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH V1] add meson build 32-bits on x86_64
2020-04-22 11:12 ` Bruce Richardson
@ 2020-04-23 8:23 ` Zhang, XuemingX
2020-11-06 17:59 ` Thomas Monjalon
0 siblings, 1 reply; 4+ messages in thread
From: Zhang, XuemingX @ 2020-04-23 8:23 UTC (permalink / raw)
To: Richardson, Bruce; +Cc: dev, thomas, Chen, Zhaoyan, Ma, LihongX
Many thanks Bruce,
Your suggestion is very good, I will try to do it
>-----Original Message-----
>From: Bruce Richardson [mailto:bruce.richardson@intel.com]
>Sent: Wednesday, April 22, 2020 7:12 PM
>To: Zhang, XuemingX <xuemingx.zhang@intel.com>
>Cc: dev@dpdk.org; thomas@monjalon.net; Chen, Zhaoyan
><zhaoyan.chen@intel.com>; Ma, LihongX <lihongx.ma@intel.com>
>Subject: Re: [dpdk-dev] [PATCH V1] add meson build 32-bits on x86_64
>
>On Wed, Apr 22, 2020 at 09:48:54AM +0000, xueming wrote:
>> Add user interaction features. The default build is 64-bits.
>> if you want to build 32-bits on x86_64, need to pass parameters of i686.
>> Merge -vv and -v into the method
>>
>> Signed-off-by: xueming <xuemingx.zhang@intel.com>
>> ---
>> devtools/test-meson-builds.sh | 64
>> +++++++++++++++++++++++++++++++----
>> 1 file changed, 58 insertions(+), 6 deletions(-)
>>
>I'm wondering if this would be better done using a cross-file, rather than
>overriding a bunch of environment variables - the pkg-config one would be
>especially relevant. A separate cross-file could be used for debian-based
>and fedora-based OS's with correct 32-bit paths and parameters in each.
>
>What do you think?
>
>/Bruce
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH V1] add meson build 32-bits on x86_64
2020-04-23 8:23 ` Zhang, XuemingX
@ 2020-11-06 17:59 ` Thomas Monjalon
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2020-11-06 17:59 UTC (permalink / raw)
To: Richardson, Bruce, Zhang, XuemingX; +Cc: dev, Chen, Zhaoyan, Ma, LihongX
23/04/2020 10:23, Zhang, XuemingX:
> From: Bruce Richardson [mailto:bruce.richardson@intel.com]
> >On Wed, Apr 22, 2020 at 09:48:54AM +0000, xueming wrote:
> >> Add user interaction features. The default build is 64-bits.
> >> if you want to build 32-bits on x86_64, need to pass parameters of i686.
> >> Merge -vv and -v into the method
> >>
> >> Signed-off-by: xueming <xuemingx.zhang@intel.com>
> >> ---
> >I'm wondering if this would be better done using a cross-file, rather than
> >overriding a bunch of environment variables - the pkg-config one would be
> >especially relevant. A separate cross-file could be used for debian-based
> >and fedora-based OS's with correct 32-bit paths and parameters in each.
> >
> >What do you think?
> >
> Many thanks Bruce,
> Your suggestion is very good, I will try to do it
Eventually the approach of this patch has been merged:
http://git.dpdk.org/dpdk/commit/?id=9b83106d
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-11-06 17:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-22 9:48 [dpdk-dev] [PATCH V1] add meson build 32-bits on x86_64 xueming
2020-04-22 11:12 ` Bruce Richardson
2020-04-23 8:23 ` Zhang, XuemingX
2020-11-06 17:59 ` Thomas Monjalon
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).