* [PATCH v5 2/6] meson: fixes relpath may fail on win32.
2020-08-26 15:10 [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja luoyonggang
@ 2020-08-26 15:10 ` luoyonggang
2020-08-26 15:10 ` [PATCH v5 3/6] meson: Mingw64 gcc doesn't recognize system include_type for sdl2 luoyonggang
` (4 subsequent siblings)
5 siblings, 0 replies; 23+ messages in thread
From: luoyonggang @ 2020-08-26 15:10 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Yonggang Luo, Daniel P . Berrangé
From: Yonggang Luo <luoyonggang@gmail.com>
On win32, os.path.relpath would raise exception when do the following relpath:
C:/msys64/mingw64/x.exe relative to E:/path/qemu-build would fail.
So we try catch it for stopping it from raise exception on msys2
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
scripts/mtest2make.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/scripts/mtest2make.py b/scripts/mtest2make.py
index bdb257bbd9..d7a51bf97e 100644
--- a/scripts/mtest2make.py
+++ b/scripts/mtest2make.py
@@ -53,9 +53,16 @@ i = 0
for test in json.load(sys.stdin):
env = ' '.join(('%s=%s' % (shlex.quote(k), shlex.quote(v))
for k, v in test['env'].items()))
- executable = os.path.relpath(test['cmd'][0])
+ executable = test['cmd'][0]
+ try:
+ executable = os.path.relpath(executable)
+ except:
+ pass
if test['workdir'] is not None:
- test['cmd'][0] = os.path.relpath(test['cmd'][0], test['workdir'])
+ try:
+ test['cmd'][0] = os.path.relpath(executable, test['workdir'])
+ except:
+ test['cmd'][0] = executable
else:
test['cmd'][0] = executable
cmd = '$(.test.env) %s %s' % (env, ' '.join((shlex.quote(x) for x in test['cmd'])))
--
2.27.0.windows.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH v5 3/6] meson: Mingw64 gcc doesn't recognize system include_type for sdl2
2020-08-26 15:10 [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja luoyonggang
2020-08-26 15:10 ` [PATCH v5 2/6] meson: fixes relpath may fail on win32 luoyonggang
@ 2020-08-26 15:10 ` luoyonggang
2020-08-26 15:10 ` [PATCH v5 4/6] configure: Fix include and linkage issue on msys2 luoyonggang
` (3 subsequent siblings)
5 siblings, 0 replies; 23+ messages in thread
From: luoyonggang @ 2020-08-26 15:10 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Yonggang Luo, Daniel P . Berrangé
From: Yonggang Luo <luoyonggang@gmail.com>
Fixes this for msys2/mingw64 by remove the include_type for sdl2 discovery in meson
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
meson.build | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index f0fe5f8799..1644bbd83c 100644
--- a/meson.build
+++ b/meson.build
@@ -224,8 +224,7 @@ if 'CONFIG_BRLAPI' in config_host
brlapi = declare_dependency(link_args: config_host['BRLAPI_LIBS'].split())
endif
-sdl = dependency('sdl2', required: get_option('sdl'), static: enable_static,
- include_type: 'system')
+sdl = dependency('sdl2', required: get_option('sdl'), static: enable_static)
sdl_image = not_found
if sdl.found()
# work around 2.0.8 bug
--
2.27.0.windows.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH v5 4/6] configure: Fix include and linkage issue on msys2
2020-08-26 15:10 [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja luoyonggang
2020-08-26 15:10 ` [PATCH v5 2/6] meson: fixes relpath may fail on win32 luoyonggang
2020-08-26 15:10 ` [PATCH v5 3/6] meson: Mingw64 gcc doesn't recognize system include_type for sdl2 luoyonggang
@ 2020-08-26 15:10 ` luoyonggang
2020-08-26 15:24 ` Paolo Bonzini
2020-08-27 16:14 ` Mark Cave-Ayland
2020-08-26 15:10 ` [PATCH v5 5/6] meson: Fixes ninjatool can not be recognized as script under Window/MSYS2 luoyonggang
` (2 subsequent siblings)
5 siblings, 2 replies; 23+ messages in thread
From: luoyonggang @ 2020-08-26 15:10 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Yonggang Luo, Daniel P . Berrangé
From: Yonggang Luo <luoyonggang@gmail.com>
On msys2, the -I/e/path/to/qemu -L/e/path/to/qemu are not recognized by the compiler
Cause $PWD are result posix style path such as /e/path/to/qemu that can not be recognized
by mingw gcc, and `pwd -W` are result Windows style path such as E:/path/to/qemu that can
be recognized by the mingw gcc. So we replace all $PWD with $build_path that can
building qemu under msys2/mingw environment.
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
configure | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/configure b/configure
index b1e11397a8..3b9e79923d 100755
--- a/configure
+++ b/configure
@@ -13,8 +13,13 @@ export CCACHE_RECACHE=yes
# make source path absolute
source_path=$(cd "$(dirname -- "$0")"; pwd)
+build_path=$PWD
+if [ "$MSYSTEM" = "MINGW64" -o "$MSYSTEM" = "MINGW32" ]; then
+source_path=$(cd "$(dirname -- "$0")"; pwd -W)
+build_path=`pwd -W`
+fi
-if test "$PWD" = "$source_path"
+if test "$build_path" = "$source_path"
then
echo "Using './build' as the directory for build output"
@@ -346,7 +351,12 @@ ld_has() {
$ld --help 2>/dev/null | grep ".$1" >/dev/null 2>&1
}
-if printf %s\\n "$source_path" "$PWD" | grep -q "[[:space:]:]";
+check_valid_build_path="[[:space:]:]"
+if [ "$MSYSTEM" = "MINGW64" -o "$MSYSTEM" = "MINGW32" ]; then
+check_valid_build_path="[[:space:]]"
+fi
+
+if printf %s\\n "$source_path" "$build_path" | grep -q "$check_valid_build_path";
then
error_exit "main directory cannot contain spaces nor colons"
fi
@@ -942,7 +952,7 @@ Linux)
linux="yes"
linux_user="yes"
kvm="yes"
- QEMU_INCLUDES="-isystem ${source_path}/linux-headers -I$PWD/linux-headers $QEMU_INCLUDES"
+ QEMU_INCLUDES="-isystem ${source_path}/linux-headers -I${build_path}/linux-headers $QEMU_INCLUDES"
libudev="yes"
;;
esac
@@ -4283,7 +4293,7 @@ EOF
symlink "$source_path/dtc/Makefile" "dtc/Makefile"
fi
fdt_cflags="-I${source_path}/dtc/libfdt"
- fdt_ldflags="-L$PWD/dtc/libfdt"
+ fdt_ldflags="-L${build_path}/dtc/libfdt"
fdt_libs="$fdt_libs"
elif test "$fdt" = "yes" ; then
# Not a git build & no libfdt found, prompt for system install
@@ -5268,7 +5278,7 @@ case "$capstone" in
else
LIBCAPSTONE=libcapstone.a
fi
- capstone_libs="-L$PWD/capstone -lcapstone"
+ capstone_libs="-L${build_path}/capstone -lcapstone"
capstone_cflags="-I${source_path}/capstone/include"
;;
@@ -6268,8 +6278,8 @@ case "$slirp" in
git_submodules="${git_submodules} slirp"
fi
mkdir -p slirp
- slirp_cflags="-I${source_path}/slirp/src -I$PWD/slirp/src"
- slirp_libs="-L$PWD/slirp -lslirp"
+ slirp_cflags="-I${source_path}/slirp/src -I${build_path}/slirp/src"
+ slirp_libs="-L${build_path}/slirp -lslirp"
if test "$mingw32" = "yes" ; then
slirp_libs="$slirp_libs -lws2_32 -liphlpapi"
fi
@@ -8212,7 +8222,7 @@ fi
mv $cross config-meson.cross
rm -rf meson-private meson-info meson-logs
-NINJA=$PWD/ninjatool $meson setup \
+NINJA="${build_path}/ninjatool" $meson setup \
--prefix "${pre_prefix}$prefix" \
--libdir "${pre_prefix}$libdir" \
--libexecdir "${pre_prefix}$libexecdir" \
@@ -8232,7 +8242,7 @@ NINJA=$PWD/ninjatool $meson setup \
-Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \
-Dgettext=$gettext -Dxkbcommon=$xkbcommon \
$cross_arg \
- "$PWD" "$source_path"
+ "$build_path" "$source_path"
if test "$?" -ne 0 ; then
error_exit "meson setup failed"
--
2.27.0.windows.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH v5 4/6] configure: Fix include and linkage issue on msys2
2020-08-26 15:10 ` [PATCH v5 4/6] configure: Fix include and linkage issue on msys2 luoyonggang
@ 2020-08-26 15:24 ` Paolo Bonzini
2020-08-26 15:33 ` 罗勇刚(Yonggang Luo)
2020-08-27 16:14 ` Mark Cave-Ayland
1 sibling, 1 reply; 23+ messages in thread
From: Paolo Bonzini @ 2020-08-26 15:24 UTC (permalink / raw)
To: luoyonggang; +Cc: Daniel P . Berrangé, qemu-devel
I'm a bit wary of this patch, the effects are quite wide-ranging. If
we move all the detection of dependencies to meson, it will take a
while but we should get a similar effect.
However, I'm testing and queuing patches 1 to 3.
Paolo
On Wed, Aug 26, 2020 at 5:13 PM <luoyonggang@gmail.com> wrote:
>
> From: Yonggang Luo <luoyonggang@gmail.com>
>
> On msys2, the -I/e/path/to/qemu -L/e/path/to/qemu are not recognized by the compiler
> Cause $PWD are result posix style path such as /e/path/to/qemu that can not be recognized
> by mingw gcc, and `pwd -W` are result Windows style path such as E:/path/to/qemu that can
> be recognized by the mingw gcc. So we replace all $PWD with $build_path that can
> building qemu under msys2/mingw environment.
>
> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
> ---
> configure | 28 +++++++++++++++++++---------
> 1 file changed, 19 insertions(+), 9 deletions(-)
>
> diff --git a/configure b/configure
> index b1e11397a8..3b9e79923d 100755
> --- a/configure
> +++ b/configure
> @@ -13,8 +13,13 @@ export CCACHE_RECACHE=yes
>
> # make source path absolute
> source_path=$(cd "$(dirname -- "$0")"; pwd)
> +build_path=$PWD
> +if [ "$MSYSTEM" = "MINGW64" -o "$MSYSTEM" = "MINGW32" ]; then
> +source_path=$(cd "$(dirname -- "$0")"; pwd -W)
> +build_path=`pwd -W`
> +fi
>
> -if test "$PWD" = "$source_path"
> +if test "$build_path" = "$source_path"
> then
> echo "Using './build' as the directory for build output"
>
> @@ -346,7 +351,12 @@ ld_has() {
> $ld --help 2>/dev/null | grep ".$1" >/dev/null 2>&1
> }
>
> -if printf %s\\n "$source_path" "$PWD" | grep -q "[[:space:]:]";
> +check_valid_build_path="[[:space:]:]"
> +if [ "$MSYSTEM" = "MINGW64" -o "$MSYSTEM" = "MINGW32" ]; then
> +check_valid_build_path="[[:space:]]"
> +fi
> +
> +if printf %s\\n "$source_path" "$build_path" | grep -q "$check_valid_build_path";
> then
> error_exit "main directory cannot contain spaces nor colons"
> fi
> @@ -942,7 +952,7 @@ Linux)
> linux="yes"
> linux_user="yes"
> kvm="yes"
> - QEMU_INCLUDES="-isystem ${source_path}/linux-headers -I$PWD/linux-headers $QEMU_INCLUDES"
> + QEMU_INCLUDES="-isystem ${source_path}/linux-headers -I${build_path}/linux-headers $QEMU_INCLUDES"
> libudev="yes"
> ;;
> esac
> @@ -4283,7 +4293,7 @@ EOF
> symlink "$source_path/dtc/Makefile" "dtc/Makefile"
> fi
> fdt_cflags="-I${source_path}/dtc/libfdt"
> - fdt_ldflags="-L$PWD/dtc/libfdt"
> + fdt_ldflags="-L${build_path}/dtc/libfdt"
> fdt_libs="$fdt_libs"
> elif test "$fdt" = "yes" ; then
> # Not a git build & no libfdt found, prompt for system install
> @@ -5268,7 +5278,7 @@ case "$capstone" in
> else
> LIBCAPSTONE=libcapstone.a
> fi
> - capstone_libs="-L$PWD/capstone -lcapstone"
> + capstone_libs="-L${build_path}/capstone -lcapstone"
> capstone_cflags="-I${source_path}/capstone/include"
> ;;
>
> @@ -6268,8 +6278,8 @@ case "$slirp" in
> git_submodules="${git_submodules} slirp"
> fi
> mkdir -p slirp
> - slirp_cflags="-I${source_path}/slirp/src -I$PWD/slirp/src"
> - slirp_libs="-L$PWD/slirp -lslirp"
> + slirp_cflags="-I${source_path}/slirp/src -I${build_path}/slirp/src"
> + slirp_libs="-L${build_path}/slirp -lslirp"
> if test "$mingw32" = "yes" ; then
> slirp_libs="$slirp_libs -lws2_32 -liphlpapi"
> fi
> @@ -8212,7 +8222,7 @@ fi
> mv $cross config-meson.cross
>
> rm -rf meson-private meson-info meson-logs
> -NINJA=$PWD/ninjatool $meson setup \
> +NINJA="${build_path}/ninjatool" $meson setup \
> --prefix "${pre_prefix}$prefix" \
> --libdir "${pre_prefix}$libdir" \
> --libexecdir "${pre_prefix}$libexecdir" \
> @@ -8232,7 +8242,7 @@ NINJA=$PWD/ninjatool $meson setup \
> -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \
> -Dgettext=$gettext -Dxkbcommon=$xkbcommon \
> $cross_arg \
> - "$PWD" "$source_path"
> + "$build_path" "$source_path"
>
> if test "$?" -ne 0 ; then
> error_exit "meson setup failed"
> --
> 2.27.0.windows.1
>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v5 4/6] configure: Fix include and linkage issue on msys2
2020-08-26 15:24 ` Paolo Bonzini
@ 2020-08-26 15:33 ` 罗勇刚(Yonggang Luo)
2020-08-26 15:36 ` Paolo Bonzini
0 siblings, 1 reply; 23+ messages in thread
From: 罗勇刚(Yonggang Luo) @ 2020-08-26 15:33 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Daniel P . Berrangé, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 4792 bytes --]
On Wed, Aug 26, 2020 at 11:24 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
> I'm a bit wary of this patch, the effects are quite wide-ranging. If
> we move all the detection of dependencies to meson, it will take a
> while but we should get a similar effect.
>
Only on MINGW the $PWD sematic are changed, so I don't think there is side
effect of this patch.
>
> However, I'm testing and queuing patches 1 to 3.
>
> Paolo
>
> On Wed, Aug 26, 2020 at 5:13 PM <luoyonggang@gmail.com> wrote:
> >
> > From: Yonggang Luo <luoyonggang@gmail.com>
> >
> > On msys2, the -I/e/path/to/qemu -L/e/path/to/qemu are not recognized by
> the compiler
> > Cause $PWD are result posix style path such as /e/path/to/qemu that can
> not be recognized
> > by mingw gcc, and `pwd -W` are result Windows style path such as
> E:/path/to/qemu that can
> > be recognized by the mingw gcc. So we replace all $PWD with $build_path
> that can
> > building qemu under msys2/mingw environment.
> >
> > Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
> > ---
> > configure | 28 +++++++++++++++++++---------
> > 1 file changed, 19 insertions(+), 9 deletions(-)
> >
> > diff --git a/configure b/configure
> > index b1e11397a8..3b9e79923d 100755
> > --- a/configure
> > +++ b/configure
> > @@ -13,8 +13,13 @@ export CCACHE_RECACHE=yes
> >
> > # make source path absolute
> > source_path=$(cd "$(dirname -- "$0")"; pwd)
> > +build_path=$PWD
> > +if [ "$MSYSTEM" = "MINGW64" -o "$MSYSTEM" = "MINGW32" ]; then
> > +source_path=$(cd "$(dirname -- "$0")"; pwd -W)
> > +build_path=`pwd -W`
> > +fi
> >
> > -if test "$PWD" = "$source_path"
> > +if test "$build_path" = "$source_path"
> > then
> > echo "Using './build' as the directory for build output"
> >
> > @@ -346,7 +351,12 @@ ld_has() {
> > $ld --help 2>/dev/null | grep ".$1" >/dev/null 2>&1
> > }
> >
> > -if printf %s\\n "$source_path" "$PWD" | grep -q "[[:space:]:]";
> > +check_valid_build_path="[[:space:]:]"
> > +if [ "$MSYSTEM" = "MINGW64" -o "$MSYSTEM" = "MINGW32" ]; then
> > +check_valid_build_path="[[:space:]]"
> > +fi
> > +
> > +if printf %s\\n "$source_path" "$build_path" | grep -q
> "$check_valid_build_path";
> > then
> > error_exit "main directory cannot contain spaces nor colons"
> > fi
> > @@ -942,7 +952,7 @@ Linux)
> > linux="yes"
> > linux_user="yes"
> > kvm="yes"
> > - QEMU_INCLUDES="-isystem ${source_path}/linux-headers
> -I$PWD/linux-headers $QEMU_INCLUDES"
> > + QEMU_INCLUDES="-isystem ${source_path}/linux-headers
> -I${build_path}/linux-headers $QEMU_INCLUDES"
> > libudev="yes"
> > ;;
> > esac
> > @@ -4283,7 +4293,7 @@ EOF
> > symlink "$source_path/dtc/Makefile" "dtc/Makefile"
> > fi
> > fdt_cflags="-I${source_path}/dtc/libfdt"
> > - fdt_ldflags="-L$PWD/dtc/libfdt"
> > + fdt_ldflags="-L${build_path}/dtc/libfdt"
> > fdt_libs="$fdt_libs"
> > elif test "$fdt" = "yes" ; then
> > # Not a git build & no libfdt found, prompt for system install
> > @@ -5268,7 +5278,7 @@ case "$capstone" in
> > else
> > LIBCAPSTONE=libcapstone.a
> > fi
> > - capstone_libs="-L$PWD/capstone -lcapstone"
> > + capstone_libs="-L${build_path}/capstone -lcapstone"
> > capstone_cflags="-I${source_path}/capstone/include"
> > ;;
> >
> > @@ -6268,8 +6278,8 @@ case "$slirp" in
> > git_submodules="${git_submodules} slirp"
> > fi
> > mkdir -p slirp
> > - slirp_cflags="-I${source_path}/slirp/src -I$PWD/slirp/src"
> > - slirp_libs="-L$PWD/slirp -lslirp"
> > + slirp_cflags="-I${source_path}/slirp/src -I${build_path}/slirp/src"
> > + slirp_libs="-L${build_path}/slirp -lslirp"
> > if test "$mingw32" = "yes" ; then
> > slirp_libs="$slirp_libs -lws2_32 -liphlpapi"
> > fi
> > @@ -8212,7 +8222,7 @@ fi
> > mv $cross config-meson.cross
> >
> > rm -rf meson-private meson-info meson-logs
> > -NINJA=$PWD/ninjatool $meson setup \
> > +NINJA="${build_path}/ninjatool" $meson setup \
> > --prefix "${pre_prefix}$prefix" \
> > --libdir "${pre_prefix}$libdir" \
> > --libexecdir "${pre_prefix}$libexecdir" \
> > @@ -8232,7 +8242,7 @@ NINJA=$PWD/ninjatool $meson setup \
> > -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg
> -Dvnc_png=$vnc_png \
> > -Dgettext=$gettext -Dxkbcommon=$xkbcommon \
> > $cross_arg \
> > - "$PWD" "$source_path"
> > + "$build_path" "$source_path"
> >
> > if test "$?" -ne 0 ; then
> > error_exit "meson setup failed"
> > --
> > 2.27.0.windows.1
> >
>
>
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
[-- Attachment #2: Type: text/html, Size: 6906 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v5 4/6] configure: Fix include and linkage issue on msys2
2020-08-26 15:33 ` 罗勇刚(Yonggang Luo)
@ 2020-08-26 15:36 ` Paolo Bonzini
2020-08-26 15:38 ` 罗勇刚(Yonggang Luo)
0 siblings, 1 reply; 23+ messages in thread
From: Paolo Bonzini @ 2020-08-26 15:36 UTC (permalink / raw)
To: luoyonggang; +Cc: Daniel P . Berrangé, qemu-devel
On Wed, Aug 26, 2020 at 5:33 PM 罗勇刚(Yonggang Luo) <luoyonggang@gmail.com> wrote:
>
>
> On Wed, Aug 26, 2020 at 11:24 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>> I'm a bit wary of this patch, the effects are quite wide-ranging. If
>> we move all the detection of dependencies to meson, it will take a
>> while but we should get a similar effect.
>
> Only on MINGW the $PWD sematic are changed, so I don't think there is side effect of this patch.
Yes the side effect is only on MINGW but the affected variables are
used everywhere so it's a rather hard to review change.
Paolo
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v5 4/6] configure: Fix include and linkage issue on msys2
2020-08-26 15:36 ` Paolo Bonzini
@ 2020-08-26 15:38 ` 罗勇刚(Yonggang Luo)
0 siblings, 0 replies; 23+ messages in thread
From: 罗勇刚(Yonggang Luo) @ 2020-08-26 15:38 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Daniel P . Berrangé, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 834 bytes --]
On Wed, Aug 26, 2020 at 11:36 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
> On Wed, Aug 26, 2020 at 5:33 PM 罗勇刚(Yonggang Luo) <luoyonggang@gmail.com>
> wrote:
> >
> >
> > On Wed, Aug 26, 2020 at 11:24 PM Paolo Bonzini <pbonzini@redhat.com>
> wrote:
> >> I'm a bit wary of this patch, the effects are quite wide-ranging. If
> >> we move all the detection of dependencies to meson, it will take a
> >> while but we should get a similar effect.
> >
> > Only on MINGW the $PWD sematic are changed, so I don't think there is
> side effect of this patch.
>
> Yes the side effect is only on MINGW but the affected variables are
> used everywhere so it's a rather hard to review change.
>
Gotcha, review it carefully
>
> Paolo
>
>
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
[-- Attachment #2: Type: text/html, Size: 1567 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v5 4/6] configure: Fix include and linkage issue on msys2
2020-08-26 15:10 ` [PATCH v5 4/6] configure: Fix include and linkage issue on msys2 luoyonggang
2020-08-26 15:24 ` Paolo Bonzini
@ 2020-08-27 16:14 ` Mark Cave-Ayland
1 sibling, 0 replies; 23+ messages in thread
From: Mark Cave-Ayland @ 2020-08-27 16:14 UTC (permalink / raw)
To: luoyonggang, qemu-devel; +Cc: Paolo Bonzini, Daniel P . Berrangé
On 26/08/2020 16:10, luoyonggang@gmail.com wrote:
> From: Yonggang Luo <luoyonggang@gmail.com>
>
> On msys2, the -I/e/path/to/qemu -L/e/path/to/qemu are not recognized by the compiler
> Cause $PWD are result posix style path such as /e/path/to/qemu that can not be recognized
> by mingw gcc, and `pwd -W` are result Windows style path such as E:/path/to/qemu that can
> be recognized by the mingw gcc. So we replace all $PWD with $build_path that can
> building qemu under msys2/mingw environment.
>
> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
> ---
> configure | 28 +++++++++++++++++++---------
> 1 file changed, 19 insertions(+), 9 deletions(-)
>
> diff --git a/configure b/configure
> index b1e11397a8..3b9e79923d 100755
> --- a/configure
> +++ b/configure
> @@ -13,8 +13,13 @@ export CCACHE_RECACHE=yes
>
> # make source path absolute
> source_path=$(cd "$(dirname -- "$0")"; pwd)
> +build_path=$PWD
> +if [ "$MSYSTEM" = "MINGW64" -o "$MSYSTEM" = "MINGW32" ]; then
This still doesn't match the existing indentation as per my previous comment.
> +source_path=$(cd "$(dirname -- "$0")"; pwd -W)
> +build_path=`pwd -W`
> +fi
>
> -if test "$PWD" = "$source_path"
> +if test "$build_path" = "$source_path"
> then
> echo "Using './build' as the directory for build output"
>
> @@ -346,7 +351,12 @@ ld_has() {
> $ld --help 2>/dev/null | grep ".$1" >/dev/null 2>&1
> }
>
> -if printf %s\\n "$source_path" "$PWD" | grep -q "[[:space:]:]";
> +check_valid_build_path="[[:space:]:]"
> +if [ "$MSYSTEM" = "MINGW64" -o "$MSYSTEM" = "MINGW32" ]; then
Same again here too.
> +check_valid_build_path="[[:space:]]"
> +fi
> +
> +if printf %s\\n "$source_path" "$build_path" | grep -q "$check_valid_build_path";
> then
> error_exit "main directory cannot contain spaces nor colons"
> fi
> @@ -942,7 +952,7 @@ Linux)
> linux="yes"
> linux_user="yes"
> kvm="yes"
> - QEMU_INCLUDES="-isystem ${source_path}/linux-headers -I$PWD/linux-headers $QEMU_INCLUDES"
> + QEMU_INCLUDES="-isystem ${source_path}/linux-headers -I${build_path}/linux-headers $QEMU_INCLUDES"
> libudev="yes"
> ;;
> esac
> @@ -4283,7 +4293,7 @@ EOF
> symlink "$source_path/dtc/Makefile" "dtc/Makefile"
> fi
> fdt_cflags="-I${source_path}/dtc/libfdt"
> - fdt_ldflags="-L$PWD/dtc/libfdt"
> + fdt_ldflags="-L${build_path}/dtc/libfdt"
> fdt_libs="$fdt_libs"
> elif test "$fdt" = "yes" ; then
> # Not a git build & no libfdt found, prompt for system install
> @@ -5268,7 +5278,7 @@ case "$capstone" in
> else
> LIBCAPSTONE=libcapstone.a
> fi
> - capstone_libs="-L$PWD/capstone -lcapstone"
> + capstone_libs="-L${build_path}/capstone -lcapstone"
> capstone_cflags="-I${source_path}/capstone/include"
> ;;
>
> @@ -6268,8 +6278,8 @@ case "$slirp" in
> git_submodules="${git_submodules} slirp"
> fi
> mkdir -p slirp
> - slirp_cflags="-I${source_path}/slirp/src -I$PWD/slirp/src"
> - slirp_libs="-L$PWD/slirp -lslirp"
> + slirp_cflags="-I${source_path}/slirp/src -I${build_path}/slirp/src"
> + slirp_libs="-L${build_path}/slirp -lslirp"
> if test "$mingw32" = "yes" ; then
> slirp_libs="$slirp_libs -lws2_32 -liphlpapi"
> fi
> @@ -8212,7 +8222,7 @@ fi
> mv $cross config-meson.cross
>
> rm -rf meson-private meson-info meson-logs
> -NINJA=$PWD/ninjatool $meson setup \
> +NINJA="${build_path}/ninjatool" $meson setup \
> --prefix "${pre_prefix}$prefix" \
> --libdir "${pre_prefix}$libdir" \
> --libexecdir "${pre_prefix}$libexecdir" \
> @@ -8232,7 +8242,7 @@ NINJA=$PWD/ninjatool $meson setup \
> -Dvnc=$vnc -Dvnc_sasl=$vnc_sasl -Dvnc_jpeg=$vnc_jpeg -Dvnc_png=$vnc_png \
> -Dgettext=$gettext -Dxkbcommon=$xkbcommon \
> $cross_arg \
> - "$PWD" "$source_path"
> + "$build_path" "$source_path"
>
> if test "$?" -ne 0 ; then
> error_exit "meson setup failed"
Is the change to this last section for the NINJA variable really required to fix
linking? It would be useful to keep the NINJA variable and executable detection fix
as a separate patch if possible.
ATB,
Mark.
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH v5 5/6] meson: Fixes ninjatool can not be recognized as script under Window/MSYS2
2020-08-26 15:10 [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja luoyonggang
` (2 preceding siblings ...)
2020-08-26 15:10 ` [PATCH v5 4/6] configure: Fix include and linkage issue on msys2 luoyonggang
@ 2020-08-26 15:10 ` luoyonggang
2020-08-26 15:10 ` [PATCH v5 6/6] meson: Convert undefsym.sh to undefsym.py luoyonggang
2020-08-26 15:28 ` [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja Paolo Bonzini
5 siblings, 0 replies; 23+ messages in thread
From: luoyonggang @ 2020-08-26 15:10 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Yonggang Luo, Daniel P . Berrangé
From: Yonggang Luo <luoyonggang@gmail.com>
use ninja instead ${build_path}/ninjatool
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index 3b9e79923d..2ad0c58492 100755
--- a/configure
+++ b/configure
@@ -8222,7 +8222,7 @@ fi
mv $cross config-meson.cross
rm -rf meson-private meson-info meson-logs
-NINJA="${build_path}/ninjatool" $meson setup \
+NINJA="ninja" $meson setup \
--prefix "${pre_prefix}$prefix" \
--libdir "${pre_prefix}$libdir" \
--libexecdir "${pre_prefix}$libexecdir" \
--
2.27.0.windows.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* [PATCH v5 6/6] meson: Convert undefsym.sh to undefsym.py
2020-08-26 15:10 [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja luoyonggang
` (3 preceding siblings ...)
2020-08-26 15:10 ` [PATCH v5 5/6] meson: Fixes ninjatool can not be recognized as script under Window/MSYS2 luoyonggang
@ 2020-08-26 15:10 ` luoyonggang
2020-08-26 15:22 ` Paolo Bonzini
2020-08-26 15:28 ` [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja Paolo Bonzini
5 siblings, 1 reply; 23+ messages in thread
From: luoyonggang @ 2020-08-26 15:10 UTC (permalink / raw)
To: qemu-devel; +Cc: Paolo Bonzini, Yonggang Luo, Daniel P . Berrangé
From: Yonggang Luo <luoyonggang@gmail.com>
undefsym.sh are not msys2 compatible, convert it to python script
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
---
meson.build | 2 +-
scripts/undefsym.py | 56 +++++++++++++++++++++++++++++++++++++++++++++
scripts/undefsym.sh | 20 ----------------
3 files changed, 57 insertions(+), 21 deletions(-)
create mode 100644 scripts/undefsym.py
delete mode 100755 scripts/undefsym.sh
diff --git a/meson.build b/meson.build
index 1644bbd83c..d6e3bcea7e 100644
--- a/meson.build
+++ b/meson.build
@@ -845,7 +845,7 @@ foreach d, list : modules
endforeach
nm = find_program('nm')
-undefsym = find_program('scripts/undefsym.sh')
+undefsym = find_program('scripts/undefsym.py')
block_syms = custom_target('block.syms', output: 'block.syms',
input: [libqemuutil, block_mods],
capture: true,
diff --git a/scripts/undefsym.py b/scripts/undefsym.py
new file mode 100644
index 0000000000..ebc009fb24
--- /dev/null
+++ b/scripts/undefsym.py
@@ -0,0 +1,56 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+# Before a shared module's DSO is produced, a static library is built for it
+# and passed to this script. The script generates -Wl,-u options to force
+# the inclusion of symbol from libqemuutil.a if the shared modules need them,
+# This is necessary because the modules may use functions not needed by the
+# executable itself, which would cause the function to not be linked in.
+# Then the DSO loading would fail because of the missing symbol.
+
+
+"""
+Compare the static library for compute the symbol duplication
+"""
+
+import sys
+import subprocess
+
+def filter_lines_set(stdout):
+ linesSet = set()
+ for line in stdout.splitlines():
+ tokens = line.split(b' ')
+ if len(tokens) >= 1:
+ if len(tokens) > 1 and tokens[1] == b'U':
+ continue
+ new_line = b'-Wl,-u,' + tokens[0]
+ if not new_line in linesSet:
+ linesSet.add(new_line)
+ return linesSet
+
+def main(args):
+ global _SCRIPT
+ print(" ".join(args), file=sys.stderr)
+ if len(args) <= 3:
+ sys.exit(0)
+
+ nm = args[1]
+ staticlib = args[2]
+ pc = subprocess.run([nm, "-P", "-g", staticlib], stdout=subprocess.PIPE)
+ if pc.returncode != 0:
+ sys.exit(-1)
+ lines_set_left = filter_lines_set(pc.stdout)
+
+ shared_modules = args[3:]
+ pc = subprocess.run([nm, "-P", "-g"] + shared_modules, stdout=subprocess.PIPE)
+ if pc.returncode != 0:
+ sys.exit(-1)
+ lines_set_right = filter_lines_set(pc.stdout)
+ lines = []
+ for line in sorted(list(lines_set_right)):
+ if line in lines_set_left:
+ lines.append(line)
+ sys.stdout.write(b'\n'.join(lines).decode())
+
+if __name__ == "__main__":
+ main(sys.argv)
diff --git a/scripts/undefsym.sh b/scripts/undefsym.sh
deleted file mode 100755
index b9ec332e95..0000000000
--- a/scripts/undefsym.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#! /usr/bin/env bash
-
-# Before a shared module's DSO is produced, a static library is built for it
-# and passed to this script. The script generates -Wl,-u options to force
-# the inclusion of symbol from libqemuutil.a if the shared modules need them,
-# This is necessary because the modules may use functions not needed by the
-# executable itself, which would cause the function to not be linked in.
-# Then the DSO loading would fail because of the missing symbol.
-
-if test $# -le 2; then
- exit 0
-fi
-
-NM=$1
-staticlib=$2
-shift 2
-# Find symbols defined in static libraries and undefined in shared modules
-comm -12 \
- <( $NM -P -g $staticlib | awk '$2!="U"{print "-Wl,-u," $1}' | sort -u) \
- <( $NM -P -g "$@" | awk '$2=="U"{print "-Wl,-u," $1}' | sort -u)
--
2.27.0.windows.1
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCH v5 6/6] meson: Convert undefsym.sh to undefsym.py
2020-08-26 15:10 ` [PATCH v5 6/6] meson: Convert undefsym.sh to undefsym.py luoyonggang
@ 2020-08-26 15:22 ` Paolo Bonzini
2020-08-26 15:27 ` 罗勇刚(Yonggang Luo)
0 siblings, 1 reply; 23+ messages in thread
From: Paolo Bonzini @ 2020-08-26 15:22 UTC (permalink / raw)
To: luoyonggang; +Cc: Daniel P . Berrangé, qemu-devel
Careful, the original script:
-comm -12 \
- <( $NM -P -g $staticlib | awk '$2!="U"{print "-Wl,-u," $1}' | sort -u) \
- <( $NM -P -g "$@" | awk '$2=="U"{print "-Wl,-u," $1}' | sort -u)
looks for lines that *are* U in the modules. So using filter_lines_set
is correct for static libraries but wrong for modules.
Paolo
On Wed, Aug 26, 2020 at 5:13 PM <luoyonggang@gmail.com> wrote:
>
> From: Yonggang Luo <luoyonggang@gmail.com>
>
> undefsym.sh are not msys2 compatible, convert it to python script
>
> Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
> ---
> meson.build | 2 +-
> scripts/undefsym.py | 56 +++++++++++++++++++++++++++++++++++++++++++++
> scripts/undefsym.sh | 20 ----------------
> 3 files changed, 57 insertions(+), 21 deletions(-)
> create mode 100644 scripts/undefsym.py
> delete mode 100755 scripts/undefsym.sh
>
> diff --git a/meson.build b/meson.build
> index 1644bbd83c..d6e3bcea7e 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -845,7 +845,7 @@ foreach d, list : modules
> endforeach
>
> nm = find_program('nm')
> -undefsym = find_program('scripts/undefsym.sh')
> +undefsym = find_program('scripts/undefsym.py')
> block_syms = custom_target('block.syms', output: 'block.syms',
> input: [libqemuutil, block_mods],
> capture: true,
> diff --git a/scripts/undefsym.py b/scripts/undefsym.py
> new file mode 100644
> index 0000000000..ebc009fb24
> --- /dev/null
> +++ b/scripts/undefsym.py
> @@ -0,0 +1,56 @@
> +#!/usr/bin/env python3
> +# -*- coding: utf-8 -*-
> +
> +# Before a shared module's DSO is produced, a static library is built for it
> +# and passed to this script. The script generates -Wl,-u options to force
> +# the inclusion of symbol from libqemuutil.a if the shared modules need them,
> +# This is necessary because the modules may use functions not needed by the
> +# executable itself, which would cause the function to not be linked in.
> +# Then the DSO loading would fail because of the missing symbol.
> +
> +
> +"""
> +Compare the static library for compute the symbol duplication
> +"""
> +
> +import sys
> +import subprocess
> +
> +def filter_lines_set(stdout):
> + linesSet = set()
> + for line in stdout.splitlines():
> + tokens = line.split(b' ')
> + if len(tokens) >= 1:
> + if len(tokens) > 1 and tokens[1] == b'U':
> + continue
> + new_line = b'-Wl,-u,' + tokens[0]
> + if not new_line in linesSet:
> + linesSet.add(new_line)
> + return linesSet
> +
> +def main(args):
> + global _SCRIPT
> + print(" ".join(args), file=sys.stderr)
> + if len(args) <= 3:
> + sys.exit(0)
> +
> + nm = args[1]
> + staticlib = args[2]
> + pc = subprocess.run([nm, "-P", "-g", staticlib], stdout=subprocess.PIPE)
> + if pc.returncode != 0:
> + sys.exit(-1)
> + lines_set_left = filter_lines_set(pc.stdout)
> +
> + shared_modules = args[3:]
> + pc = subprocess.run([nm, "-P", "-g"] + shared_modules, stdout=subprocess.PIPE)
> + if pc.returncode != 0:
> + sys.exit(-1)
> + lines_set_right = filter_lines_set(pc.stdout)
> + lines = []
> + for line in sorted(list(lines_set_right)):
> + if line in lines_set_left:
> + lines.append(line)
> + sys.stdout.write(b'\n'.join(lines).decode())
> +
> +if __name__ == "__main__":
> + main(sys.argv)
> diff --git a/scripts/undefsym.sh b/scripts/undefsym.sh
> deleted file mode 100755
> index b9ec332e95..0000000000
> --- a/scripts/undefsym.sh
> +++ /dev/null
> @@ -1,20 +0,0 @@
> -#! /usr/bin/env bash
> -
> -# Before a shared module's DSO is produced, a static library is built for it
> -# and passed to this script. The script generates -Wl,-u options to force
> -# the inclusion of symbol from libqemuutil.a if the shared modules need them,
> -# This is necessary because the modules may use functions not needed by the
> -# executable itself, which would cause the function to not be linked in.
> -# Then the DSO loading would fail because of the missing symbol.
> -
> -if test $# -le 2; then
> - exit 0
> -fi
> -
> -NM=$1
> -staticlib=$2
> -shift 2
> -# Find symbols defined in static libraries and undefined in shared modules
> -comm -12 \
> - <( $NM -P -g $staticlib | awk '$2!="U"{print "-Wl,-u," $1}' | sort -u) \
> - <( $NM -P -g "$@" | awk '$2=="U"{print "-Wl,-u," $1}' | sort -u)
> --
> 2.27.0.windows.1
>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v5 6/6] meson: Convert undefsym.sh to undefsym.py
2020-08-26 15:22 ` Paolo Bonzini
@ 2020-08-26 15:27 ` 罗勇刚(Yonggang Luo)
0 siblings, 0 replies; 23+ messages in thread
From: 罗勇刚(Yonggang Luo) @ 2020-08-26 15:27 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Daniel P . Berrangé, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 5740 bytes --]
Gotcha, I am confusing about submitting a patch, This is my script to
submit patch, but didn't got the things work.
https://wiki.qemu.org/Contribute/SubmitAPatch#Base_patches_against_current_git_master
Are very long, but I still didn't got the way how to submit patches
properly....
Windows bat for submit patch:
```
rd /s /q v2
git format-patch --subject-prefix="PATCH v5" HEAD~6 -o v2/
git send-email --to=qemu-devel@nongnu.org ^
"--cc=Paolo Bonzini ^<pbonzini@redhat.com^>,Daniel P. Berrangé ^<
berrange@redhat.com^>" v2
:: git send-email --annotate --to=qemu-devel@nongnu.org --cc=QEMU
Developers <qemu-devel@nongnu.org> Paolo Bonzini <pbonzini@redhat.com> v2
pause
```
On Wed, Aug 26, 2020 at 11:23 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
> Careful, the original script:
>
> -comm -12 \
> - <( $NM -P -g $staticlib | awk '$2!="U"{print "-Wl,-u," $1}' | sort -u) \
> - <( $NM -P -g "$@" | awk '$2=="U"{print "-Wl,-u," $1}' | sort -u)
>
> looks for lines that *are* U in the modules. So using filter_lines_set
> is correct for static libraries but wrong for modules.
>
> Paolo
>
> On Wed, Aug 26, 2020 at 5:13 PM <luoyonggang@gmail.com> wrote:
> >
> > From: Yonggang Luo <luoyonggang@gmail.com>
> >
> > undefsym.sh are not msys2 compatible, convert it to python script
> >
> > Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
> > ---
> > meson.build | 2 +-
> > scripts/undefsym.py | 56 +++++++++++++++++++++++++++++++++++++++++++++
> > scripts/undefsym.sh | 20 ----------------
> > 3 files changed, 57 insertions(+), 21 deletions(-)
> > create mode 100644 scripts/undefsym.py
> > delete mode 100755 scripts/undefsym.sh
> >
> > diff --git a/meson.build b/meson.build
> > index 1644bbd83c..d6e3bcea7e 100644
> > --- a/meson.build
> > +++ b/meson.build
> > @@ -845,7 +845,7 @@ foreach d, list : modules
> > endforeach
> >
> > nm = find_program('nm')
> > -undefsym = find_program('scripts/undefsym.sh')
> > +undefsym = find_program('scripts/undefsym.py')
> > block_syms = custom_target('block.syms', output: 'block.syms',
> > input: [libqemuutil, block_mods],
> > capture: true,
> > diff --git a/scripts/undefsym.py b/scripts/undefsym.py
> > new file mode 100644
> > index 0000000000..ebc009fb24
> > --- /dev/null
> > +++ b/scripts/undefsym.py
> > @@ -0,0 +1,56 @@
> > +#!/usr/bin/env python3
> > +# -*- coding: utf-8 -*-
> > +
> > +# Before a shared module's DSO is produced, a static library is built
> for it
> > +# and passed to this script. The script generates -Wl,-u options to
> force
> > +# the inclusion of symbol from libqemuutil.a if the shared modules need
> them,
> > +# This is necessary because the modules may use functions not needed by
> the
> > +# executable itself, which would cause the function to not be linked in.
> > +# Then the DSO loading would fail because of the missing symbol.
> > +
> > +
> > +"""
> > +Compare the static library for compute the symbol duplication
> > +"""
> > +
> > +import sys
> > +import subprocess
> > +
> > +def filter_lines_set(stdout):
> > + linesSet = set()
> > + for line in stdout.splitlines():
> > + tokens = line.split(b' ')
> > + if len(tokens) >= 1:
> > + if len(tokens) > 1 and tokens[1] == b'U':
> > + continue
> > + new_line = b'-Wl,-u,' + tokens[0]
> > + if not new_line in linesSet:
> > + linesSet.add(new_line)
> > + return linesSet
> > +
> > +def main(args):
> > + global _SCRIPT
> > + print(" ".join(args), file=sys.stderr)
> > + if len(args) <= 3:
> > + sys.exit(0)
> > +
> > + nm = args[1]
> > + staticlib = args[2]
> > + pc = subprocess.run([nm, "-P", "-g", staticlib],
> stdout=subprocess.PIPE)
> > + if pc.returncode != 0:
> > + sys.exit(-1)
> > + lines_set_left = filter_lines_set(pc.stdout)
> > +
> > + shared_modules = args[3:]
> > + pc = subprocess.run([nm, "-P", "-g"] + shared_modules,
> stdout=subprocess.PIPE)
> > + if pc.returncode != 0:
> > + sys.exit(-1)
> > + lines_set_right = filter_lines_set(pc.stdout)
> > + lines = []
> > + for line in sorted(list(lines_set_right)):
> > + if line in lines_set_left:
> > + lines.append(line)
> > + sys.stdout.write(b'\n'.join(lines).decode())
> > +
> > +if __name__ == "__main__":
> > + main(sys.argv)
> > diff --git a/scripts/undefsym.sh b/scripts/undefsym.sh
> > deleted file mode 100755
> > index b9ec332e95..0000000000
> > --- a/scripts/undefsym.sh
> > +++ /dev/null
> > @@ -1,20 +0,0 @@
> > -#! /usr/bin/env bash
> > -
> > -# Before a shared module's DSO is produced, a static library is built
> for it
> > -# and passed to this script. The script generates -Wl,-u options to
> force
> > -# the inclusion of symbol from libqemuutil.a if the shared modules need
> them,
> > -# This is necessary because the modules may use functions not needed by
> the
> > -# executable itself, which would cause the function to not be linked in.
> > -# Then the DSO loading would fail because of the missing symbol.
> > -
> > -if test $# -le 2; then
> > - exit 0
> > -fi
> > -
> > -NM=$1
> > -staticlib=$2
> > -shift 2
> > -# Find symbols defined in static libraries and undefined in shared
> modules
> > -comm -12 \
> > - <( $NM -P -g $staticlib | awk '$2!="U"{print "-Wl,-u," $1}' | sort
> -u) \
> > - <( $NM -P -g "$@" | awk '$2=="U"{print "-Wl,-u," $1}' | sort -u)
> > --
> > 2.27.0.windows.1
> >
>
>
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
[-- Attachment #2: Type: text/html, Size: 7892 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja
2020-08-26 15:10 [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja luoyonggang
` (4 preceding siblings ...)
2020-08-26 15:10 ` [PATCH v5 6/6] meson: Convert undefsym.sh to undefsym.py luoyonggang
@ 2020-08-26 15:28 ` Paolo Bonzini
2020-08-26 15:31 ` 罗勇刚(Yonggang Luo)
5 siblings, 1 reply; 23+ messages in thread
From: Paolo Bonzini @ 2020-08-26 15:28 UTC (permalink / raw)
To: luoyonggang; +Cc: Daniel P . Berrangé, qemu-devel
On Wed, Aug 26, 2020 at 5:12 PM <luoyonggang@gmail.com> wrote:
>
> From: Yonggang Luo <luoyonggang@gmail.com>
>
> SIMPLE_PATH_RE should match the full path token.
> Or the $ and : contained in path would not matched if the path are start with C:/ and E:/
I don't understand this, SIMPLE_PATH_RE is used with re.match which
only matches at the beginning of the string. Can you send me your
build.ninja file offlist?
Thanks,
Paolo
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja
2020-08-26 15:28 ` [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja Paolo Bonzini
@ 2020-08-26 15:31 ` 罗勇刚(Yonggang Luo)
2020-08-26 15:36 ` Paolo Bonzini
0 siblings, 1 reply; 23+ messages in thread
From: 罗勇刚(Yonggang Luo) @ 2020-08-26 15:31 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Daniel P . Berrangé, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1478 bytes --]
I can tell you build.ninja can contains $: symbol, that's the escape for
Ninja,
when ninjatool parse it, it will convert $: -> :, so that's not a problem.
This is part of the build.ninja on my computer
```
build version.rc_version.o: CUSTOM_COMMAND_DEP ../qemu.org/version.rc |
C$:/CI-Tools/msys64/mingw64/bin/x86_64-w64-mingw32-windres.EXE ../
qemu.org/pc-bios/qemu-nsis.ico
DEPFILE = "version.rc_version.o.d"
DEPFILE_UNQUOTED = version.rc_version.o.d
COMMAND = "C:/CI-Tools/msys64/mingw64/bin/x86_64-w64-mingw32-windres.EXE"
"-I./." "-I../qemu.org/." "../qemu.org/version.rc" "version.rc_version.o"
"--preprocessor-arg=-MD" "--preprocessor-arg=-MQversion.rc_version.o"
"--preprocessor-arg=-MFversion.rc_version.o.d"
description = Generating$ Windows$ resource$ for$ file$ 'version.rc'$
with$ a$ custom$ command
```
On Wed, Aug 26, 2020 at 11:28 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
> On Wed, Aug 26, 2020 at 5:12 PM <luoyonggang@gmail.com> wrote:
> >
> > From: Yonggang Luo <luoyonggang@gmail.com>
> >
> > SIMPLE_PATH_RE should match the full path token.
> > Or the $ and : contained in path would not matched if the path are start
> with C:/ and E:/
>
> I don't understand this, SIMPLE_PATH_RE is used with re.match which
> only matches at the beginning of the string. Can you send me your
> build.ninja file offlist?
>
> Thanks,
>
> Paolo
>
>
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
[-- Attachment #2: Type: text/html, Size: 2365 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja
2020-08-26 15:31 ` 罗勇刚(Yonggang Luo)
@ 2020-08-26 15:36 ` Paolo Bonzini
2020-08-26 15:39 ` 罗勇刚(Yonggang Luo)
0 siblings, 1 reply; 23+ messages in thread
From: Paolo Bonzini @ 2020-08-26 15:36 UTC (permalink / raw)
To: luoyonggang; +Cc: Daniel P . Berrangé, qemu-devel
On Wed, Aug 26, 2020 at 5:31 PM 罗勇刚(Yonggang Luo) <luoyonggang@gmail.com> wrote:
>
> I can tell you build.ninja can contains $: symbol, that's the escape for Ninja,
> when ninjatool parse it, it will convert $: -> :, so that's not a problem.
> This is part of the build.ninja on my computer
Ok, that's useful. But can you just send the whole file (it's huge but
you can gzip it or something similar)?
Paolo
> ```
> build version.rc_version.o: CUSTOM_COMMAND_DEP ../qemu.org/version.rc | C$:/CI-Tools/msys64/mingw64/bin/x86_64-w64-mingw32-windres.EXE ../qemu.org/pc-bios/qemu-nsis.ico
> DEPFILE = "version.rc_version.o.d"
> DEPFILE_UNQUOTED = version.rc_version.o.d
> COMMAND = "C:/CI-Tools/msys64/mingw64/bin/x86_64-w64-mingw32-windres.EXE" "-I./." "-I../qemu.org/." "../qemu.org/version.rc" "version.rc_version.o" "--preprocessor-arg=-MD" "--preprocessor-arg=-MQversion.rc_version.o" "--preprocessor-arg=-MFversion.rc_version.o.d"
> description = Generating$ Windows$ resource$ for$ file$ 'version.rc'$ with$ a$ custom$ command
> ```
>
> On Wed, Aug 26, 2020 at 11:28 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>> On Wed, Aug 26, 2020 at 5:12 PM <luoyonggang@gmail.com> wrote:
>> >
>> > From: Yonggang Luo <luoyonggang@gmail.com>
>> >
>> > SIMPLE_PATH_RE should match the full path token.
>> > Or the $ and : contained in path would not matched if the path are start with C:/ and E:/
>>
>> I don't understand this, SIMPLE_PATH_RE is used with re.match which
>> only matches at the beginning of the string. Can you send me your
>> build.ninja file offlist?
>>
>> Thanks,
>>
>> Paolo
>>
>
>
> --
> 此致
> 礼
> 罗勇刚
> Yours
> sincerely,
> Yonggang Luo
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja
2020-08-26 15:36 ` Paolo Bonzini
@ 2020-08-26 15:39 ` 罗勇刚(Yonggang Luo)
2020-08-26 15:41 ` Paolo Bonzini
0 siblings, 1 reply; 23+ messages in thread
From: 罗勇刚(Yonggang Luo) @ 2020-08-26 15:39 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Daniel P . Berrangé, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 2070 bytes --]
On Wed, Aug 26, 2020 at 11:37 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
> On Wed, Aug 26, 2020 at 5:31 PM 罗勇刚(Yonggang Luo) <luoyonggang@gmail.com>
> wrote:
> >
> > I can tell you build.ninja can contains $: symbol, that's the escape for
> Ninja,
> > when ninjatool parse it, it will convert $: -> :, so that's not a
> problem.
> > This is part of the build.ninja on my computer
>
> Ok, that's useful. But can you just send the whole file (it's huge but
> you can gzip it or something similar)?
>
> Paolo
>
I am OK with that, but where should I post
>
> > ```
> > build version.rc_version.o: CUSTOM_COMMAND_DEP ../qemu.org/version.rc |
> C$:/CI-Tools/msys64/mingw64/bin/x86_64-w64-mingw32-windres.EXE ../
> qemu.org/pc-bios/qemu-nsis.ico
> > DEPFILE = "version.rc_version.o.d"
> > DEPFILE_UNQUOTED = version.rc_version.o.d
> > COMMAND =
> "C:/CI-Tools/msys64/mingw64/bin/x86_64-w64-mingw32-windres.EXE" "-I./."
> "-I../qemu.org/." "../qemu.org/version.rc" "version.rc_version.o"
> "--preprocessor-arg=-MD" "--preprocessor-arg=-MQversion.rc_version.o"
> "--preprocessor-arg=-MFversion.rc_version.o.d"
> > description = Generating$ Windows$ resource$ for$ file$ 'version.rc'$
> with$ a$ custom$ command
> > ```
> >
> > On Wed, Aug 26, 2020 at 11:28 PM Paolo Bonzini <pbonzini@redhat.com>
> wrote:
> >>
> >> On Wed, Aug 26, 2020 at 5:12 PM <luoyonggang@gmail.com> wrote:
> >> >
> >> > From: Yonggang Luo <luoyonggang@gmail.com>
> >> >
> >> > SIMPLE_PATH_RE should match the full path token.
> >> > Or the $ and : contained in path would not matched if the path are
> start with C:/ and E:/
> >>
> >> I don't understand this, SIMPLE_PATH_RE is used with re.match which
> >> only matches at the beginning of the string. Can you send me your
> >> build.ninja file offlist?
> >>
> >> Thanks,
> >>
> >> Paolo
> >>
> >
> >
> > --
> > 此致
> > 礼
> > 罗勇刚
> > Yours
> > sincerely,
> > Yonggang Luo
>
>
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
[-- Attachment #2: Type: text/html, Size: 3530 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja
2020-08-26 15:39 ` 罗勇刚(Yonggang Luo)
@ 2020-08-26 15:41 ` Paolo Bonzini
2020-08-26 15:45 ` 罗勇刚(Yonggang Luo)
2020-08-26 15:47 ` 罗勇刚(Yonggang Luo)
0 siblings, 2 replies; 23+ messages in thread
From: Paolo Bonzini @ 2020-08-26 15:41 UTC (permalink / raw)
To: luoyonggang; +Cc: Daniel P . Berrangé, qemu-devel
On Wed, Aug 26, 2020 at 5:39 PM 罗勇刚(Yonggang Luo) <luoyonggang@gmail.com> wrote:
>> Ok, that's useful. But can you just send the whole file (it's huge but
>> you can gzip it or something similar)?
>>
>> Paolo
>
> I am OK with that, but where should I post
Just pbonzini@redhat.com.
Regarding the version.rc_version.o target in build.ninja, I see it translated to
version.rc_version.o: private .var.command :=
"C:/CI-Tools/msys64/mingw64/bin/x86_64-w64-mingw32-windres.EXE"
"-I./." "-I../qemu.org/." "../qemu.org/version.rc"
"version.rc_version.o" "--preprocessor-arg=-MD"
"--preprocessor-arg=-MQversion.rc_version.o"
"--preprocessor-arg=-MFversion.rc_version.o.d"
version.rc_version.o: private .var.description := Generating Windows
resource for file 'version.rc' with a custom command
version.rc_version.o: private .var.out := version.rc_version.o
Is this wrong?
Paolo
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja
2020-08-26 15:41 ` Paolo Bonzini
@ 2020-08-26 15:45 ` 罗勇刚(Yonggang Luo)
2020-08-26 15:47 ` 罗勇刚(Yonggang Luo)
1 sibling, 0 replies; 23+ messages in thread
From: 罗勇刚(Yonggang Luo) @ 2020-08-26 15:45 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Daniel P . Berrangé, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 1147 bytes --]
On Wed, Aug 26, 2020 at 11:41 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
> On Wed, Aug 26, 2020 at 5:39 PM 罗勇刚(Yonggang Luo) <luoyonggang@gmail.com>
> wrote:
> >> Ok, that's useful. But can you just send the whole file (it's huge but
> >> you can gzip it or something similar)?
> >>
> >> Paolo
> >
> > I am OK with that, but where should I post
>
> Just pbonzini@redhat.com.
>
> Regarding the version.rc_version.o target in build.ninja, I see it
> translated to
>
> version.rc_version.o: private .var.command :=
> "C:/CI-Tools/msys64/mingw64/bin/x86_64-w64-mingw32-windres.EXE"
> "-I./." "-I../qemu.org/." "../qemu.org/version.rc"
> "version.rc_version.o" "--preprocessor-arg=-MD"
> "--preprocessor-arg=-MQversion.rc_version.o"
> "--preprocessor-arg=-MFversion.rc_version.o.d"
> version.rc_version.o: private .var.description := Generating Windows
> resource for file 'version.rc' with a custom command
> version.rc_version.o: private .var.out := version.rc_version.o
>
> Is this wrong?
>
This is fine
>
>
> Paolo
>
>
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
[-- Attachment #2: Type: text/html, Size: 2408 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja
2020-08-26 15:41 ` Paolo Bonzini
2020-08-26 15:45 ` 罗勇刚(Yonggang Luo)
@ 2020-08-26 15:47 ` 罗勇刚(Yonggang Luo)
2020-08-26 15:56 ` Paolo Bonzini
1 sibling, 1 reply; 23+ messages in thread
From: 罗勇刚(Yonggang Luo) @ 2020-08-26 15:47 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Daniel P . Berrangé, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 98 bytes --]
How about enabling github actions to enable MSYS2 builds in CI.
So we won't break msys2 silently.
[-- Attachment #2: Type: text/html, Size: 192 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja
2020-08-26 15:47 ` 罗勇刚(Yonggang Luo)
@ 2020-08-26 15:56 ` Paolo Bonzini
2020-08-26 16:09 ` 罗勇刚(Yonggang Luo)
0 siblings, 1 reply; 23+ messages in thread
From: Paolo Bonzini @ 2020-08-26 15:56 UTC (permalink / raw)
To: luoyonggang; +Cc: Daniel P . Berrangé, qemu-devel
Yes that would be great. We are tracking all CI "holes" that we didn't
catch before committing the Meson transition, and MSYS is certainly
one of them.
You can send a patch and it will be reviewed and included.
Thanks,
Paolo
On Wed, Aug 26, 2020 at 5:48 PM 罗勇刚(Yonggang Luo) <luoyonggang@gmail.com> wrote:
>
> How about enabling github actions to enable MSYS2 builds in CI.
> So we won't break msys2 silently.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja
2020-08-26 15:56 ` Paolo Bonzini
@ 2020-08-26 16:09 ` 罗勇刚(Yonggang Luo)
2020-08-26 16:17 ` 罗勇刚(Yonggang Luo)
0 siblings, 1 reply; 23+ messages in thread
From: 罗勇刚(Yonggang Luo) @ 2020-08-26 16:09 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Daniel P . Berrangé, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 670 bytes --]
On Wed, Aug 26, 2020 at 11:56 PM Paolo Bonzini <pbonzini@redhat.com> wrote:
> Yes that would be great. We are tracking all CI "holes" that we didn't
> catch before committing the Meson transition, and MSYS is certainly
> one of them.
>
> You can send a patch and it will be reviewed and included.
>
> Thanks,
>
After these patches merged, I'll do that
>
> Paolo
>
> On Wed, Aug 26, 2020 at 5:48 PM 罗勇刚(Yonggang Luo) <luoyonggang@gmail.com>
> wrote:
> >
> > How about enabling github actions to enable MSYS2 builds in CI.
> > So we won't break msys2 silently.
>
>
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
[-- Attachment #2: Type: text/html, Size: 1334 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v5 1/6] meson: Fixes the ninjatool issue that E$$: are generated in Makefile.ninja
2020-08-26 16:09 ` 罗勇刚(Yonggang Luo)
@ 2020-08-26 16:17 ` 罗勇刚(Yonggang Luo)
0 siblings, 0 replies; 23+ messages in thread
From: 罗勇刚(Yonggang Luo) @ 2020-08-26 16:17 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Daniel P . Berrangé, qemu-devel
[-- Attachment #1.1: Type: text/plain, Size: 991 bytes --]
Still very big, I zip it for you. seems meson are not generating
build.ninja in a stable very
On Thu, Aug 27, 2020 at 12:09 AM 罗勇刚(Yonggang Luo) <luoyonggang@gmail.com>
wrote:
>
>
> On Wed, Aug 26, 2020 at 11:56 PM Paolo Bonzini <pbonzini@redhat.com>
> wrote:
>
>> Yes that would be great. We are tracking all CI "holes" that we didn't
>> catch before committing the Meson transition, and MSYS is certainly
>> one of them.
>>
>> You can send a patch and it will be reviewed and included.
>>
>> Thanks,
>>
> After these patches merged, I'll do that
>
>>
>> Paolo
>>
>> On Wed, Aug 26, 2020 at 5:48 PM 罗勇刚(Yonggang Luo) <luoyonggang@gmail.com>
>> wrote:
>> >
>> > How about enabling github actions to enable MSYS2 builds in CI.
>> > So we won't break msys2 silently.
>>
>>
>
> --
> 此致
> 礼
> 罗勇刚
> Yours
> sincerely,
> Yonggang Luo
>
--
此致
礼
罗勇刚
Yours
sincerely,
Yonggang Luo
[-- Attachment #1.2: Type: text/html, Size: 1978 bytes --]
[-- Attachment #2: msys2-issue.zip --]
[-- Type: application/x-zip-compressed, Size: 610991 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread