mbox

[PULL,v2,00/11] capstone + disassembler patch queue

Message ID 20201002165127.130369-1-richard.henderson@linaro.org
State New
Headers show

Pull-request

https://gitlab.com/rth7680/qemu.git tags/pull-cap-20201002

Message

Richard Henderson Oct. 2, 2020, 4:51 p.m. UTC
Version 2 retains a dummy capstone/all makefile target, to avoid
the build failure that Peter saw.


r~


The following changes since commit dd8c1e808f1ca311e1f50bff218c3ee3198b1f02:

  Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20201002' into staging (2020-10-02 14:29:49 +0100)

are available in the Git repository at:

  https://gitlab.com/rth7680/qemu.git tags/pull-cap-20201002

for you to fetch changes up to 94816249a1e14f90f56a2f6e1d566e959e9bc26d:

  disas/capstone: Add skipdata hook for s390x (2020-10-02 11:05:07 -0500)

----------------------------------------------------------------
Update capstone submodule from v3.0.5 to v5 ("next").
Convert submodule build to meson.
Enable capstone disassembly for s390x.
Code cleanups in disas.c

----------------------------------------------------------------
Richard Henderson (11):
      capstone: Convert Makefile bits to meson bits
      capstone: Update to upstream "next" branch
      capstone: Require version 4.0 from a system library
      disas: Move host asm annotations to tb_gen_code
      disas: Clean up CPUDebug initialization
      disas: Use qemu/bswap.h for bfd endian loads
      disas: Cleanup plugin_disas
      disas: Configure capstone for aarch64 host without libvixl
      disas: Split out capstone code to disas/capstone.c
      disas: Enable capstone disassembly for s390x
      disas/capstone: Add skipdata hook for s390x

 configure                 |  68 +----
 Makefile                  |  18 +-
 meson.build               | 124 +++++++-
 include/disas/dis-asm.h   | 104 +++----
 include/disas/disas.h     |   2 +-
 include/exec/log.h        |   4 +-
 accel/tcg/translate-all.c |  24 +-
 disas.c                   | 707 +++++++++++-----------------------------------
 disas/capstone.c          | 326 +++++++++++++++++++++
 target/s390x/cpu.c        |   4 +
 tcg/tcg.c                 |   4 +-
 capstone                  |   2 +-
 disas/meson.build         |   1 +
 meson_options.txt         |   4 +
 14 files changed, 687 insertions(+), 705 deletions(-)
 create mode 100644 disas/capstone.c

Comments

Peter Maydell Oct. 2, 2020, 8:37 p.m. UTC | #1
On Fri, 2 Oct 2020 at 17:51, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Version 2 retains a dummy capstone/all makefile target, to avoid
> the build failure that Peter saw.
>
>
> r~
>
>
> The following changes since commit dd8c1e808f1ca311e1f50bff218c3ee3198b1f02:
>
>   Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20201002' into staging (2020-10-02 14:29:49 +0100)
>
> are available in the Git repository at:
>
>   https://gitlab.com/rth7680/qemu.git tags/pull-cap-20201002
>
> for you to fetch changes up to 94816249a1e14f90f56a2f6e1d566e959e9bc26d:
>
>   disas/capstone: Add skipdata hook for s390x (2020-10-02 11:05:07 -0500)
>
> ----------------------------------------------------------------
> Update capstone submodule from v3.0.5 to v5 ("next").
> Convert submodule build to meson.
> Enable capstone disassembly for s390x.
> Code cleanups in disas.c
>

Meson warning on the BSDs:

Configuring sparc-bsd-user-config-target.h using configuration
Configuring sparc64-bsd-user-config-target.h using configuration
Configuring x86_64-bsd-user-config-target.h using configuration
Did not find CMake 'cmake'
Found CMake: NO
Run-time dependency capstone found: NO (tried pkgconfig and cmake)
../src/meson.build:753: WARNING: Trying to compare values of different
types (bool, str) using ==.
The result of this is undefined and will become a hard error in a
future Meson release.
Configuring config-host.h using configuration
Program scripts/hxtool found: YES
Program scripts/shaderinclude.pl found: YES
Program scripts/qapi-gen.py found: YES
Program scripts/qemu-version.sh found: YES
Run-time dependency threads found: YES
Program keycodemapdb/tools/keymap-gen found: YES
Program scripts/decodetree.py found: YES

Warning from ppc64be box (gcc compilefarm one):

Configuring sh4eb-linux-user-config-target.h using configuration
Configuring sparc-linux-user-config-target.h using configuration
Configuring sparc32plus-linux-user-config-target.h using configuration
Configuring sparc64-linux-user-config-target.h using configuration
Configuring x86_64-linux-user-config-target.h using configuration
Configuring xtensa-linux-user-config-target.h using configuration
Configuring xtensaeb-linux-user-config-target.h using configuration
Found CMake: /usr/bin/cmake (2.8.12.2)
WARNING: The version of CMake /usr/bin/cmake is 2.8.12.2 but version
>=3.4 is required
Run-time dependency capstone found: NO (tried pkgconfig and cmake)
Configuring capstone-defs.h using configuration
Configuring config-host.h using configuration

We shouldn't be looking for or using cmake at all.

thanks
-- PMM
Richard Henderson Oct. 2, 2020, 10:54 p.m. UTC | #2
On 10/2/20 3:37 PM, Peter Maydell wrote:
> Meson warning on the BSDs:
> 
> Configuring sparc-bsd-user-config-target.h using configuration
> Configuring sparc64-bsd-user-config-target.h using configuration
> Configuring x86_64-bsd-user-config-target.h using configuration
> Did not find CMake 'cmake'
> Found CMake: NO
> Run-time dependency capstone found: NO (tried pkgconfig and cmake)
> ../src/meson.build:753: WARNING: Trying to compare values of different
> types (bool, str) using ==.
> The result of this is undefined and will become a hard error in a
> future Meson release.
> Configuring config-host.h using configuration
> Program scripts/hxtool found: YES
> Program scripts/shaderinclude.pl found: YES
> Program scripts/qapi-gen.py found: YES
> Program scripts/qemu-version.sh found: YES
> Run-time dependency threads found: YES
> Program keycodemapdb/tools/keymap-gen found: YES
> Program scripts/decodetree.py found: YES
> 
> Warning from ppc64be box (gcc compilefarm one):
> 
> Configuring sh4eb-linux-user-config-target.h using configuration
> Configuring sparc-linux-user-config-target.h using configuration
> Configuring sparc32plus-linux-user-config-target.h using configuration
> Configuring sparc64-linux-user-config-target.h using configuration
> Configuring x86_64-linux-user-config-target.h using configuration
> Configuring xtensa-linux-user-config-target.h using configuration
> Configuring xtensaeb-linux-user-config-target.h using configuration
> Found CMake: /usr/bin/cmake (2.8.12.2)
> WARNING: The version of CMake /usr/bin/cmake is 2.8.12.2 but version
>> =3.4 is required
> Run-time dependency capstone found: NO (tried pkgconfig and cmake)
> Configuring capstone-defs.h using configuration
> Configuring config-host.h using configuration
> 
> We shouldn't be looking for or using cmake at all.

Huh.  I hadn't noticed that before.
I think it's coming from meson internally, but I'm not sure what's causing.
Certainly it is not something I asked for.

So it's a warning.  Does the build succeed?


r~
Paolo Bonzini Oct. 3, 2020, 7:06 a.m. UTC | #3
On 02/10/20 22:37, Peter Maydell wrote:
> Found CMake: /usr/bin/cmake (2.8.12.2)
> WARNING: The version of CMake /usr/bin/cmake is 2.8.12.2 but version
>> =3.4 is required
> Run-time dependency capstone found: NO (tried pkgconfig and cmake)
> Configuring capstone-defs.h using configuration
> Configuring config-host.h using configuration
> 
> We shouldn't be looking for or using cmake at all.

This is a missing "method: 'pkg-config'".

Paolo
Paolo Bonzini Oct. 3, 2020, 7:12 a.m. UTC | #4
On 02/10/20 22:37, Peter Maydell wrote:
> ../src/meson.build:753: WARNING: Trying to compare values of different
> types (bool, str) using ==.
> The result of this is undefined and will become a hard error in a
> future Meson release.
> Configuring config-host.h using configuration
> Program scripts/hxtool found: YES
> Program scripts/shaderinclude.pl found: YES
> Program scripts/qapi-gen.py found: YES
> Program scripts/qemu-version.sh found: YES
> Run-time dependency threads found: YES
> Program keycodemapdb/tools/keymap-gen found: YES
> Program scripts/decodetree.py found: YES

This can be rewritten like

-if capstone_opt == 'disabled'
-  capstone_opt = false
-elif capstone_opt in ['enabled', 'auto', 'system']
+if capstone_opt in ['enabled', 'auto', 'system']
   have_internal = fs.exists('capstone/Makefile')
   capstone = dependency('capstone', static: enable_static,
                         required: capstone_opt == 'system' or
                                   capstone_opt == 'enabled' and not have_internal)
   if capstone.found()
     capstone_opt = 'system'
   elif have_internal
     capstone_opt = 'internal'
   else
-    capstone_opt = false
+    capstone_opt = 'disabled'
   endif
 endif
 if capstone_opt == 'internal'

...
-summary_info += {'capstone':          capstone_opt}
+summary_info += {'capstone':          capstone_opt == 'disabled' ? false : capstone_opt}


That said, this also showed a bug which can be fixed like this:

-  have_internal = fs.exists('capstone/Makefile')
+  have_internal = fs.exists(meson.current_source_dir() / 'capstone/Makefile')

Paolo
Richard Henderson Oct. 3, 2020, 9:21 a.m. UTC | #5
On 10/3/20 2:06 AM, Paolo Bonzini wrote:
> On 02/10/20 22:37, Peter Maydell wrote:
>> Found CMake: /usr/bin/cmake (2.8.12.2)
>> WARNING: The version of CMake /usr/bin/cmake is 2.8.12.2 but version
>>> =3.4 is required
>> Run-time dependency capstone found: NO (tried pkgconfig and cmake)
>> Configuring capstone-defs.h using configuration
>> Configuring config-host.h using configuration
>>
>> We shouldn't be looking for or using cmake at all.
> 
> This is a missing "method: 'pkg-config'".

Ah, thanks.


r~